Terminal device and file transmission method based on MTP

By detecting file transfer anomalies on the terminal device and generating prompts, the problem of users being unable to determine the cause of file transfer failures is solved, thus improving the user experience.

CN114925027BActive Publication Date: 2025-11-04QINGDAO HISENSE MOBILE COMM TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210610344.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-31
Publication Date
2025-11-04
Estimated Expiration
2042-05-31

AI Technical Summary

Technical Problem

During file transfer, existing technologies cannot effectively determine the cause of file transfer failure, leaving users unable to understand the reason for the failure and affecting the user experience.

Method used

By setting up a processing unit and a notification unit in the terminal device, file transfer anomalies can be detected, file description information can be obtained, and prompt information can be generated and output to inform the user of the reason for the anomaly.

Benefits of technology

It enables the identification of the cause of file transfer errors and prompts the user, improving the user experience and helping users resolve file transfer interruption issues.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114925027B_ABST
    Figure CN114925027B_ABST
Patent Text Reader

Abstract

The application discloses a terminal device and a file transmission method based on MTP, and relates to the technical field of computers. The terminal device comprises: a first processing unit configured to cache file description information from a second terminal device; if an exception occurs when the kernel layer performs a first operation on a first file from the second terminal device, determining an exception cause, obtaining file description information associated with the first file in the cached file description information, and sending the file description information associated with the first file and the exception cause to a notification unit; the notification unit is configured to send the file description information associated with the first file and the exception cause to the application layer; the application layer is configured to generate prompt information according to the file description information associated with the first file and the exception cause, and output the prompt information.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the computer technical field, and particularly relate to a terminal device and a file transmission method based on MTP. BACKGROUND

[0002] Media Transfer Protocol (MTP) technology is a kind of data synchronization technology. A mobile terminal supporting MTP service is connected to a Windows operating system for data transmission without installing any driver. For example, when connected, the computer first sends a connection command to the mobile terminal, and after obtaining the response of the mobile terminal, data transmission can be performed. The computer opens the content stored in the mobile terminal through a Windows media player or a file browser; the mobile terminal can upload data to the computer, and the computer can also download data to the mobile terminal for storage. However, various types of exceptions (for example, non-standard file format, MTP enabling exception, etc.) may occur during the file transmission process in this scenario, resulting in file transmission failure. If it is not clear what causes the file transmission failure, and it is not known what way to recover to normal, the file transmission will always fail in the file transmission process and the user cannot know the reason, thereby affecting the user experience.

[0003] Therefore, when the file transmission occurs an exception, how to determine the reason for the file transmission failure and prompt the user is a problem that needs to be solved at present. SUMMARY

[0004] Embodiments of the present application provide a terminal device to determine the reason for file transmission failure and prompt the user.

[0005] In a first aspect, a terminal device is provided. The terminal device is a first terminal device, and includes a memory, a display screen, and a processor. The processor runs a first processing unit and a notification unit. The first processing unit is located in a system layer in a software system architecture of the first terminal device. The notification unit is located in an application framework layer in the software system architecture. The software system architecture further includes a kernel layer and an application layer. The memory is configured to store computer instructions. The display screen is configured to display a user interface. The first processing unit is configured to cache file description information from a second terminal device. The file description information includes file description information corresponding to at least one file. If an exception occurs when the kernel layer performs a first operation on a first file from the second terminal device, the first processing unit determines an exception cause, obtains file description information associated with the first file from the cached file description information, and sends the file description information associated with the first file and the exception cause to the notification unit. The notification unit is configured to send the file description information associated with the first file and the exception cause to the application layer. The application layer is configured to generate prompt information according to the file description information associated with the first file and the exception cause, and output the prompt information.

[0006] In a possible implementation, the first operation includes a file copy operation. The first processing unit is specifically configured to obtain the file description information associated with the first file from the cached file description information if the exception cause is an irregular file format. The exception cause included in the prompt information generated by the application layer is an irregular file format.

[0007] In a possible implementation, the prompt information includes a file name of the first file and the exception cause.

[0008] In a possible implementation, the processor further runs a second processing unit. The second processing unit is located in the system layer. The second processing unit is configured to generate a first instruction to be sent to the second terminal device. If it is detected that the first instruction fails to be sent and a current system resource state is busy, it is determined whether there is an instruction from the second terminal device that has not been executed. If there is an instruction from the second terminal device that has not been executed, it is determined that an instruction sending operation and a receiving operation conflict, and the first instruction is cached. If a set waiting time period is exceeded and no new instruction from the second terminal device is received, the cached first instruction is sent.

[0009] In a possible implementation, the terminal device comprises a first queue configured to buffer an instruction from the second terminal device and not executed by the second terminal device; and the second processing unit is specifically configured to determine that there is an instruction from the second communication device not executed if the first queue is not empty.

[0010] In a possible implementation, the processor further runs a third processing unit and a media transmission protocol (MTP) state unit, the third processing unit is located at the system layer, and the MTP state unit is located at the kernel layer.

[0011] The third processing unit is configured to acquire a value of an enable flag of an MTP device in response to a user operation of starting an MTP function, and send the value of the enable flag of the MTP device to the MTP state unit; the MTP state unit is configured to reset the value of the enable flag of the MTP device to an off state if it is determined that the value of the enable flag of the MTP device is in an on state, generate a notification message, and send the notification message to the third processing unit; the third processing unit is configured to send a restart instruction of starting the MTP function to the MTP state unit according to the notification message; and the MTP state unit is configured to start the MTP function according to the restart instruction, and set the value of the enable flag of the MTP device to the on state.

[0012] In a second aspect, a file transmission method of an MTP is provided, and applied to a first terminal device, comprising the following steps.

[0013] buffering file description information from a second terminal device; receiving a first file from the second terminal device, performing a first operation on the first file; if it is detected that the first operation is abnormal, determining an abnormal reason, acquiring file description information associated with the first file in the buffered file description information, generating prompt information according to the file description information associated with the first file and the abnormal reason, and outputting the prompt information.

[0014] In a possible implementation, the method further comprises the following steps.

[0015] generating a first instruction to be sent to the second terminal device; if it is detected that the first instruction fails to be sent, and a current state of a system resource is busy, determining whether there is an instruction from the second terminal device not executed at present; if there is an instruction from the second terminal device not executed at present, determining that an instruction sending operation and a receiving operation conflict, and buffering the first instruction; and if a set waiting time period is exceeded and no new instruction from the second terminal device is received, sending the buffered first instruction.

[0016] In a possible implementation manner, the method further includes:

[0017] In response to a user operation of starting the MTP function, obtaining a value of an enabling flag of the MTP device;

[0018] If the value of the enabling flag of the MTP device is in an on state, resetting the value of the enabling flag of the MTP device to an off state; initiating an operation of starting the MTP function, and setting the value of the enabling flag of the MTP device to the on state.

[0019] In a third aspect, a computer readable storage medium is provided, and the computer readable storage medium stores computer executable instructions. The computer executable instructions are used to cause a computer to execute the method in any one of the second aspect.

[0020] In the embodiments of the present application, when an exception occurs when an operation (for example, copying a file) on a first file is detected, the file description information associated with the first file in the cached file description information is obtained by determining the cause of the exception, the prompt information is generated according to the file description information associated with the first file and the cause of the exception, and the prompt information is output. Therefore, the user can be reminded of which file in the file transmission process caused the exception and the cause of the exception, and the file transmission is interrupted, so that the error file can be solved, and the user experience is improved.

[0021] On the basis of common knowledge in the art, the above-mentioned preferred conditions can be combined in any manner, that is, the preferred embodiments of the present application are obtained. BRIEF DESCRIPTION OF DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0023] Figure 1a A scene schematic diagram suitable for the embodiments of the present application;

[0024] Figure 1b A progress schematic diagram displayed on the interface of the second terminal device 10;

[0025] Figure 1c A progress schematic diagram displayed on the interface of the first terminal device 11;

[0026] Figure 2 A structure schematic diagram of the terminal device 100 provided by the embodiments of the present application;

[0027] Figure 3 A software structure block diagram of the terminal device 100 of the embodiment of the present application;

[0028] Figure 4a A structure schematic diagram of the newly added function module in the first terminal device of the embodiment of the present application;

[0029] Figure 4b A structure schematic diagram of the newly added function module in the first terminal device of the embodiment of the present application;

[0030] Figure 4c A structure schematic diagram of the newly added function module in the first terminal device of the embodiment of the present application;

[0031] Figure 4d A structure schematic diagram of the newly added function module in the first terminal device of the embodiment of the present application;

[0032] Figure 5 A flow chart of a file transmission method based on MTP provided by the embodiment of the present application;

[0033] Figure 6 A schematic diagram of a prompt window provided by the embodiment of the present application;

[0034] Figure 7 A flow chart of another file transmission method based on MTP provided by the embodiment of the present application;

[0035] Figure 8a An interaction schematic diagram of each level of the first terminal device provided by the embodiment of the present application;

[0036] Figure 8b A message interaction schematic diagram of each level of the first terminal device provided by the embodiment of the present application;

[0037] Figure 9 A flow chart of processing an instruction from a second terminal device provided by the embodiment of the present application;

[0038] Figure 10a A flow chart of a recovery method for the failure of executing an instruction based on MTP provided by the embodiment of the present application;

[0039] Figure 10b A message interaction schematic diagram of each level of the first terminal device provided by the embodiment of the present application;

[0040] Figure 11 A flow chart of an enabling state detection method of MTP function provided by the embodiment of the present application;

[0041] Figure 12aA first terminal device of each level of interaction schematic diagram provided by an embodiment of the present application;

[0042] Figure 12b A message interaction schematic diagram of each level of a first terminal device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0043] The technical solutions in the embodiments of the present application will be described clearly and exhaustively in combination with the drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " represents the meaning of or, for example, A / B can represent A or B; the "and / or" in the text is only a description of the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which means that there are three cases of A alone, A and B together, and B alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0044] Hereinafter, the terms "first" and "second" are used for description purposes only, and cannot be understood as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined with "first" and "second" can explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" is two or more than two.

[0045] In the embodiments of the present application, the first terminal device can act as an MTP response end device in the MTP application, and the second terminal device can act as an MTP initiation end device in the MTP application, and their relationship is as shown in Figure 1a The first terminal device 11 can specifically refer to an Android tablet computer, and the second terminal device 10 can specifically refer to a personal computer (PC).

[0046] The second terminal device 10 as an initiation end device is mainly used to initiate a request in the MTP. For example, the PC sends a request to the Android tablet computer to transmit a file, and for example, requests to obtain a file on the Android tablet computer.

[0047] The first terminal device 11 as a response end device is mainly used to process the request initiated by the second terminal device 10, and also sends an Event event, for example, processing the file transmission request initiated by the PC.

[0048] In the embodiments of the present application, the communication between the second terminal device 10 and the first terminal device 11 can be realized through wired connection, for example, the Universal Serial Bus (USB) is used to connect and communicate the first terminal device 11 and the second terminal device 10. The communication between the second terminal device 10 and the first terminal device 11 can also be realized through wireless connection.

[0049] In the MTP scenario, when copying the file from the second terminal device 10 to the first terminal device 11, the first terminal device 11 will first receive the file description information (for example, the file name, the file format, the file size, etc.) sent by the second terminal device 10, and then receive the file, and perform the copy operation on the file. If the file is not standardized (for example, the file name is too long) at this time, the file copy will fail and the transmission will be terminated, and the progress bar displayed on the interface of the second terminal device 10 will stop (as shown in Figure 1b , and the progress bar displayed on the interface of the first terminal device 11 will also stop (as shown in Figure 1c . However, no prompt information will be given on the user interface, thereby affecting the user experience.

[0050] To solve the above problem, in the embodiments of the present application, for the interruption of file transmission, the active detection and the prompt on the interface can be given.

[0051] Figure 2 The structure schematic diagram of the terminal device 100 provided in the embodiments of the present application is shown.

[0052] The terminal device 100 can be specifically the first terminal device 11 in Figure 1a .

[0053] The terminal device 100 in the embodiments of the present application supports the multi-window mode.

[0054] The embodiments will be specifically described below taking the terminal device 100 as an example.

[0055] Figure 2 The terminal device 100 shown in Figure 2 is only an example, and the terminal device 100 can have more or less components than those shown in , can combine two or more components, or can have a different component configuration. The various components shown in the figure can be realized in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.

[0056] Figure 2 The hardware configuration block diagram of the terminal device 100 according to the exemplary embodiments is exemplarily shown in Figure 2As shown, the terminal device 100 includes radio frequency (RF) circuit 110, memory 120, display unit 130, camera 140, sensor 150, audio circuit 160, Wireless Fidelity (Wi-Fi) module 170, processor 180, Bluetooth module 181, and power supply 190, etc.

[0057] The RF circuit 110 can be used for receiving and sending signals in the process of transceiving information or talking, and can receive downlink data of a base station and hand over the downlink data to the processor 180 for processing; and can send uplink data to the base station. Generally, the RF circuit includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier, a duplexer, etc.

[0058] The memory 120 can be used to store software programs and data. The processor 180 executes various functions and data processing of the terminal device 100 by running the software programs or data stored in the memory 120. The memory 120 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device. The memory 120 stores an operating system that enables the terminal device 100 to run. In the embodiments of the present application, the memory 120 can store an operating system and various application programs, and can also store codes for executing the methods described in the embodiments of the present application.

[0059] The display unit 130 can be used to receive input digital or character information, and generate signal input related to user settings and function control of the terminal device 100. Specifically, the display unit 130 can include a touch screen 131 arranged on the front of the terminal device 100, and can collect touch operations of the user thereon or nearby, such as clicking buttons, dragging scroll boxes, etc.

[0060] The display unit 130 can also be used to display information input by the user or information provided to the user, and a graphical user interface (GUI) of various menus of the terminal device 100. Specifically, the display unit 130 can include a display screen 132 arranged on the front of the terminal device 100. The display screen 132 can be configured in the form of a liquid crystal display, a light-emitting diode, etc. The display unit 130 can be used to display various graphical user interfaces described in the embodiments of the present application.

[0061] The touch screen 131 can be overlaid on the display screen 132, or the touch screen 131 can be integrated with the display screen 132 to realize the input and output functions of the terminal device 100. After integration, it can be simply referred to as a touch display screen. The display unit 130 in the embodiments of the present application can display application programs and corresponding operation steps.

[0062] The camera 140 can be used to capture still images or video. An object projects an optical image through a lens onto a photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then passed to the processor 180 for conversion into a digital image signal.

[0063] The terminal device 100 can also include at least one sensor 150, such as an acceleration sensor 151, a distance sensor 152, a fingerprint sensor 153, a temperature sensor 154. The terminal device 100 can also be configured with a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, a light sensor, a motion sensor, and other sensors.

[0064] The audio circuit 160, the speaker 161, and the microphone 162 can provide an audio interface between the user and the terminal device 100. The audio circuit 160 can convert the received audio data into an electrical signal and transmit it to the speaker 161, which converts it into an audible signal for output. The terminal device 100 can also be configured with a volume button for adjusting the volume of the audible signal. On the other hand, the microphone 162 converts the collected sound signal into an electrical signal, which is received by the audio circuit 160 and converted into audio data, which is then output to the RF circuit 110 for transmission to another terminal, for example, or to the memory 120 for further processing. In the embodiments of the present application, the microphone 162 can acquire the user's voice.

[0065] Wi-Fi is a short-range wireless transmission technology, and the terminal device 100 can help users send and receive emails, browse web pages, and access streaming media through the Wi-Fi module 170, which provides users with wireless broadband Internet access.

[0066] The processor 180 is the control center of the terminal device 100. It connects various parts of the terminal via various interfaces and lines, and performs various functions and processes data by running or executing software programs stored in the memory 120 and calling data stored in the memory 120. In some embodiments, the processor 180 may include one or more processing units; the processor 180 may also integrate an application processor and a baseband processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the baseband processor mainly handles wireless communication. It is understood that the baseband processor may not be integrated into the processor 180. In the embodiments of this application, the processor 180 can run the operating system, applications, user interface display and touch response, and the processing methods described in the embodiments of this application. Furthermore, the processor 180 is coupled to the display unit 130 and the camera 140.

[0067] Bluetooth module 181 is used to interact with other Bluetooth devices that also have Bluetooth modules via the Bluetooth protocol. For example, terminal device 100 can establish a Bluetooth connection with wearable electronic devices (such as smartwatches) that also have Bluetooth modules through Bluetooth module 181, thereby exchanging data.

[0068] The terminal device 100 also includes a power supply 190 (such as a battery) that supplies power to various components. The power supply can be logically connected to the processor 180 through a power management system, thereby enabling the management of charging, discharging, and power consumption. The terminal device 100 may also be equipped with a power button for powering on and off, as well as locking the screen.

[0069] Figure 3 This is a software structure block diagram of the terminal device 100 according to an embodiment of this application.

[0070] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries (also known as the system layer), and the kernel layer.

[0071] The application layer can include a series of application packages.

[0072] like Figure 3 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.

[0073] The application framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer. The application framework layer includes some pre-defined functions.

[0074] The application framework layer can include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc.

[0075] The window manager is used to manage window programs. The window manager can acquire the size of a display screen, determine whether there is a status bar, lock a screen, and capture a screen, etc.

[0076] The content provider is used to store and acquire data, and make the data accessible to applications. The data can include videos, images, audios, dialed and received calls, browsing history and bookmarks, a phone book, etc.

[0077] The view system includes visual controls, such as a control for displaying text, a control for displaying pictures, etc. The view system can be used to build an application. A display interface can be composed of one or more views. For example, a display interface including a short message notification icon can include a view for displaying text and a view for displaying pictures.

[0078] The phone manager is used to provide communication functions of the terminal device 100. For example, management of a call state (including call connection and call hang-up, etc.).

[0079] The resource manager provides various resources for applications, such as localized strings, icons, pictures, layout files, video files, etc.

[0080] The resource manager provides various resources for applications, such as localized strings, icons, pictures, layout files, video files, etc.

[0081] The notification manager enables an application to display notification information in a status bar. The notification manager can be used to convey a message of the notification type, which can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify a download completion, a message reminder, etc. The notification manager can also be a notification in the form of a graph or a scroll bar text appearing in the top status bar of the system, such as a notification of an application running in the background, or a notification appearing in the form of a dialog window on the screen. For example, a text information is prompted in the status bar, a prompt sound is emitted, the communication terminal is vibrated, a light is blinked, etc.

[0082] The Android runtime includes a core library and a virtual machine. The Android runtime is responsible for scheduling and management of the Android system.

[0083] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.

[0084] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0085] The system layer can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.

[0086] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.

[0087] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.

[0088] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0089] A 2D graphics engine is a graphics engine for 2D drawing.

[0090] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.

[0091] Some embodiments of this application can extend the functionality of the system layer, application framework layer, etc., thereby enabling the detection of file transfer anomalies during file transfer.

[0092] Figure 4a This is a schematic diagram of the structure of a newly added functional module inside the first terminal device provided in this application embodiment. As shown in the figure, the system layer of the device includes a first processing unit 903a, and the application framework layer includes a notification unit 902a.

[0093] based on Figure 4a The structure shown indicates that during file transfer, if an error occurs, the first terminal device (such as...) will... Figure 1a The first terminal device 11) can provide prompts, which can be implemented by the first processing unit 903a, the notification unit 902a, the kernel layer, and the application layer. For example, based on... Figure 4aIn the illustrated architecture, the kernel layer is configured to receive file description information from the second terminal device and send the file description information to the system layer, and receive a first file from the second terminal device and perform a first operation on the first file. The first processing unit 901a is configured to cache the file description information from the second terminal device, determine an abnormality cause if the first operation is detected to be abnormal, obtain file description information associated with the first file from the cached file description information, and send the file description information associated with the first file and the abnormality cause to the notification unit 902a. The notification unit 902a is configured to receive the file description information associated with the first file and the abnormality cause from the first processing unit 903a, and send the file description information associated with the first file and the abnormality cause to the application layer. The application layer is configured to generate prompt information according to the file description information and the abnormality cause from the notification unit 902a, and output the prompt information.

[0094] The file transmission method described above can be implemented according to the following Figure 5 or Figure 7 or Figure 8a .

[0095] In some embodiments, based on Figure 4a the structure illustrated, a second processing unit 903b can be further added in the system layer. As Figure 4b illustrated, the system layer in the device includes the first processing unit 903a and the second processing unit 903b, and the application program framework layer includes the notification unit 902a.

[0096] Based on Figure 4b the structure illustrated, in addition to detecting file transmission abnormalities in the file transmission process, a detection function and a recovery mechanism are provided for instruction execution failures in the MTP instruction execution process, which can be implemented by the second processing unit 903b. For example, based on Figure 4b the architecture illustrated, the second processing unit 903b is configured to generate a first instruction to be sent to the second terminal device, determine whether there is an instruction from the second terminal device that has not been executed completely if the first instruction is detected to fail to be sent and the current system resource state is busy, determine that the instruction sending operation and the instruction receiving operation conflict if there is an instruction from the second terminal device that has not been executed completely, cache the first instruction, and send the cached first instruction if a new instruction from the second terminal device is not received within a set waiting time.

[0097] The instruction execution failure recovery method described above can be implemented according to the following Figure 10a .

[0098] In some embodiments, based on Figure 4aAs shown in the structure, the third processing unit 903c is added in the system layer, and the MTP state unit 904a is added in the kernel layer. As shown in the structure, the third processing unit 903c is used to acquire the value of the enable flag of the MTP device in response to the user operation of starting the MTP function, and send the value of the enable flag of the MTP device to the MTP state unit 904a. The MTP state unit 904a is used to judge that the value of the enable flag of the MTP device is in the starting state, reset the value of the enable flag of the MTP device to the closing state, generate a notification message, and send the notification message to the third processing unit 903c. The third processing unit 903c is used to send a restart instruction of starting the MTP function to the MTP state unit 904a according to the notification message. The MTP state unit 904a is used to start the MTP function according to the restart instruction, and set the value of the enable flag of the MTP device to the starting state. Figure 4c As shown in the structure, the third processing unit 903c is added in the system layer, and the MTP state unit 904a is added in the kernel layer. As shown in the structure, the third processing unit 903c is used to acquire the value of the enable flag of the MTP device in response to the user operation of starting the MTP function, and send the value of the enable flag of the MTP device to the MTP state unit 904a. The MTP state unit 904a is used to judge that the value of the enable flag of the MTP device is in the starting state, reset the value of the enable flag of the MTP device to the closing state, generate a notification message, and send the notification message to the third processing unit 903c. The third processing unit 903c is used to send a restart instruction of starting the MTP function to the MTP state unit 904a according to the notification message. The MTP state unit 904a is used to start the MTP function according to the restart instruction, and set the value of the enable flag of the MTP device to the starting state. Figure 4c As shown in the structure, the third processing unit 903c is added in the system layer, and the MTP state unit 904a is added in the kernel layer. As shown in the structure, the third processing unit 903c is used to acquire the value of the enable flag of the MTP device in response to the user operation of starting the MTP function, and send the value of the enable flag of the MTP device to the MTP state unit 904a. The MTP state unit 904a is used to judge that the value of the enable flag of the MTP device is in the starting state, reset the value of the enable flag of the MTP device to the closing state, generate a notification message, and send the notification message to the third processing unit 903c. The third processing unit 903c is used to send a restart instruction of starting the MTP function to the MTP state unit 904a according to the notification message. The MTP state unit 904a is used to start the MTP function according to the restart instruction, and set the value of the enable flag of the MTP device to the starting state.

[0099] The flow of the MTP function enable state abnormality detection and error correction method is described below. Figure 11 or Figure 12a

[0100] In some other embodiments, as shown in the structure, the second processing unit 903b and the third processing unit 903c are added in the system layer, and the MTP state unit 904a is added in the kernel layer. As shown in the structure, the system layer of the device includes the first processing unit 903a, the second processing unit 903b, and the third processing unit 903c, the application framework layer includes the notification unit 902a, and the kernel layer includes the MTP state unit 904a. The method flow of any of the above three embodiments can be used to implement the above method flow, and the specific functions of each unit are described above and will not be repeated here. Figure 4a Figure 4d

[0101] Figure 5 A flowchart of a file transmission method based on MTP provided by the embodiments of the present application. The method can be executed by the first terminal device (for example, as shown in the structure of the first terminal device in the first embodiment of the present application). Figure 1a ​​​The first terminal device 11 (an Android tablet) in the system 1000 executes (specifically, an application layer, a notification unit 902a of an application framework layer, a first processing unit 903a of a system layer, a kernel layer, etc. of the system 1000 can execute). As shown in the figure, the flow includes the following steps:

[0102] 501: Cache file description information from the second terminal device.

[0103] The second terminal device can be a PC, for example. Figure 1a

[0104] The file description information can include file description information corresponding to at least one file. Optionally, the file description information can include a file name, a file format, a file size, etc. According to the MTP protocol, the PC sends the file description information to the Android tablet before performing file transmission.

[0105] Optionally, the file description information can be cached in a global variable (file_name).

[0106] 502: Receive a first file from the second terminal device, and perform a first operation on the first file.

[0107] The first file can be an image file, a music file, a media file, etc., which is not limited in the embodiments of the present application.

[0108] Optionally, the first operation can be a file copy operation, a file move operation, etc.

[0109] 503: When an exception in the first operation is detected, determine an exception cause.

[0110] Optionally, the exception cause can include an irregular file format, for example, the irregular file format can be that a file name is too long, or the file name contains characters that cannot be recognized, etc.

[0111] 504: Obtain file description information associated with the first file from the cached file description information.

[0112] For example, the file description information associated with the first file can be obtained from the global variable (file_name).

[0113] 505: Generate prompt information according to the file description information associated with the first file and the exception cause, and output the prompt information.

[0114] Optionally, the prompt information includes a file name of the first file and the exception cause.

[0115] ​In this step, a prompt message is output. This prompt may take the form of a voice prompt or a pop-up prompt window on the user interface. This application embodiment does not limit the method of outputting the prompt message. For example... Figure 6 As shown, when a prompt message is generated, a prompt window 600 can pop up. The prompt window 600 can be a floating window displayed on top. The prompt window 600 displays a prompt message, which may include the file name (e.g., "Aurora...fallen star" in the prompt window 600), the reason for the file transfer error (e.g., "excessively long filename" in the prompt window 600), and suggestions for resuming the file transfer (e.g., "modify the excessively long filename and copy it again" in the prompt window 600). By outputting the above prompt message, users can easily take appropriate measures, such as resolving the problem based on the cause of the error to resume the file operation process, ending the file operation process, or taking other actions.

[0116] In this embodiment, when an exception is detected when performing an operation (e.g., copying a file) on the first file, the cause of the exception is determined, the file description information associated with the first file in the cached file description information is obtained, and a prompt message is generated and output based on the file description information associated with the first file and the cause of the exception. Therefore, the user can be reminded which file the exception occurred in during the file transfer process and the cause of the exception, which caused the file transfer to be interrupted. This allows for targeted resolution of the erroneous file and improves the user experience.

[0117] Figure 7 A flowchart of another file transfer method provided in an embodiment of this application is shown. This method can be executed by a first terminal device (e.g., such as...). Figure 1a The process is executed by the first terminal device 11 (Android tablet), specifically by the application layer, the notification unit 902a of the application framework layer, the first processing unit 903a of the system layer, the kernel layer, etc. As shown in the figure, the process includes the following steps:

[0118] 701: The cache contains file description information from a second terminal device.

[0119] The specific implementation method of this step is the same as described above. Figure 5 The 501 is basically the same as the one in the previous section, so it will not be described again here.

[0120] 702: Receive a first file from the second terminal device and perform a first operation on the first file.

[0121] The specific implementation method of this step is the same as described above. Figure 5 The 502 in the original text is basically the same, so it will not be described again here.

[0122] 703: When detecting that the first operation is abnormal, judging whether the abnormal reason is that the file format is not standard. If yes, going to 704, if not, ending the flow, and then other processing operations can be performed, such as other corresponding processing operations according to the abnormal reason, or ending the first operation on the first file.

[0123] 704: Obtaining the file description information associated with the first file in the cached file description information.

[0124] The specific implementation of this step is basically the same as that of 504 in the above Figure 5 , which will not be repeated here.

[0125] 705: Generating prompt information according to the file description information associated with the first file and the abnormal reason, and outputting the prompt information.

[0126] The specific implementation of this step is basically the same as that of 505 in the above Figure 5 , which will not be repeated here. In the embodiment of the application, since the abnormality occurs when the operation (such as copying the file) on the first file is detected, the file description information associated with the first file in the cached file description information is obtained when the abnormal reason is that the file format is not standard, the prompt information is generated according to the file description information associated with the first file and the abnormal reason, and the prompt information is outputted, so the user can be reminded of which file in the file transmission process caused the abnormality and the abnormal reason, resulting in the interruption of file transmission, so that the error file can be solved, and the user experience is improved.

[0127] Figure 8a An exemplary interaction diagram of each level of a first terminal device is shown for implementing a file transmission process. As shown in the figure, the flow includes the following steps:

[0128] 801: The first processing unit of the system layer receives the SEND_OBJECT_INFO reported by the kernel layer. The SEND_OBJECT_INFO includes file description information.

[0129] Before the first processing unit of the system layer receives the SEND_OBJECT_INFO, the kernel layer receives the SEND_OBJECT_INFO from the second terminal device (for example, PC 10), and then sends the SEND_OBJECT_INFO to the first processing unit of the system layer. As Figure 8b shown, the PC 10 sends the SEND_OBJECT_INFO to the kernel layer of the first terminal device (for example, an Android tablet), and then the kernel layer sends the SEND_OBJECT_INFO to the first processing unit 903a of the system layer.

[0130] 802: The first processing unit of the system layer caches the file description information into a global variable (file_name).

[0131] 803: The first processing unit of the system layer waits for receiving the SEND_OBJECT reported by the kernel layer.

[0132] The SEND_OBJECT can refer to the first file.

[0133] Before the first processing unit of the system layer receives the SEND_OBJECT, the kernel layer receives the SEND_OBJECT from the second terminal and sends the SEND_OBJECT to the first processing unit of the system layer.

[0134] The interaction process of this step is shown in FIG. 9B, in which the PC sends the SEND_OBJECT to the kernel layer of the Android tablet, and the kernel layer sends the SEND_OBJECT to the first processing unit 903a of the system layer. Figure 8b

[0135] 804: The first processing unit of the system layer determines whether the SEND_OBJECT reported by the kernel layer is received. If yes, the process goes to 805; if no, the process goes to 803.

[0136] 805: The first processing unit of the system layer determines whether the file copy operation on the SEND_OBJECT is successful. If no, the process goes to 806; if yes, the PC and the Android tablet normally interact.

[0137] 806: It is determined whether the abnormal reason is that the file format is not standard. If yes, the process goes to 707; if no, the process ends, and then other types of abnormal reasons can be processed.

[0138] 807: The first processing unit of the system layer sends the file description information associated with the SEND_OBJECT and the abnormal reason to the application framework layer.

[0139] The interaction process of this step is shown in FIG. 9B, in which the first processing unit 903a of the system layer sends the file description information associated with the SEND_OBJECT and the abnormal reason to the notification unit 902a of the application framework layer. Figure 8b

[0140] 808: The application framework layer sends the file description information associated with the SEND_OBJECT and the abnormal reason to the application layer.

[0141] The interaction process of this step is shown in FIG. 9B, in which the first processing unit 903a of the system layer sends the file description information associated with the SEND_OBJECT and the abnormal reason to the notification unit 902a of the application framework layer. Figure 8b ​​As shown, the notification unit 902a of the application framework layer sends the file description information associated with the SEND_OBJECT and the exception cause to the application layer.

[0142] 809: The application layer generates prompt information according to the file description information associated with the SEND_OBJECT and the exception cause, and outputs the prompt information, so that a prompt window is popped up on a user interface or voice prompt is performed, etc.

[0143] In some scenarios, the MTP application does not support bidirectional concurrent instructions, for example Figure 1a When the instruction sent by the second terminal device 10 (PC) to the first terminal device 11 (Android tablet) is not executed completely, the instruction sent by the first terminal device 11 to the second terminal device 10 fails to be executed. Specifically, when the PC copies files from the Android tablet, the Android tablet renames the files, and the renaming instruction action cannot be successfully synchronized to the PC, so that the PC cannot update the changes of the Android tablet in real time.

[0144] To solve the above problem, the MTP concurrent instruction execution failure is detected and recovered in real time in the embodiments of the present application.

[0145] In the embodiments of the present application, a first queue (A) can be established in the system layer of the first terminal device 11 (Android tablet), and specifically in the MTP server, to buffer the instructions from the second terminal device (for example, PC) and not executed completely by the first terminal device 11. As shown in Figure 9 The flowchart for processing the instructions from the second terminal device is shown as an example. The flowchart includes the following steps:

[0146] 901: Receive the instruction from the second terminal device.

[0147] 902: Buffer the instruction to the first queue.

[0148] 903: Determine whether the instruction is executed completely, if yes, go to 904, if not, continue to execute the instruction.

[0149] 904: Delete the instruction from the first queue.

[0150] Further, a second queue can also be configured in the system layer to buffer the instruction initiated by the first terminal device (Android tablet).

[0151] Figure 10aA flowchart of a method for recovering from a failed instruction execution based on MTP is provided for embodiments of the present application. The method can be performed by a first terminal device (e.g., as performed by the first terminal device 11 (an Android tablet) in Figure 1a FIG. 1, specifically by the second processing unit 903b of the system layer, the kernel layer, etc.). As shown, the flow includes the following steps:

[0152] 1001: Generate a first instruction to be sent to a second terminal device.

[0153] The first instruction can be, for example, an instruction to rename a file, modify a file format, modify a file size, etc., which is not limited by embodiments of the present application.

[0154] The interaction process of this step is shown by the dashed arrow in FIG. 1, in which the second processing unit 903b of the system layer generates a first instruction to be written to the kernel layer, and if the writing is successful, the kernel layer sends the first instruction to the second terminal device. Figure 10b

[0155] 1002: Detect whether the first instruction has failed to execute. If so, proceed to 1003, otherwise, the first instruction has executed successfully, and normal interaction can be performed, ending the flow.

[0156] 1003: Determine whether the cause of the failed execution is a busy system resource state. If so, proceed to 1004, otherwise, end the flow and other processing operations can be performed, such as other corresponding processing operations based on the cause of the failed execution, or the execution of the first instruction can be ended.

[0157] 1004: Determine whether there is an instruction from the second terminal device that has not yet been executed. If so, the instruction sending operation and the receiving operation have conflicted, which is a concurrent instruction, proceed to 1005, otherwise, the instruction sending operation and the receiving operation have not conflicted, end the flow and other processing operations can be performed. Optionally, whether there is an instruction from the second terminal device that has not yet been executed can be determined by determining whether the first queue is empty. If so, there is an instruction from the second terminal device that has not yet been executed.

[0158] 1005: Cache the first instruction.

[0159] In this step, the first instruction can be cached in the second queue.

[0160] 1006: Determine whether a set waiting time has been exceeded without receiving a new instruction from the second terminal device. If so, proceed to 1007, otherwise, proceed to 1008.

[0161] ​For example, a 1s timer is set during the waiting process, and if the time is exceeded, it means that no new instruction from the second terminal device is received.

[0162] 1007: Send the cached first instruction.

[0163] The interaction process of this step is shown by the solid arrow in FIG. 9, the second processing unit 903b of the system layer writes the first instruction to the kernel layer again, and the kernel layer sends the first instruction to the second terminal device. Figure 10b

[0164] 1008: Continue to execute the instruction from the second terminal device.

[0165] The interaction process of this step is shown by the solid arrow in FIG. 9, the second processing unit 903b of the system layer writes the first instruction to the kernel layer again, and the kernel layer sends the first instruction to the second terminal device. Figure 10b

[0166] In the embodiment of the application, since the detection process is added to the concurrent instruction failure, the received instruction and the sent instruction are stored separately, whether the instruction sending operation and the receiving operation conflict is determined by judging the queue for caching the received instruction, and whether the concurrent instruction from the second terminal device is completed is determined by judging whether the set waiting time is exceeded. If it is completed, the concurrent instruction sent by the first terminal device to the second terminal device is executed again. Therefore, the received instruction and the sent instruction can be executed staggered, and the concurrent instruction execution failure can be avoided, thereby improving the execution efficiency.

[0167] In some other scenarios, in response to a user operation of starting the MTP function, when the operation of starting the MTP function is executed, an enable state bit (which can also be referred to as an enable flag bit) error can exist, causing the operation of starting the MTP function to fail, directly reporting an error without attempting a recovery mechanism, so that transmission based on the MTP cannot be performed.

[0168] To solve the above problem, in the embodiment of the application, when the operation of starting the MTP is performed (for example, the kernel layer receives a request (or a message) of the system layer to open the / dev / MTP_usb function), an enable state abnormality detection and error correction mechanism is added.

[0169] Figure 11 A flowchart of an enable state abnormality detection and error correction method of an MTP function provided in the embodiment of the application. The method can be executed by a first terminal device (for example, as shown in FIG. 9). Figure 1a ​​The first terminal device 11 (an Android tablet) in the figure is executed, and specifically, the third processing unit 903c of the system layer, the MTP state unit 904a of the kernel layer, and the like can be executed.

[0170] As shown in the figure, the flow includes the following steps:

[0171] 1101: In response to a user operation of starting the MTP function, the value of the enable state bit of the MTP device is obtained.

[0172] The user operation of starting the MTP function can be implemented in various human-computer interaction modes based on the human-computer interaction mode provided by the first terminal device (the Android tablet). The user operation can be a gesture trigger, such as the user clicking the function icon of the MTP through the touch screen to obtain the value of the enable state bit of the MTP device. The user operation can also be voice input, and the Android tablet can obtain the value of the enable state bit of the MTP device through voice recognition.

[0173] 1102: It is determined whether the value of the enable state bit of the MTP device is in the starting state. If yes, go to 1103, otherwise, perform the starting operation of the MTP function.

[0174] In the MTP protocol, the value of the enable state bit of the MTP device can be represented by "0" and "1", for example, "0" represents that the enable state of the MTP function is in the closed state, and "1" represents that the enable state of the MTP function is in the starting state.

[0175] 1103: When it is determined that the value of the enable state bit of the MTP device is in the starting state, the starting state is reset to the closed state.

[0176] Taking "0" and "1" as an example, "1" is reset to "0".

[0177] Optionally, a notification message can be generated after the reset, indicating that the value of the enable state bit of the MTP device has been reset to the closed state.

[0178] 1104: The operation of starting the MTP function is performed, and the value of the enable state bit of the MTP device is set to the starting state. For example, the reset "0" is modified to "1", so that the MTP function can be started and subsequent interactions can be performed.

[0179] In the embodiments of the present application, in response to a user operation of starting the MTP function, the value of the enable state bit of the MTP device is acquired, and it is further determined whether the value of the enable state bit of the MTP device is in the start state. If yes, it indicates that the enable state bit of the MTP function is in error, and is reset. When the operation of starting the MTP function is performed, the value of the enable state bit of the MTP device is modified from the off state to the start state, thus, normal interaction is performed, thereby improving the stability of the MTP process and the user experience.

[0180] Figure 12a An exemplary interaction diagram of each level of the first terminal device is shown for implementing the enable abnormality and recovery of the MTP function. As shown in the figure, the flow includes the following steps:

[0181] 1201: The third processing unit of the system layer acquires the value of the enable flag bit of the MTP device in response to a user operation of starting the MTP function, and sends the value of the enable flag bit of the MTP device to the MTP state unit of the kernel layer.

[0182] The specific implementation manner of this step is basically the same as that of 1101 in the above Figure 11 , which will not be described herein again.

[0183] 1202: After the MTP state unit of the kernel layer receives the value of the enable flag bit of the MTP device, it is determined whether the value of the enable flag bit of the MTP device is in the start state. If yes, go to 1203, otherwise, perform the operation of starting the MTP function.

[0184] The specific implementation manner of this step is basically the same as that of 1102 in the above Figure 11 , which will not be described herein again.

[0185] 1203: The MTP state unit of the kernel layer resets the value of the enable flag bit of the MTP device to the off state.

[0186] The specific implementation manner of this step is basically the same as that of 1103 in the above Figure 11 , which will not be described herein again.

[0187] 1204: After resetting the value of the enable flag bit of the MTP device to the off state, the MTP state unit of the kernel layer generates a notification message and sends it to the third processing unit of the system layer. The interaction process of this step is shown in Figure 12b , the MTP state unit 904a of the kernel layer sends the notification message to the third processing unit 903c of the system layer.

[0188] 1205: After the third processing unit of the system layer receives the notification message, it initiates a restart instruction of starting the MTP function to the MTP state unit of the kernel layer.

[0189] The interaction process of this step is shown in Figure 12b The third processing unit 903c of the system layer sends a restart instruction for starting the MTP function to the MTP state unit.

[0190] 1206: After receiving the restart instruction for starting the MTP function, the MTP state unit of the kernel layer starts the MTP function and sets the value of the enable flag of the MTP device to the starting state.

[0191] The specific implementation of this step is basically the same as 1104 in the above Figure 11 , which will not be repeated here.

[0192] In the embodiments of the present application, the embodiments involved in the above scenarios are not in a certain order, for example, the file transmission exception can occur after the MTP function is started, can occur in the concurrent instruction process, or can occur after the concurrent instruction ends. For another example, the concurrent instruction exception can occur after the MTP function is started, can occur in the file transmission process, or can occur after the file transmission. For another example, the MTP enable state bit exception can occur before the file transmission, can occur in the concurrent instruction process, or can occur in the file transmission process.

[0193] The embodiments of the present application also provide a computer readable storage medium, which stores computer executable instructions. The computer executable instructions are used for causing a computer to execute the MTP-based file transmission method in the above embodiments.

[0194] The embodiments of the present application also provide a computer program product. When the computer program product is invoked by a computer, the computer program product causes the computer to execute the MTP-based file transmission method in the above embodiments.

[0195] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program codes.

[0196] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks.

[0197] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks.

[0198] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks.

[0199] Obviously, numerous modifications and variations of the present application are possible in light of the above teachings. It is therefore to be understood that within the scope of the claims and their equivalents, the application can be practiced otherwise than as specifically described.

Claims

1. A terminal device, the terminal device being a first terminal device, characterized by, The terminal device comprises a memory, a display screen and a processor, the processor runs a first processing unit and a notification unit, the first processing unit is located in a system layer in a software system architecture of the first terminal device, the notification unit is located in an application framework layer in the software system architecture, the software system architecture further comprises a kernel layer and an application layer; The memory is configured to store computer instructions; The display screen is configured to display a user interface; The first processing unit is configured to cache file description information from a second terminal device in the system layer, the file description information is received and sent to the system layer by the kernel layer before receiving a first file from the second terminal device in a media transport protocol (MTP) scenario, the file description information comprises file description information corresponding to at least one file, the first terminal device is an MTP response terminal device, and the second terminal device is an MTP initiation terminal device; if an exception occurs when the kernel layer performs a first operation on the first file, an exception reason is determined, file description information associated with the first file in the cached file description information is obtained, and the file description information associated with the first file and the exception reason are sent to the notification unit, the first operation comprises a file copy operation; The notification unit is configured to send the file description information associated with the first file and the exception reason to the application layer; The application layer is configured to generate prompt information according to the file description information associated with the first file and the exception reason, and output the prompt information.

2. The terminal device of claim 1, wherein the first processing unit is specifically configured to obtain the file description information associated with the first file in the cached file description information if the exception reason is that a file format is not standardized. The exception reason that the application layer generates in the prompt information is that a file format is not standardized. The prompt information comprises a file name of the first file and the exception reason. The processor further runs a second processing unit, and the second processing unit is located in the system layer; 3. The terminal device of claim 1, wherein, The second processing unit is configured to generate a first instruction to be sent to the second terminal device; 4. The terminal device of claim 1, wherein, If it is detected that the first instruction fails to be sent and a current system resource is busy, it is determined whether there is an instruction from the second terminal device that has not been executed at present; If there is an instruction from the second terminal device that has not been executed at present, it is determined that an instruction sending operation and a receiving operation conflict, and the first instruction is cached; If a set waiting time period is exceeded and no new instruction from the second terminal device is received, the cached first instruction is sent. The first terminal device comprises a first queue for caching an instruction from the second terminal device that has not been executed by the second terminal device; The second processing unit is specifically configured to determine that there is an instruction from the second terminal device that has not been executed at present if the first queue is not empty.

5. The terminal device according to claim 4, characterized by ​ ​ 6. The terminal device of claim 1, wherein, The processor further runs a third processing unit and an MTP state unit, the third processing unit is located at the system layer, and the MTP state unit is located at the kernel layer; The third processing unit is configured to acquire the value of the enable flag of the MTP device in response to a user operation of starting the MTP function, and send the value of the enable flag of the MTP device to the MTP state unit; The MTP state unit is configured to reset the value of the enable flag of the MTP device to an off state if it is determined that the value of the enable flag of the MTP device is in an on state, generate a notification message, and send the notification message to the third processing unit; The third processing unit is configured to send a restart instruction for starting the MTP function to the MTP state unit according to the notification message; The MTP state unit is configured to start the MTP function according to the restart instruction, and set the value of the enable flag of the MTP device to an on state.

7. A file transfer method based on a media transfer protocol (MTP), applied to a first terminal device, characterized in that, Comprise: Cache file description information from a second terminal device, the file description information is received and sent before receiving a first file from the second terminal device in an MTP scenario, including file description information corresponding to at least one file, the first terminal device is an MTP response end device, and the second terminal device is an MTP initiation end device; Receive a first file from the second terminal device, and perform a first operation on the first file, the first operation including a file copy operation; If it is detected that the first operation is abnormal, determine the abnormal reason, acquire file description information associated with the first file in the cached file description information, generate prompt information according to the file description information associated with the first file and the abnormal reason; Output the prompt information.

8. The method of claim 7, wherein, The method further comprises: Generating a first instruction to be sent to the second terminal device; If it is detected that the first instruction sending fails, and the state of the current system resource is busy, it is determined whether there is an instruction from the second terminal device that has not been executed at present; If there is an instruction from the second terminal device that has not been executed at present, it is determined that the instruction sending operation and the receiving operation conflict, and the first instruction is cached; If a new instruction from the second terminal device is not received within a set waiting time, the cached first instruction is sent.

9. The method of claim 7, wherein, The method further comprises: In response to a user operation of starting an MTP function, acquiring the value of an enable flag of an MTP device; If the value of the enable flag of the MTP device is in an on state, resetting the value of the enable flag of the MTP device to an off state; Initiating an operation of starting the MTP function, and setting the value of the enable flag of the MTP device to an on state.

10. A computer storage medium, characterized in that The computer readable storage medium stores computer executable instructions for causing a computer to execute the method of any one of claims 7-9.

Citation Information

Patent Citations

  • Method and apparatus for monitoring file copy

    CN107168855A

  • File transmission method and system, sending terminal and receiving terminal

    CN107241417A