WO2024093853A1 - 一种文件下载方法及相关装置 - Google Patents

一种文件下载方法及相关装置 Download PDF

Info

Publication number
WO2024093853A1
WO2024093853A1 PCT/CN2023/127364 CN2023127364W WO2024093853A1 WO 2024093853 A1 WO2024093853 A1 WO 2024093853A1 CN 2023127364 W CN2023127364 W CN 2023127364W WO 2024093853 A1 WO2024093853 A1 WO 2024093853A1
Authority
WO
WIPO (PCT)
Prior art keywords
terminal
target file
download
command
file
Prior art date
Application number
PCT/CN2023/127364
Other languages
English (en)
French (fr)
Inventor
陈兵
杨卓慧
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2024093853A1 publication Critical patent/WO2024093853A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Definitions

  • the present application relates to the field of terminal technology, and in particular to a file downloading method and related devices.
  • terminal A receives a message for transferring a file, but the user wants to store the file on terminal B, the user needs to download the file to terminal A and then forward it to terminal B.
  • This method wastes resources of terminal A, such as transmission resources, storage resources, etc.
  • the present application provides a file downloading method and related devices, in order to avoid wasting unnecessary resources in the file downloading scenario, reasonably utilize the resources of the terminal, and improve the utilization rate of the resources.
  • the present application provides a file downloading method, which can be executed by a first terminal, or by a component configured in the first terminal (such as a chip, a chip system, etc.), or by a logic module or software that can implement all or part of the functions of the first terminal.
  • a file downloading method which can be executed by a first terminal, or by a component configured in the first terminal (such as a chip, a chip system, etc.), or by a logic module or software that can implement all or part of the functions of the first terminal.
  • the present application does not limit this.
  • the method includes: displaying a first interface, the first interface displays a download notification, the download notification instructing the user to download a target file; in response to a first operation of the user, sending a first download command to a second terminal, the first download command being used to instruct the second terminal to download the above-mentioned target file; when the storage space available in the second terminal is less than the storage space required to store the target file, displaying a second interface, the second interface displays the first notification; in response to a second operation of the user, sending a second download command to a third terminal, the second download command being used to instruct the third terminal to download a second part of the target file, wherein the first part of the target file is stored in the second terminal, and the second part of the target file is stored in the third terminal.
  • the first terminal displays a download notification for indicating the download of the target file, and in response to the user's first operation, instructs the second terminal to download the target file.
  • the first notification is displayed, and in response to the user's second operation, the third terminal is instructed to download the remaining part of the target file.
  • the first terminal does not need to download the target file, thereby avoiding unnecessary resource consumption.
  • the second terminal and the third terminal respectively store part of the target file, thereby avoiding the problem of storage failure caused by insufficient storage space of the second terminal. Therefore, the method provided in the present application is conducive to the rational use of resources of each terminal.
  • the first notification may be used to prompt the user that the available storage space of the second terminal is insufficient.
  • the method before sending a first download command to the second terminal in response to a first operation of the user, the method further includes: acquiring multiple terminals including the second terminal that are communicatively connected to the first terminal; displaying a third interface, which displays the multiple terminals, and selecting the second terminal from the multiple terminals in response to the user's operation.
  • the first terminal can display multiple terminals for storing the target file to the user through an interface, so that the user can select the terminal where the target file is to be stored according to the needs, which is conducive to improving the user experience.
  • the method before displaying the first interface, further includes: receiving a first message from the cloud or other terminals in the same local area network as the first terminal, the first message being used to transmit the target file.
  • the first message for transmitting the target file may be from the cloud or from other terminals in the same local area network as the first terminal, and this application does not limit this.
  • the method before displaying the second interface, the method further includes: receiving a request message from the second terminal, the request message carrying a first portion of information that the second terminal has downloaded the target file.
  • the request message carries the information about the first part of the target file that has been downloaded by the second terminal, so that the first terminal can determine the size of the first part of the target file downloaded by the second terminal, or in other words, the first terminal can determine which part of the target file the other terminal needs to start downloading.
  • Download for example, the information that the second terminal has downloaded the first part of the target file carried in the request message is 500, indicating that the second terminal has downloaded the part of the target file with a length of 0 to 500.
  • the first download command carries the download address of the target file and/or the size of the target file
  • the second download command carries the download address of the target file and/or the length offset of the second part of the target file.
  • the method further includes: in response to a third operation of the user, receiving an integration instruction from the user; in response to a fourth operation of the user, sending a first command to a fourth terminal, the first command being used to instruct the fourth terminal to integrate the first part of the target file and the second part of the target file to obtain the target file; sending a first transmission command to the second terminal, the first transmission command being used to instruct the second terminal to transmit the first part of the target file to the fourth terminal; and sending a second transmission command to the third terminal, the second transmission command being used to instruct the third terminal to transmit the second part of the target file to the fourth terminal.
  • the target file is stored in a distributed manner, in some scenarios, it may be necessary to integrate the block files of each target file to obtain the target file.
  • Another example is the scenario in which the user needs to forward the target file to another terminal.
  • the first terminal can command the second terminal and the third terminal to transfer a part of the target file stored in itself to the fourth terminal, and send a command to the fourth terminal so that the fourth terminal integrates the files to obtain the target file, which is convenient for the user to use the target file completely.
  • the first command includes any one of the following: an integration command, a sharing command, an installation command or a play command.
  • the first command includes a length offset of a first portion of the target file and a length offset of a second portion of the target file.
  • the present application provides a file downloading method, which can be executed by a second terminal, or can also be executed by a component configured in the second terminal (such as a chip, a chip system, etc.), or can also be implemented by a logic module or software that can realize all or part of the functions of the second terminal.
  • a file downloading method which can be executed by a second terminal, or can also be executed by a component configured in the second terminal (such as a chip, a chip system, etc.), or can also be implemented by a logic module or software that can realize all or part of the functions of the second terminal.
  • a component configured in the second terminal such as a chip, a chip system, etc.
  • a logic module or software that can realize all or part of the functions of the second terminal.
  • the method includes: receiving a first download command from a first terminal, the first download command being used to instruct a second terminal to download a target file; downloading the target file based on the first download command; and sending a request message to the first terminal when the storage space available at the second terminal is insufficient, the request message carrying the first part of information that the second terminal has downloaded the target file.
  • the second terminal After the second terminal receives the first download command from the first terminal, it starts to download the target file. However, during the download process, the second terminal finds that its own storage space is insufficient, and then sends a request to the first terminal to inform the first terminal of the information of the target file it has downloaded, such as the length. During the entire process, the first terminal does not need to download the target file, thereby avoiding unnecessary resource consumption. Moreover, when the second terminal finds that its own storage space is insufficient, it sends a request to the first terminal, which is conducive to avoiding the problem of storage failure caused by insufficient storage space of the second terminal. Therefore, the method provided in the present application is conducive to the rational use of resources of each terminal.
  • the above method also includes: receiving a response message from the first terminal, the response message carrying an identifier of the third terminal and a length offset of the second part of the target file; sending a second download command to the third terminal, the second download command being used to instruct the third terminal to download the second part of the target file, wherein the first part of the target file is stored in the second terminal, and the second part of the target file is stored in the third terminal.
  • the second terminal When the second terminal finds that its own storage space is insufficient, it sends a request to the first terminal, and then receives a response from the first terminal, wherein the response indicates a third terminal for downloading the second part of the target file and a length offset of the second part of the target file. Furthermore, the second terminal commands the third terminal to download the second part of the target file, which helps to avoid the problem of storage failure caused by insufficient storage space of the second terminal. Therefore, the method provided in the present application is conducive to the rational use of resources of each terminal.
  • the present application provides a file downloading method, which can be executed by a first terminal, or can also be executed by a component configured in the first terminal (such as a chip, a chip system, etc.), or can also be implemented by a logic module or software that can implement all or part of the functions of the first terminal.
  • a file downloading method which can be executed by a first terminal, or can also be executed by a component configured in the first terminal (such as a chip, a chip system, etc.), or can also be implemented by a logic module or software that can implement all or part of the functions of the first terminal.
  • a component configured in the first terminal such as a chip, a chip system, etc.
  • a logic module or software that can implement all or part of the functions of the first terminal.
  • the method includes: displaying a first interface, the first interface displays a download notification, the download notification instructing the user to download a target file; in response to a first operation of the user, sending a first download command to a second terminal, the first download command is used to instruct the second terminal to download a first part of the target file; sending a second download command to a third terminal, the second download command is used to instruct the third terminal to download a second part of the target file.
  • the first terminal displays a download notification for instructing to download a target file, and in response to a first operation of the user, sends a first download command to the second terminal to instruct the second terminal to download a first part of the target file, and sends a second download command to the third terminal to instruct the third terminal to download a second part of the target file.
  • the first terminal does not need to download the target file, thereby avoiding unnecessary resource consumption.
  • the second terminal and the third terminal respectively store a part of the target file, thereby avoiding the second terminal storing a part of the target file.
  • the method before sending a first download command to the second terminal in response to a first operation of the user, the method further includes: acquiring multiple terminals including the second terminal and the third terminal that are communicatively connected to the first terminal; displaying a second interface that displays the multiple terminals, and selecting the second terminal and the third terminal from the multiple terminals in response to the user's operation.
  • the first terminal can display multiple terminals for storing the target file to the user through an interface, so that the user can select the terminal where the target file is to be stored according to the needs, which is conducive to improving the user experience.
  • the method before displaying the first interface, further includes: receiving a first message from the cloud or other terminals in the same local area network as the first terminal, the first message being used to transmit the target file.
  • the first message for transmitting the target file may be from the cloud or from other terminals in the same local area network as the first terminal, and this application does not limit this.
  • the first download command carries the download address of the target file and/or the length offset of the first part of the target file
  • the second download command carries the download address of the target file and/or the length offset of the second part of the target file.
  • the method further includes: in response to a second operation of the user, receiving an integration instruction from the user; in response to a third operation of the user, sending a first command to a fourth terminal, the first command being used to instruct the fourth terminal to integrate the first part of the target file and the second part of the target file to obtain the target file; sending a first transmission command to the second terminal, the first transmission command being used to instruct the second terminal to transmit the first part of the target file to the fourth terminal; and sending a second transmission command to the third terminal, the second transmission command being used to instruct the third terminal to transmit the second part of the target file to the fourth terminal.
  • the target file is stored in a distributed manner, in some scenarios, it may be necessary to integrate the block files of each target file to obtain the target file.
  • Another example is the scenario in which the user needs to forward the target file to another terminal.
  • the first terminal can command the second terminal and the third terminal to transfer a part of the target file stored in itself to the fourth terminal, and send a command to the fourth terminal so that the fourth terminal integrates the files to obtain the target file, which is convenient for the user to use the target file completely.
  • the first command includes any one of the following: an integration command, a sharing command, an installation command or a play command.
  • the present application provides a terminal that can implement the method in the first aspect and any possible implementation of the first aspect, or implement the method in the second aspect and any possible implementation of the second aspect, or implement the method in the third aspect and any possible implementation of the third aspect.
  • the terminal includes corresponding units for executing the above methods.
  • the units included in the terminal can be implemented by software and/or hardware.
  • the present application provides a terminal, the terminal comprising a processor.
  • the processor is coupled to a memory and can be used to execute a computer program in the memory to implement the method in the first aspect and any possible implementation of the first aspect, or to implement the method in the second aspect and any possible implementation of the second aspect, or to implement the method in the third aspect and any possible implementation of the third aspect.
  • the terminal further includes a memory.
  • the terminal further includes a communication interface, and the processor is coupled to the communication interface.
  • the present application provides a computer-readable storage medium, which stores a computer program or instruction.
  • the computer program or instruction When executed, it implements the method in the first aspect and any possible implementation of the first aspect, or implements the method in the second aspect and any possible implementation of the second aspect, or implements the method in the third aspect and any possible implementation of the third aspect.
  • the present application provides a computer program product, which includes instructions, which, when executed, implement the method in the first aspect and any possible implementation of the first aspect, or implement the method in the second aspect and any possible implementation of the second aspect, or implement the method in the third aspect and any possible implementation of the third aspect.
  • the present application provides a chip system comprising at least one processor for supporting the implementation of the functions involved in the first aspect and any possible implementation of the first aspect, or for supporting the implementation of the functions involved in the second aspect and any possible implementation of the second aspect, or for supporting the implementation of the functions involved in the third aspect and any possible implementation of the third aspect, for example, receiving or processing the data involved in the above method, etc.
  • the chip system further includes a memory, the memory being used to store program instructions and data. Located inside or outside the processor.
  • the chip system may be composed of the chip, or may include the chip and other discrete devices.
  • FIG1 is a schematic diagram of the structure of a terminal provided in an embodiment of the present application.
  • FIG. 2 is a structural block diagram of software of a terminal applicable to the file downloading method provided in an embodiment of the present application
  • FIG3 is a schematic diagram of a scenario applicable to the file downloading method provided in an embodiment of the present application.
  • FIG4 is a schematic flow chart of a file downloading method provided in an embodiment of the present application.
  • FIG5 is a schematic diagram of a first interface provided in an embodiment of the present application.
  • FIG. 6 is a schematic diagram of an interface in which a first terminal displays multiple terminals according to an embodiment of the present application
  • FIG7 is a schematic diagram of an interface for insufficient storage space provided by an embodiment of the present application.
  • FIG8 is another schematic flow chart of the file downloading method provided in an embodiment of the present application.
  • FIG9 is another schematic flow chart of the file downloading method provided in an embodiment of the present application.
  • FIG. 10 is another schematic diagram of an interface in which a first terminal displays multiple terminals according to an embodiment of the present application
  • FIG11 is a schematic diagram of a process for integrating segmented files provided in an embodiment of the present application.
  • FIG. 12 is a schematic diagram of an interface for displaying a file directory through an interface provided in an embodiment of the present application
  • FIG. 13 is another schematic diagram of an interface for displaying a file directory through an interface provided in an embodiment of the present application.
  • words such as “first” and “second” are used to distinguish the same or similar items with substantially the same functions and effects.
  • the first terminal and the second terminal are only used to distinguish different terminals, and their order is not limited.
  • words such as “first” and “second” do not limit the quantity and position, and words such as “first” and “second” do not necessarily limit them to be different.
  • a device, system, product or equipment comprising a series of modules, modules or units is not necessarily limited to those modules, modules or units clearly listed, but may include other modules, modules or units that are not clearly listed or inherent to these devices, systems, products or equipment.
  • the method provided in the embodiment of the present application can be applied to terminals such as mobile phones, tablet computers, smart watches, wearable devices, vehicle-mounted devices, laptop computers, personal computers (PCs), ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), and distributed devices.
  • terminals such as mobile phones, tablet computers, smart watches, wearable devices, vehicle-mounted devices, laptop computers, personal computers (PCs), ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), and distributed devices.
  • PCs personal computers
  • UMPCs ultra-mobile personal computers
  • PDAs personal digital assistants
  • distributed devices such as mobile phones, tablet computers, smart watches, wearable devices, vehicle-mounted devices, laptop computers, personal computers (PCs), ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), and distributed devices.
  • PCs personal computers
  • UMPCs ultra-mobile personal computers
  • PDAs personal digital assistants
  • distributed devices such as mobile phones, tablet computers, smart
  • the method described in the embodiments of the present application can support operating environments such as Harmony OS, Android operating system (Android OS), Linux, Mac, iOS, Windows OS, and lightweight operating systems (such as LiteOS).
  • Operating environments such as Harmony OS, Android operating system (Android OS), Linux, Mac, iOS, Windows OS, and lightweight operating systems (such as LiteOS).
  • Linux OS Android operating system
  • Mac Mac
  • iOS Windows OS
  • lightweight operating systems such as LiteOS
  • FIG1 shows a schematic diagram of the structure of the terminal 100.
  • the terminal 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
  • SIM subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L and a bone conduction sensor 180M, etc.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor. processor, AP), modem processor, graphics processor (graphics processing unit, GPU), image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor and neural network processor (neural-network processing unit, NPU) etc.
  • different processing units can be independent devices or integrated in one or more processors.
  • the application processor outputs sound signals through the audio module 170 (such as the speaker 170A, etc.), or displays images or videos through the display screen 194.
  • the controller may be the nerve center and command center of the terminal 100.
  • the controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
  • the processor 110 may also be provided with a memory for storing instructions and data.
  • the memory in the processor 110 is a cache memory.
  • the memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
  • the processor 110 can perform different operations to achieve different functions by executing instructions.
  • the instructions can be, for example, instructions pre-stored in the memory before the device leaves the factory, or instructions read from the APP after the user installs a new application (APP) during use, and the embodiments of the present application do not impose any limitation on this.
  • the processor 110 may include one or more interfaces.
  • the interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input/output (GPIO) interface, a SIM interface, and/or a USB interface.
  • I2C inter-integrated circuit
  • I2S inter-integrated circuit sound
  • PCM pulse code modulation
  • UART universal asynchronous receiver/transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM interface SIM interface
  • USB interface USB interface
  • the USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc.
  • the USB interface 130 can be used to connect a charger to charge the terminal 100, and can also be used to transmit data between the terminal 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones.
  • the interface can also be used to connect other terminals, such as augmented reality (AR) devices, etc.
  • AR augmented reality
  • the interface connection relationship between the modules illustrated in the present application is only for illustrative purposes and does not constitute a structural limitation on the terminal 100.
  • the terminal 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
  • the charging management module 140 is used to receive charging input from a charger.
  • the charger may be a wireless charger or a wired charger.
  • the charging management module 140 may receive charging input from a wired charger through the USB interface 130.
  • the charging management module 140 may receive wireless charging input through a wireless charging coil of the terminal 100. While the charging management module 140 is charging the battery 142, it may also power the terminal 100 through the power management module 141.
  • the power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
  • the power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160.
  • the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc.
  • the power management module 141 can also be set in the processor 110.
  • the power management module 141 and the charging management module 140 can also be set in the same device.
  • the wireless communication function of the terminal 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
  • Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in terminal 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas.
  • antenna 1 can be reused as a diversity antenna for a wireless local area network.
  • the antenna can be used in combination with a tuning switch.
  • the mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G etc. applied on the terminal 100 .
  • the wireless communication module 160 can provide wireless communication solutions for application on the terminal 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth, global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC) technology, infrared (IR) technology, etc.
  • WLAN wireless local area networks
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication
  • IR infrared
  • the antenna 1 of the terminal 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160.
  • the terminal 100 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wide band code division multiple access (WCDMA), time division code division multiple access (TD-SCDMA), long term evolution (LTE), fifth generation (5G) communication system, BT, GNSS, WLAN, NFC, FM, and/or IR technology, etc.
  • the GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), BeiDou navigation satellite system (BDS), quasi-zenith satellite system (QZSS) and/or satellite based augmentation system (SBAS).
  • GSM global system for mobile communications
  • GPRS general packet radio service
  • CDMA code division multiple access
  • WCDMA wide band code division multiple access
  • TD-SCDMA time division code division multiple access
  • the terminal 100 can realize the display function through a GPU, a display screen 194, and an application processor.
  • the GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • the processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
  • the display screen 194 which may also be referred to as a screen, may be used to display images, videos, etc.
  • the display screen 194 may include a display panel.
  • the terminal 100 may include one or more display screens 194 .
  • the display screen 194 may also include more components, such as a backlight panel, a drive circuit, etc.
  • the backlight panel may be used to provide a light source, and the display panel emits light based on the light source provided by the backlight panel.
  • the drive circuit may be used to control whether the liquid crystal of the liquid crystal layer is light-transmissive or light-impermeable.
  • the terminal 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.
  • the internal memory 121 can be used to store computer executable program codes, which include instructions.
  • the processor 110 executes various functional applications and data processing of the terminal 100 by running the instructions stored in the internal memory 121.
  • the internal memory 121 may include a program storage area and a data storage area.
  • the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.
  • the data storage area can store data created during the use of the terminal 100 (such as audio data, a phone book, etc.), etc.
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
  • UFS universal flash storage
  • the terminal 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor.
  • the structure illustrated in the present application does not constitute a specific limitation on the terminal 100.
  • the terminal 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently.
  • the components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
  • the software system of the terminal 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture or a cloud architecture.
  • This application takes the layered architecture Harmony OS as an example to illustrate the software structure of the terminal 100. Among them, this application does not limit the type of the operating system of the terminal.
  • FIG. 2 is a structural block diagram of software of a terminal applicable to the file downloading method provided in an embodiment of the present application.
  • the layered architecture divides the software into several layers, each with clear roles and division of labor.
  • the layers communicate with each other through software interfaces.
  • Harmony OS is divided into four layers, from top to bottom, namely, the application layer, the framework layer, the system service layer, and the kernel layer.
  • the application layer can include a series of applications. As shown in Figure 2, the application layer can include system applications and third-party applications.
  • System applications can be understood as some applications that come with the system, such as camera, gallery, calendar, call, map, Bluetooth, video and music applications.
  • Third-party applications can be understood as non-system applications that can be downloaded and installed from the application store.
  • the framework layer can include the user interface (UI) framework, the user program framework, and the ability framework.
  • the framework layer provides the Harmony OS application with a multi-language user program framework and ability framework in Java, C, C++, JavaScript (JS), and other languages, as well as a multi-language framework application program interface (API) for various software and hardware services to be open to the outside world; it also provides a multi-language framework application program interface (API) in C, C++, JS, and other languages for devices using Harmony OS.
  • UI framework provides the Harmony OS application with a multi-language user program framework and ability framework in Java, C, C++, JavaScript (JS), and other languages, as well as a multi-language framework application program interface (API) for various software and hardware services to be open to the outside world; it also provides a multi-language framework application program interface (API) in C, C++, JS, and other languages for devices using Harmony OS.
  • UI framework provides the Harmony OS application with a multi-language user program framework and
  • the system service layer can include the system basic capability subsystem set, basic software service subsystem set, enhanced software service subsystem set and hardware service subsystem set.
  • the system service layer is the core capability set of Harmony OS, providing services to applications through the framework layer.
  • the system basic capability subsystem set can be composed of subsystems such as distributed soft bus, distributed data management, distributed task scheduling, Ark multi-language runtime, public basic library, multi-mode input, graphics, security, artificial intelligence (AI), etc.
  • the system basic capability subsystem set can provide basic capabilities for the operation, scheduling, migration and other operations of distributed applications on multiple devices of Harmony OS.
  • the Ark runtime can provide C, C++, JS multi-language runtimes and basic system class libraries, and also provide a runtime for Java programs statically compiled using the Ark compiler (that is, the parts developed using the Java language in the application or framework layer).
  • the basic software service subsystem set can be composed of subsystems such as event notification, telephone, multimedia, etc., which can provide public and general software services for Harmony OS.
  • the enhanced software service subsystem set can be composed of subsystems such as smart screen proprietary business, wearable proprietary business, and Internet of Things (IoT) proprietary business, which can provide Harmony OS with differentiated capability-enhanced software services for different devices.
  • subsystems such as smart screen proprietary business, wearable proprietary business, and Internet of Things (IoT) proprietary business, which can provide Harmony OS with differentiated capability-enhanced software services for different devices.
  • IoT Internet of Things
  • the hardware service subsystem set can be composed of subsystems such as location services, biometric recognition, wearable-specific hardware services, and IoT-specific hardware services, which can provide hardware services for Harmony OS.
  • the basic software service subsystem set, enhanced software service subsystem set and hardware service subsystem set can be cut according to the subsystem granularity, and each subsystem can be cut according to the functional granularity.
  • This embodiment of the application does not make any limitation to this.
  • the application basic capability subsystem may include a distributed soft bus and distributed data management, so that the terminal has the ability to realize distributed storage of the target files provided by the present application.
  • the kernel layer can include the kernel subsystem and the driver subsystem.
  • Harmony OS adopts a multi-kernel design. Based on the kernel subsystem, Harmony OS supports the selection of suitable OS kernels for different resource-constrained devices; the kernel abstract layer (KAL) shields the differences between multiple kernels and provides basic kernel capabilities to the upper layer, including process management/thread management, memory management, file system, network management, and peripheral management.
  • KAL kernel abstract layer
  • the driver framework in the driver subsystem is the foundation of the open hardware ecosystem of Harmony OS, which can provide unified peripheral access capabilities and driver development and management frameworks.
  • FIG. 1 and FIG. 2 are merely examples and should not impose any limitation on the embodiments of the present application.
  • the application scenario applicable to the file download method provided in the embodiment of the present application is described below. It is understandable that the application scenario described in the embodiment of the present application is to more clearly illustrate the technical solution of the embodiment of the present application, and does not constitute a limitation on the technical solution provided in the embodiment of the present application.
  • FIG3 is a schematic diagram of a scenario applicable to the file downloading method provided in an embodiment of the present application.
  • terminal 310 receives a message from the cloud for transferring files, but the user wants to store the file on terminal 320.
  • the terminal 310 in the figure takes a mobile phone as an example, and the terminal 320 is shown as a smart screen, but it should not constitute any limitation to this application.
  • Terminal 310 and terminal 320 can also be other types of terminals as described above, such as tablet computers, PCs, etc. If you want to store a file on terminal 320, in known technologies, you need to download the file to terminal 310 and then forward it to terminal 320 through terminal 310. However, this method wastes the resources of terminal 310, such as transmission resources, storage resources, etc. In addition, once the available storage space of terminal 320 is insufficient to store files, the storage will fail. Therefore, in the above method, the resource utilization of each terminal is unreasonable.
  • the terminal 310 obtains a message for transmitting a file from the cloud, that is, the sender of the file is the cloud, but this should not constitute any limitation to this application.
  • the cloud can also be replaced by other terminals, that is, the method provided by this application can also be applied to end-to-end scenarios.
  • the sender of the file can also be a terminal in the same local area network, and this application does not limit this.
  • the present application provides a file downloading method, in which the first terminal displays a download notification for indicating the downloading of the target file, selects the second terminal and the third terminal in response to the user's operation, and sends download commands to the second terminal and the third terminal respectively to indicate the downloading of the corresponding block files.
  • the first terminal does not need to download the target file, so unnecessary resource consumption can be avoided.
  • the second terminal and the third terminal respectively store part of the target file, which can avoid the problem of storage failure caused by insufficient storage space of the second terminal. Therefore, the method provided by the present application is conducive to the reasonable utilization of the resources of each terminal.
  • the present application also provides another file downloading method, wherein a first terminal displays a download notification for indicating downloading a target file, selects a second terminal in response to a user operation, and instructs the second terminal to download the target file, and the storage space available on the second terminal is smaller than that for storing the target file.
  • a notification of insufficient storage space is displayed, and in response to the user selecting the third terminal, the third terminal is instructed to download the remaining part of the target file.
  • the first terminal does not need to download the target file, thereby avoiding unnecessary resource consumption.
  • the second terminal and the third terminal respectively store part of the target file, thereby avoiding the problem of storage failure caused by insufficient storage space of the second terminal. Therefore, the method provided by the present application is conducive to the rational use of resources of each terminal.
  • the first block file of the target file involved in the embodiment of the present application is an example of the first part of the target file
  • the second block file of the target file is an example of the second part of the target file.
  • the first operation, the second operation, the third operation, etc. of the user are specifically what the present application does not specifically limit.
  • the specific operations given in the following embodiments are only examples and do not constitute any limitation on the embodiments of the present application.
  • the first interface, the second interface, and the third interface are specifically what kind of interface, and the present application does not specifically limit this.
  • the embodiments shown below are described by taking the interaction of each terminal such as the first terminal, the second terminal, and the third terminal as an example, but this should not constitute any limitation on the execution subject of the method.
  • the program that can record the code of the method provided by the embodiment of the present application by running the program the method provided by the embodiment of the present application can be executed.
  • the first terminal can also be replaced by a component configured in the first terminal (such as a chip, a chip system, etc.), or other functional modules that can call a program and execute the program
  • the second terminal can also be replaced by a component configured in the second terminal (such as a chip, a chip system, etc.), or other functional modules that can call a program and execute the program.
  • the embodiment of the present application does not limit this.
  • the first terminal can be, for example, the terminal 310 shown in Figure 3
  • the second terminal can be, for example, the terminal 320 shown in Figure 3.
  • Fig. 4 is a schematic flow chart of a file downloading method provided in an embodiment of the present application. The steps shown in Fig. 4 will be described in detail below.
  • Step 401 The sender sends a first message to the first terminal. Accordingly, the first terminal receives the first message. After receiving the first message, the first terminal displays a first interface, and the first interface displays a download notification.
  • the first message is used to transmit a target file, which may include, but is not limited to, audio and video files, applications, installation packages, text documents (such as .txt files, .xml files, etc.), etc.
  • a target file which may include, but is not limited to, audio and video files, applications, installation packages, text documents (such as .txt files, .xml files, etc.), etc.
  • the embodiment of the present application does not limit the type of the target file.
  • the sender of the first message may be the cloud (such as the cloud in the scenario shown in FIG3 ), that is, the first terminal receives the first message from the cloud, and the first message is used to transmit the target file.
  • the sender of the first message may also be another terminal in the same local area network, that is, the first terminal receives the first message from another terminal, and the first message is used to transmit the target file.
  • the sender of the first message may be the sender of the target file.
  • the target file may come from the cloud or another terminal in the same local area network, and the present application does not limit this.
  • the first terminal After receiving the first message, the first terminal displays a download notification to instruct the user to download the target file. For example, a message is received on WeChat, and the message is used to transmit a text document. Below the text document, the user is prompted to download the text document. Although the terminal receives the above message, the text document is not downloaded locally.
  • the first message may include, for example, a download address of the target file, a name of the target file and other related information.
  • the first terminal After receiving the first message from the sender, the first terminal displays a first interface, where a download notification is displayed.
  • the download notification is used to instruct the user to download a target file.
  • FIG5 is a schematic diagram of the first interface provided in an embodiment of the present application.
  • the first terminal displays a first interface, on which a download notification is displayed to instruct the user to download a target file (such as an example of a target file in FIG5 ), and the user can select an operation to be performed on the target file, such as opening, downloading, etc.
  • a target file such as an example of a target file in FIG5
  • the first terminal can pop up a terminal for downloading the target file through an interface for the user to select.
  • the interface shown in FIG6 is an example of a third interface, and the third interface can display multiple terminals including the second terminal.
  • Fig. 6 is a schematic diagram of an interface in which a first terminal displays multiple terminals according to an embodiment of the present application. As shown in Fig. 6, the first terminal displays multiple terminals through an interface, wherein a) in Fig. 6 and b) in Fig. 6 show two forms in which the first terminal displays multiple terminals through a user interface.
  • the first terminal displays multiple terminals in the form of a list, and the multiple terminals include, for example, terminal 1, terminal 2, terminal 3, and terminal 4, and each terminal corresponds to a selection button.
  • the first terminal displays the multiple terminals in the form of icons for the user to select a terminal where the target file is to be stored.
  • the first terminal determines that the terminal where the user wants to store the target file is terminal 2, and further sends a first download command to terminal 2 to instruct it to download the target file.
  • the first terminal displays multiple terminals in the form of icons, and the multiple terminals include, for example, terminal 1, terminal 2, terminal 3, and terminal 4.
  • the first terminal displays the multiple terminals in the form of icons for the user to select a terminal where the target file is to be stored.
  • the first terminal determines that the terminal where the user wants to store the target file is terminal 2, and further sends a first download command to terminal 2 to instruct it to download the target file.
  • the two forms of displaying multiple terminals shown in a) of FIG. 6 and b) of FIG. 6 are merely examples and should not constitute any limitation to the embodiments of the present application.
  • the first terminal may also display multiple terminals in other forms.
  • Step 402 In response to the user selecting the second terminal, the first terminal sends a first download command to the second terminal. Accordingly, the second terminal receives the first download command from the first terminal.
  • the user selecting the second terminal is an example of the user's first operation.
  • the second terminal is a terminal where the user wants to store the target file.
  • the first download command is used to instruct the second terminal to download the target file.
  • the second terminal is a terminal where the user wants to store the target file. In other words, the first terminal receives the first message for transmitting the target file, but the user wants to store the target file on the second terminal.
  • the first download command carries at least one of the following information: a download address of the target file or a size of the target file.
  • the download address of the target file can be used to download the target file, and the size of the target file can be used to determine whether the storage space available in the terminal can store the target file.
  • the first download command may also include more parameters, such as but not limited to: command type, command identifier, command sender, command receiver, file identifier and length offset, etc.
  • the terminals may communicate using a binary interactive protocol.
  • downloadParam download parameter
  • xxxx such as the size of the target file
  • the length offset may be calculated based on the bytes of the target file. For example, if the size of the target file is 1 megabyte (M), the length of the corresponding length offset is 1024 bytes.
  • the length offset can also be calculated as the offset of the data block.
  • a whole multimedia file can usually be divided into several data blocks.
  • the length offset can be calculated as the offset of the data block.
  • a length offset of 5 means that the download starts from the 5th block.
  • the length offset can indicate the starting position or the starting position and the ending position, and this application does not limit this.
  • the length offset in the download command is 0, which means downloading starts from the 0th byte.
  • the length offset in the download command is 0 to 500, which means downloading starts from the 0th byte and downloads to the 500th byte.
  • the length offset in the embodiment of the present application is described as indicating the starting position.
  • Step 403 The second terminal downloads the target file from the sender.
  • the second terminal After receiving the first download command from the first terminal, the second terminal downloads the target file from the sender of the target file.
  • the first download command includes the download address of the target file, and the second terminal can download the target file based on the download address in the first download command.
  • the second terminal downloads the target file from the sender, which specifically includes: the second terminal requests the sender to download the target file, and after receiving the request from the second terminal, the sender sends the target file to the second terminal, and the second terminal stores it locally.
  • the second terminal may have insufficient available storage space (that is, the available storage space of the second terminal may be less than the storage space required to store the target file). In this case, the second terminal continues to execute steps 404 to 407; when the available storage space of the second terminal is greater than or equal to the storage space required to store the target file (that is, the available storage space of the second terminal is sufficient), the second terminal may not execute steps 404 to 407 and directly execute step 408, that is, the second terminal downloads the target file until the download is complete.
  • the second terminal can download the first block file of "1.txt” (such as the part with length 0 to offset), and the third terminal can download the second block file of "1.txt” (such as the part with length offset to end).
  • Step 404 The second terminal sends a request message to the first terminal.
  • the request message may be used to indicate that the storage space available to the second terminal is less than the storage space required to store the file, so as to request storage space from the first terminal.
  • the request message carries the first part of information that the second terminal has downloaded the target file, for example, it may carry information indicating the length of the target file that the second terminal can download. For example, if the second terminal finds that the storage space is insufficient during the download process and can only download the portion of the target file with a length of 0 to 500, the request message may carry a length offset of 500, which indicates that the second terminal can download the portion of the target file with a length of 0 to 500.
  • the second terminal when it finds that its available storage space is insufficient during the process of downloading the target file, it can send a request message to the first terminal to request storage resources from the first terminal. Correspondingly, the first terminal receives the request message.
  • Step 405 The first terminal displays the second interface, and determines a third terminal in response to a user operation on the second interface.
  • the first terminal may display a second interface to indicate that the second terminal has insufficient storage space and present multiple terminals for selection to the user.
  • the first terminal determines a third terminal for storing the remaining portion of the target file.
  • FIG7 is a schematic diagram of an interface for insufficient storage space provided by an embodiment of the present application.
  • the first terminal receives a request message from the second terminal, it determines that the storage space available to the second terminal is insufficient, and then the user can be prompted through the interface that the storage space available to the second terminal is insufficient.
  • the above notification of insufficient storage space is an example of a first notification.
  • the first notification can be used to prompt the user that the storage space available to the second terminal is insufficient, and then the first terminal displays other terminals that can be selected to the user (such as the first terminal can display terminals that can be selected by the user on the interface for storing the remaining part of the target file) to perform distributed storage of the target file.
  • the first terminal executes step 406, that is, sends a response message to the second terminal to indicate the third terminal to the second terminal.
  • Step 406 The first terminal sends a response message to the second terminal.
  • the first terminal After receiving the request message from the second terminal, the first terminal determines the third terminal, the third terminal and the second terminal are used to perform distributed storage on the target file, the second terminal is used to store the first block file of the target file, and the third terminal is used to store the second block file of the target file. Further, the first terminal sends a response message to the second terminal to indicate the third terminal.
  • the response message may include the identifier of the third terminal and at least one of the following: command type, command identifier, sender of the command, and receiver of the command.
  • command type the identifier of the third terminal
  • command identifier the identifier of the third terminal
  • sender of the command the command identifier
  • receiver of the command the response message
  • Step 407 The second terminal sends a second download command to the third terminal.
  • the second terminal After receiving the response message from the first terminal, the second terminal sends a second download command to the third terminal to instruct the third terminal to download the second block file of the target file.
  • the second terminal finds that the available storage space is insufficient, such as only the portion of the target file with a length of 0 to 500 can be downloaded, and requests storage resources from the first terminal. Then the above second download command instructs the third terminal to download the portion of 500 to 1000 of the target file.
  • the second download command may include, for example, a command type, a command identifier, a sender of the command, a receiver of the command, a file identifier, a download address of the file, a length offset, and the like.
  • downloadParam download parameter
  • xxxx such as the size of the target file
  • the first terminal may also directly send the second download command to the third terminal, that is, the second download command is sent by the first terminal, the first terminal may not send a response message to the second terminal, and the second terminal does not need to send the second download command to the third terminal.
  • Step 408 The third terminal downloads the remaining portion of the target file.
  • the second terminal downloads the first block file of the target file (such as the portion of length 0 to offset).
  • the third terminal downloads the second block file of the target file (such as the portion of length offset to end) according to the download address and offset of the target file in the second download command.
  • Step 409 The second terminal downloads the target file until the download is complete.
  • the second terminal downloads the target file until the download is complete.
  • the various steps in the embodiment shown in FIG4 are only examples, and in other embodiments, more or fewer steps may be included, and the present application does not limit this.
  • the method shown in FIG4 also includes: the second terminal and the third terminal determine the size and storage location of the storage space for storing the downloaded file in response to the user's setting operation, and the storage space available for the second terminal refers to the remaining space in the defined storage space for storing the downloaded file.
  • the present embodiment of the application does not limit the order of the various steps in the embodiment shown in FIG4.
  • Fig. 8 is another schematic flow chart of the file downloading method provided by the embodiment of the present application. The steps shown in Fig. 8 will be described in detail below.
  • Step 801 a sender sends a first message to a first terminal. Accordingly, the first terminal receives the first message. After receiving the first message, the first terminal displays a first interface, which displays a download notification.
  • Step 802 In response to a user's selection on the first interface, the first terminal sends a first download command to the second terminal. Correspondingly, the second terminal receives the first download command from the first terminal.
  • step 801 and step 802 please refer to the relevant description of step 401 and step 402 in Figure 4, which will not be repeated here.
  • Step 803 The second terminal determines whether its available storage space is smaller than the storage space required to store the target file.
  • step 804 i.e., downloads the target file until the download is completed; if the storage space available on the second terminal is less than the storage space required to store the target file, the second terminal executes steps 805 to 809.
  • the first download command may carry the size of the target file
  • the second terminal may determine, based on the size of the target file, whether its available storage space is smaller than the storage space required to store the target file.
  • Step 804 When the available storage space of the second terminal satisfies the storage space required for storing the target file, the second terminal downloads the target file from the sender.
  • Step 805 When the available storage space is smaller than the storage space required to store the target file, the second terminal sends a request message to the first terminal.
  • step 804 and step 805 please refer to the relevant description of step 403 and step 404 in Figure 4, which will not be repeated here.
  • Step 806 The first terminal sends a response message to the second terminal.
  • the above response message may include the identifier of the third terminal and at least one of the following: command type, command identifier, sender of the command, and receiver of the command, etc.
  • command type the identifier of the third terminal
  • command identifier the identifier of the third terminal
  • sender of the command the command identifier
  • receiver of the command etc.
  • the above response message may also carry instruction information to instruct the second terminal to start downloading the first block file of the target file.
  • Step 807 The second terminal downloads the first block file of the target file from the sender.
  • Step 808 The second terminal sends a second download command to the third terminal.
  • step 407 in FIG. 4 For the description of the second download command, please refer to the relevant description of step 407 in FIG. 4 , which will not be repeated here.
  • Step 809 The third terminal downloads the second block file of the target file from the sender.
  • the second terminal downloads the first block file of the target file
  • the third terminal downloads the second block file of the target file
  • the first terminal displays a download notification for indicating the download of the target file, selects the second terminal in response to the user's operation, and instructs the second terminal to download the target file.
  • a download notification for indicating the download of the target file selects the second terminal in response to the user's operation, and instructs the second terminal to download the target file.
  • the available storage space of the second terminal is less than the storage space required to store the target file
  • a notification of insufficient storage space is displayed, and in response to the user's operation of selecting the third terminal, the third terminal is instructed to download the remaining part of the target file.
  • the first terminal does not need to download the target file, thereby avoiding unnecessary resource consumption.
  • the second terminal and the third terminal respectively store part of the target file, thereby avoiding the problem of storage failure caused by insufficient storage space of the second terminal. Therefore, the method provided in the present application is conducive to the rational use of resources of each terminal.
  • FIG. 9 is another schematic flowchart of the file downloading method provided in an embodiment of the present application.
  • Step 901 A sender sends a first message to a first terminal. Accordingly, the first terminal receives the first message from the sender. After receiving the first message, the first terminal displays a first interface, which displays a download notification.
  • the first message is used to transmit the target file.
  • the target file originates from the sender, that is, the sender is both the sender of the first message and the sender of the target file.
  • the understanding of the sender sending the first message to the first terminal can refer to step 401.
  • the sender can be the cloud (the cloud in the scenario shown in Figure 3), that is, the first terminal receives the first message from the cloud, and the first message is used to transmit the target file.
  • the sender of the target file can also be other terminals in the same local area network.
  • the first terminal receives the first message from another terminal, and the first message is used to transmit the target file.
  • the relevant description of the first interface can be referred to Figure 5.
  • Step 902 The first terminal determines a terminal for storing the target file in response to a user operation.
  • the first terminal in response to the user clicking the download operation, can display multiple terminals and the available storage space corresponding to each terminal through the interface. It can be understood that the first terminal can establish a connection with the above multiple terminals (such as the second terminal, the third terminal and the fourth terminal) to obtain the available storage space corresponding to each terminal in the multiple terminals.
  • the multiple terminals displayed through the interface may be multiple terminals recorded with the same account, or multiple terminals belonging to the same group, or multiple terminals logged in to the same Wi-Fi.
  • This application does not specifically limit the relationship between the above-mentioned multiple terminals.
  • Figure 10 is another interface schematic diagram of a first terminal displaying multiple terminals provided by an embodiment of the present application.
  • the first terminal displays multiple terminals and their corresponding available storage spaces through an interface, such as the available storage space of the first terminal is 50M, the available storage space of the second terminal is 60M, the available storage space of the third terminal is 30M, and the available storage space of the fourth terminal is 70M.
  • the first terminal executes steps 903 and 904, and the second terminal and the third terminal perform distributed storage on the target file, such as the second terminal stores the first block file of the target file, and the third terminal stores the second block file of the target file.
  • the user may also set the size of the block files stored by the second terminal and the third terminal.
  • the first terminal instructs the second terminal to download the portion of the target file with a length of 0 to offset and instructs the third terminal to download the portion of the target file with a length of offset to end.
  • Step 903 The first terminal sends a first download command to the second terminal.
  • the second terminal receives the first download command from the first terminal.
  • the first download command may include, for example, a command type, a command identifier, a sender of the command, a receiver of the command, a file identifier, a download address of the file, a length offset, and the like.
  • downloadParam download parameter
  • xxxx such as the size of the target file
  • offset length offset
  • Step 904 The first terminal sends a second download command to the third terminal.
  • the first terminal sends a second download command to the third terminal to instruct the third terminal to download a second block file of the target file.
  • the second download command may include, for example, a command type, a command identifier, a sender of the command, a receiver of the command, a file identifier, a download address of the file, a length offset, and the like.
  • downloadParam download parameter
  • xxxx such as the size of the target file
  • offset(length offset) "500 ⁇ 1000" ⁇ .
  • the first download command sent by the first terminal to the second terminal is similar to the second download command sent by the first terminal to the third terminal.
  • the first download command instructs the second terminal to download part 0 to 500 of the target file
  • the second download command instructs the third terminal to download part 500 to 1000 (end of the target file) of the target file.
  • Step 905 The second terminal downloads the first block file of the target file.
  • the second terminal downloads the first block file (eg, the portion with a length of 0 to offset) of the target file based on the download address and offset of the target file in the first download command.
  • the first block file eg, the portion with a length of 0 to offset
  • Step 906 The third terminal downloads the second block file of the target file.
  • the third terminal downloads the second block file (such as the portion with a length of offset to end) of the target file according to the download address and offset of the target file in the second download command.
  • the storage space available to each terminal refers to the size of the storage space predefined for storing downloaded files.
  • each terminal may also pre-set a location for storing downloaded files for storing target files.
  • step 905 and step 906 can be performed simultaneously.
  • the first terminal displays a download notification for indicating the downloading of the target file, selects the second terminal and the third terminal in response to the user's operation, and sends download commands to the second terminal and the third terminal respectively to indicate the downloading of the corresponding block files.
  • the first terminal does not need to download the target file, thereby avoiding unnecessary resource consumption.
  • the second terminal and the third terminal respectively store part of the target file, thereby avoiding the problem of storage failure caused by insufficient storage space of the second terminal. Therefore, the method provided by the present application is conducive to the rational use of resources of each terminal.
  • the target file is stored in a distributed manner, in some scenarios, it may be necessary to integrate the block files of each target file to obtain the target file. For example, a scenario in which the target file needs to be integrated before it can be used. For another example, a scenario in which the user needs to forward the target file to another terminal, etc.
  • files that need to be integrated before they can be used include, but are not limited to: audio and video, applications, installation packages, etc.
  • Files that can be used without integration include, for example: text documents (such as .txt files, .xml files, etc.).
  • the first terminal can command the second terminal and the third terminal to transfer the block files stored in themselves to the fourth terminal, and send an integration command to the fourth terminal so that the fourth terminal integrates the above-mentioned block files to obtain the target file, which is convenient for users to use the target file completely.
  • Fig. 11 is a schematic diagram of a flow chart of integrating segmented files provided by an embodiment of the present application. The process of integrating segmented files to obtain a target file will be described in detail below in conjunction with Fig. 11.
  • the terminal used to integrate segmented files takes the fourth terminal as an example.
  • Step 1101 The first terminal receives an integration instruction from a user.
  • the first terminal receives an integration instruction from the user.
  • the first terminal receives the integration instruction from the user.
  • the above-mentioned click integration operation is an example of the user's third operation and the second operation.
  • Step 1102 The first terminal sends an integration command to the fourth terminal.
  • the fourth terminal receives the integration command from the first terminal.
  • the integration command is used to instruct the fourth terminal to integrate the first block file and the second block file to obtain a target file.
  • the above integration command is an example of the first command.
  • the first command includes any one of the following: an integration command, a sharing command, an installation command or a play command.
  • the first command includes a length offset of a first portion of the target file and a length offset of a second portion of the target file.
  • the first terminal may display the file directory through an interface.
  • the first terminal displays the file target of the target file through an interface.
  • a portion of the target file is stored in the second terminal, and a portion of the target file is stored in the third terminal.
  • the first terminal sends an integration command to the fourth terminal to instruct the fourth terminal to integrate the block files to obtain the target file.
  • FIG12 is a schematic diagram of an interface for displaying a file directory through an interface provided by an embodiment of the present application.
  • a file directory is displayed on the interface of the first terminal, wherein the files include file 1, file 2 and file 3.
  • file 1 as an example, for example, 40% of file 1 (recorded as the first block file) is stored in the second terminal, and 60% of file 1 (recorded as the second block file) is stored in the third terminal.
  • the user can select file 1 and click buttons such as integration, installation, play, or sharing (the figure shows the integration and installation buttons as an example).
  • a pop-up box pops up on the interface, as shown in b) in FIG12, and the first terminal displays a terminal for integrating the first block file and the second block file that can be selected by the user.
  • the first terminal sends an integration command to the fourth terminal, and sends a first transmission command to the second terminal to instruct the second terminal to send the first block file to the fourth terminal, and the first terminal sends a second transmission command to the third terminal to instruct the third terminal to send the second block file to the fourth terminal.
  • the fourth terminal can also prompt the user through the interface that the integration is complete, and prompt the user to select a corresponding operation, such as sharing, installing, playing, viewing, etc.
  • the fourth terminal can play the integrated file 1 (such as a video).
  • FIG13 is another interface schematic diagram of displaying a file directory through an interface provided by an embodiment of the present application.
  • a file directory is displayed on the interface of the first terminal, wherein the files include file 1, file 2 and file 3.
  • file 1 as an example, for example, 40% of the target file (recorded as the first block file) is stored in the second terminal, and 60% of the target file (recorded as the second block file) is stored in the third terminal.
  • the user can select file 1 and click the Share button after integration.
  • the first terminal prompts the user to select a terminal for integrating the first block file and the second block file.
  • the first terminal in response to the user selecting the fourth terminal, the first terminal sends an integration command to the fourth terminal, and sends a first transmission command to the second terminal to instruct the second terminal to send the first block file to the fourth terminal, and the first terminal sends a second transmission command to the third terminal to instruct the third terminal to send the second block file to the fourth terminal.
  • the sharing action can be automatically completed.
  • the interface shown in Figure 12 or Figure 13 is only an example and should not constitute any limitation to the embodiments of the present application.
  • the interface can be presented in more forms, such as including more or fewer buttons, or different icons presenting different styles, etc., and the present application does not limit this.
  • Step 1103 The first terminal sends a first transmission command to the second terminal.
  • the second terminal receives the first transmission command from the first terminal.
  • the first transmission command is used to instruct the second terminal to transmit the first block file to the fourth terminal.
  • the first transmission command may carry the sender of the block file, the receiver of the block file, and may also carry the command type, the command identifier, and the file identifier, etc.
  • the first transmission command is as follows:
  • Step 1104 The second terminal sends the first block file of the target file to the fourth terminal.
  • Step 1105 The first terminal sends a second transmission command to the third terminal.
  • the third terminal receives the second transmission command from the first terminal.
  • the second transmission command may carry the sender of the block file, the receiver of the block file, and may also carry the command type, the command identifier, and the file identifier, etc.
  • the second transmission command is as follows:
  • Step 1106 The third terminal sends the second block file of the target file to the fourth terminal.
  • step 1102, step 1103, and step 1105 can be executed simultaneously.
  • the fourth terminal shown in Figure 11 is only an example and should not constitute any limitation to the embodiments of the present application.
  • the fourth terminal and the third terminal can be the same terminal as long as the storage space available in the fourth terminal can store the target file.
  • the first terminal can instruct the second terminal and the third terminal to send the block files of their own stored target files to the fourth terminal for integration to obtain the integrated target file, which makes it more convenient for users to use the complete target file and is conducive to improving user experience.
  • the embodiment of the present application further provides a terminal, which includes a corresponding unit for executing the steps executed by the first terminal in Figure 4, Figure 8, Figure 9 or Figure 11, or includes a corresponding unit for executing the steps executed by the second terminal in Figure 4, Figure 8, Figure 9 or Figure 11, or includes a corresponding unit for executing the steps executed by the third terminal in Figure 4, Figure 8, Figure 9 or Figure 11, or includes a corresponding unit for executing the steps executed by the fourth terminal in Figure 11.
  • the units included in the terminal can be implemented by software and/or hardware.
  • An embodiment of the present application also provides a terminal, which includes a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to call and execute the computer program, so that the terminal executes the steps executed by the first terminal in Figure 4, Figure 8, Figure 9 or Figure 11, or so that the terminal executes the steps executed by the second terminal in Figure 4, Figure 8, Figure 9 or Figure 11, or so that the terminal executes the steps executed by the third terminal in Figure 4, Figure 8, Figure 9 or Figure 11, or so that the terminal executes the steps executed by the fourth terminal in Figure 11.
  • the present application also provides a chip system, which includes at least one processor, for implementing the functions involved in the steps executed by the first terminal in the embodiments shown in Figures 4, 8, 9 or 11, or for implementing the functions involved in the steps executed by the second terminal in the embodiments shown in Figures 4, 8, 9 or 11, or for implementing the functions involved in the steps executed by the third terminal in the embodiments shown in Figures 4, 8, 9 or 11, or for implementing the functions involved in the steps executed by the fourth terminal in the embodiment shown in Figure 11.
  • a chip system which includes at least one processor, for implementing the functions involved in the steps executed by the first terminal in the embodiments shown in Figures 4, 8, 9 or 11, or for implementing the functions involved in the steps executed by the second terminal in the embodiments shown in Figures 4, 8, 9 or 11, or for implementing the functions involved in the steps executed by the third terminal in the embodiments shown in Figures 4, 8, 9 or 11, or for implementing the functions involved in the steps executed by the fourth terminal in the embodiment shown in Figure 11.
  • the chip system also includes a memory, which is used to store program instructions and data, and the memory is located inside or outside the processor.
  • the chip system may be composed of the chip, or may include the chip and other discrete devices.
  • An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon.
  • the computer program executes the steps executed by the first terminal in Figure 4, Figure 8, Figure 9 or Figure 11, or the computer executes the steps executed by the second terminal in Figure 4, Figure 8, Figure 9 or Figure 11, or the computer executes the steps executed by the third terminal in Figure 4, Figure 8, Figure 9 or Figure 11, or the computer executes the steps executed by the fourth terminal in Figure 11.
  • An embodiment of the present application also provides a computer program product, including a computer program.
  • the computer executes the steps executed by the first terminal in Figure 4, Figure 8, Figure 9 or Figure 11, or the computer executes the steps executed by the second terminal in Figure 4, Figure 8, Figure 9 or Figure 11, or the computer executes the steps executed by the third terminal in Figure 4, Figure 8, Figure 9 or Figure 11, or the computer executes the steps executed by the fourth terminal in Figure 11.
  • the processor in the embodiment of the present application can be an integrated circuit chip with signal processing capabilities.
  • each step of the above method embodiment can be completed by the hardware integrated logic circuit in the processor or the instructions in the form of software.
  • the above processor can be a general-purpose processor, a digital signal processor (digital signal processor, DSP), an application specific integrated circuit (application specific integrated circuit, ASIC), a field programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGA field programmable gate array
  • the public embodiments of the present application can be implemented or executed.
  • the methods, steps and logic block diagrams disclosed herein are disclosed.
  • the general processor may be a microprocessor or the processor may be any conventional processor, etc.
  • the steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in the decoding processor.
  • the software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc.
  • the storage medium is located in a memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
  • the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories.
  • the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory.
  • the volatile memory may be a random access memory (RAM), which is used as an external cache.
  • RAM random access memory
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDR SDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchlink DRAM
  • DR RAM direct rambus RAM
  • unit may be used to represent a computer-related entity, hardware, firmware, a combination of hardware and software, software, or software in execution.
  • the device embodiments described above are merely schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
  • modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically separately, or two or more units may be integrated into one module.
  • each functional module can be implemented in whole or in part by software, hardware, firmware or any combination thereof.
  • software When implemented by software, it can be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions (programs). When the computer program instructions (programs) are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part.
  • the computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
  • the computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center.
  • the computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated.
  • the available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a digital versatile disk (DVD)), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.
  • a magnetic medium e.g., a floppy disk, a hard disk, a magnetic tape
  • an optical medium e.g., a digital versatile disk (DVD)
  • DVD digital versatile disk
  • SSD solid state disk
  • the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.
  • the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the various embodiments of the present application.
  • the aforementioned storage medium includes: a U disk, a mobile hard disk, a ROM, a RAM, a magnetic disk or an optical disk, and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Stored Programmes (AREA)

Abstract

提供了一种文件下载方法及相关装置,该方法包括:第一终端显示第一界面,第一界面显示下载通知,该下载通知指示用户下载目标文件;响应于用户的第一操作,向第二终端发送第一下载命令,该第一下载命令用于指示第二终端下载目标文件;在第二终端可用的存储空间小于存储目标文件所需的存储空间的情况下,显示第二界面,第二界面显示第一通知;响应于用户的第二操作,向第三终端发送第二下载命令,该第二下载命令用于指示第三终端下载目标文件的第二部分,其中,目标文件的第一部分存储在第二终端,目标文件的第二部分存储在第三终端,整个过程中,第一终端无需下载目标文件,因此可以避免不必要的资源耗费,有利于合理地利用各个终端的资源。

Description

一种文件下载方法及相关装置
本申请要求于2022年11月04日提交中国专利局、申请号为202211379154.7、申请名称为“一种文件下载方法及相关装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及终端技术领域,尤其涉及一种文件下载方法及相关装置。
背景技术
随着智能终端的日益普及,文件下载存储成为一个常见的场景,目前,如果终端A接收到一个用于传输文件的消息,但用户希望将文件存储到终端B上,则用户需要将文件下载到终端A上,再转发至终端B,这种方法浪费终端A的资源,如传输资源、存储资源等。
因此,希望提供一种文件下载方法,以期合理利用终端的资源。
发明内容
本申请提供了一种文件下载方法及相关装置,以期避免在文件下载的场景中耗费不必要的资源,合理地利用终端的资源,提高资源的利用率。
第一方面,本申请提供了一种文件下载方法,该方法可以由第一终端执行,或者,也可以由配置在第一终端中的部件(如芯片、芯片系统等)执行,或者,还可以由能够实现全部或部分第一终端功能的逻辑模块或软件实现,本申请对此不作限定。
示例性地,该方法包括:显示第一界面,该第一界面显示下载通知,该下载通知指示用户下载目标文件;响应于用户的第一操作,向第二终端发送第一下载命令,该第一下载命令用于指示第二终端下载上述目标文件;在第二终端可用的存储空间小于存储目标文件所需的存储空间的情况下,显示第二界面,该第二界面显示第一通知;响应于用户的第二操作,向第三终端发送第二下载命令,该第二下载命令用于指示第三终端下载目标文件的第二部分,其中,目标文件的第一部分存储在第二终端,目标文件的第二部分存储在第三终端。
上述技术方案中,第一终端显示用于指示下载目标文件的下载通知,响应于用户的第一操作,命令第二终端下载目标文件,在第二终端可用的存储空间小于存储目标文件所需的存储空间的情况下,显示第一通知,并响应于用户的第二操作,指示第三终端下载目标文件的剩余部分,整个过程中,第一终端无需下载目标文件,因此可以避免不必要的资源耗费,而且,第二终端和第三终端分别存储目标文件的一部分文件,可以避免第二终端存储空间不足导致的存储失败的问题,因此,本申请提供的方法有利于合理地利用各个终端的资源。
其中,第一通知可以用于提示用户第二终端可用的存储空间不足。
结合第一方面,在第一方面的某些可能的实现方式中,在响应于用户的第一操作,向第二终端发送第一下载命令之前,上述方法还包括:获取和第一终端通信连接的包含第二终端在内的多个终端;显示第三界面,该第三界面显示上述多个终端,响应于用户的操作,从多个终端中选择第二终端。
第一终端可以通过界面向用户展示可供选择的用于存储目标文件的多个终端,以便于用户根据需求选择希望存储目标文件的终端,有利于提高用户的体验。
结合第一方面,在第一方面的某些可能的实现方式中,在显示第一界面之前,上述方法还包括:接收来自云端或与第一终端处于同一局域网下的其他终端的第一消息,第一消息用于传输所述目标文件。用于传输目标文件的第一消息可以是来自云端,也可以是来自与第一终端处于同一局域网下的其他终端,本申请对此不作限定。
结合第一方面,在第一方面的某些可能的实现方式中,在显示第二界面之前,上述方法还包括:接收来自第二终端的请求消息,该请求消息中携带第二终端已下载目标文件的第一部分信息。
上述请求消息中携带第二终端已下载目标文件的第一部分信息,使得第一终端可以确定第二终端下载的目标文件的第一部分的大小,或者说,第一终端可以确定需要另一终端从目标文件的哪一部分开始 下载,例如,请求消息中携带的第二终端已下载目标文件的第一部分信息为500,表示第二终端下载了目标文件的长度为0至500的部分。
结合第一方面,在第一方面的某些可能的实现方式中,第一下载命令中携带有目标文件的下载地址和/或目标文件的大小,第二下载命令中携带有目标文件的下载地址和/或目标文件的第二部分的长度偏移量。
结合第一方面,在第一方面的某些可能的实现方式中,上述方法还包括:响应于用户的第三操作,接收来自用户的整合指示;响应于用户的第四操作,向第四终端发送第一命令,该第一命令用于指示第四终端整合目标文件的第一部分和目标文件的第二部分,以得到目标文件;向第二终端发送第一传输命令,该第一传输命令用于指示第二终端向第四终端传输目标文件的第一部分;向第三终端发送第二传输命令,该第二传输命令用于指示第三终端向第四终端传输目标文件的第二部分。
如果目标文件被分布式存储,则在某些场景中,可能需要将各个目标文件的分块文件进行整合,得到目标文件。例如,目标文件需要被整合之后才能使用的场景。又例如,用户需要把目标文件转发至另一终端上的场景等。在本申请中,以第四终端对目标文件进行整合为例,响应于用户的选择操作,第一终端可以命令第二终端和第三终端将自身存储的目标文件的一部分文件传输至第四终端,并向第四终端发送命令,以使第四终端对文件进行整合,得到目标文件,这样便于用户完整地使用目标文件。
可选地,第一命令包括以下任一项:整合命令、分享命令、安装命令或播放命令。
可选地,第一命令中包括目标文件的第一部分的长度偏移量和目标文件的第二部分的长度偏移量。
第二方面,本申请提供了一种文件下载方法,该方法可以由第二终端执行,或者,也可以由配置在第二终端中的部件(如芯片、芯片系统等)执行,或者,还可以由能够实现全部或部分第二终端功能的逻辑模块或软件实现,本申请对此不作限定。
示例性地,该方法包括:接收来自第一终端的第一下载命令,该第一下载命令用于指示第二终端下载目标文件;基于第一下载命令,下载目标文件;在第二终端可用的存储空间不足的情况下,向第一终端发送请求消息,该请求消息中携带第二终端已下载目标文件的第一部分信息。
在上述技术方案中,第二终端接收到第一终端的第一下载命令后,开始下载目标文件,但第二终端在下载过程中发现自身的存储空间不足,则向第一终端发送请求,告知第一终端自身已下载的目标文件的信息,如长度,整个过程中,第一终端无需下载目标文件,因此可以避免不必要的资源耗费,而且,第二终端在发现自身存储空间不足时,向第一终端发送请求,有利于避免第二终端存储空间不足导致的存储失败的问题,因此,本申请提供的方法有利于合理地利用各个终端的资源。
结合第二方面,在第二方面的某些可能的实现方式中,上述方法还包括:接收来自第一终端的响应消息,该响应消息中携带第三终端的标识以及目标文件的第二部分的长度偏移量,;向第三终端发送第二下载命令,该第二下载命令用于指示第三终端下载目标文件的第二部分,其中,目标文件的第一部分存储在第二终端,目标文件的第二部分存储在第三终端。
第二终端在发现自身存储空间不足时,向第一终端发送请求,进而接收到来自第一终端的响应,该响应指示用于下载目标文件的第二部分的第三终端以及目标文件的第二部分的长度偏移量,进一步地,第二终端命令第三终端下载目标文件的第二部分,这样有利于避免第二终端存储空间不足导致的存储失败的问题,因此,本申请提供的方法有利于合理地利用各个终端的资源。
第三方面,本申请提供了一种文件下载方法,该方法可以由第一终端执行,或者,也可以由配置在第一终端中的部件(如芯片、芯片系统等)执行,或者,还可以由能够实现全部或部分第一终端功能的逻辑模块或软件实现,本申请对此不作限定。
示例性地,该方法包括:显示第一界面,该第一界面显示下载通知,该下载通知指示用户下载目标文件;响应于用户的第一操作,向第二终端发送第一下载命令,该第一下载命令用于指示第二终端下载目标文件的第一部分;向第三终端发送第二下载命令,该第二下载命令用于指示第三终端下载目标文件的第二部分。
在上述技术方案中,第一终端显示用于指示下载目标文件的下载通知,响应于用户的第一操作,分别向第二终端发送第一下载命令,指示第二终端下载目标文件的第一部分,向第三终端发送第二下载命令,指示第三终端下载目标文件的第二部分,整个过程中,第一终端无需下载目标文件,因此可以避免不必要的资源耗费,而且,第二终端和第三终端分别存储目标文件的一部分文件,可以避免第二终端存 储空间不足导致的存储失败的问题,因此,本申请提供的方法有利于合理地利用各个终端的资源。
结合第三方面,在第三方面的某些可能的实现方式中,在响应于用户的第一操作,向第二终端发送第一下载命令之前,上述方法还包括:获取和第一终端通信连接的包含第二终端和第三终端在内的多个终端;显示第二界面,该第二界面显示上述多个终端,响应于用户的操作,从多个终端中选择第二终端和第三终端。
第一终端可以通过界面向用户展示可供选择的用于存储目标文件的多个终端,以便于用户根据需求选择希望存储目标文件的终端,有利于提高用户的体验。
结合第三方面,在第三方面的某些可能的实现方式中,在显示第一界面之前,上述方法还包括:接收来自云端或与第一终端处于同一局域网下的其他终端的第一消息,第一消息用于传输目标文件。用于传输目标文件的第一消息可以是来自云端,也可以是来自与第一终端处于同一局域网下的其他终端,本申请对此不作限定。
结合第三方面,在第三方面的某些可能的实现方式中,第一下载命令中携带有目标文件的下载地址和/或目标文件的第一部分的长度偏移量,第二下载命令中携带有目标文件的下载地址和/或目标文件的第二部分的长度偏移量。
结合第三方面,在第三方面的某些可能的实现方式中,上述方法还包括:响应于用户的第二操作,接收来自用户的整合指示;响应于用户的第三操作,向第四终端发送第一命令,第一命令用于指示第四终端整合目标文件的第一部分和目标文件的第二部分,以得到目标文件;向第二终端发送第一传输命令,第一传输命令用于指示第二终端向第四终端传输目标文件的第一部分;向第三终端发送第二传输命令,第二传输命令用于指示第三终端向第四终端传输目标文件的第二部分。
如果目标文件被分布式存储,则在某些场景中,可能需要将各个目标文件的分块文件进行整合,得到目标文件。例如,目标文件需要被整合之后才能使用的场景。又例如,用户需要把目标文件转发至另一终端上的场景等。在本申请中,以第四终端对目标文件进行整合为例,响应于用户的选择操作,第一终端可以命令第二终端和第三终端将自身存储的目标文件的一部分文件传输至第四终端,并向第四终端发送命令,以使第四终端对文件进行整合,得到目标文件,这样便于用户完整地使用目标文件。
可选地,上述第一命令包括以下任一项:整合命令、分享命令、安装命令或播放命令。
第四方面,本申请提供了一种终端,可以实现第一方面和第一方面任一种可能的实现方式中的方法,或,实现第二方面和第二方面任一种可能的实现方式中的方法,或,实现第三方面和第三方面任一种可能的实现方式中的方法。该终端包括用于执行上述方法的相应的单元。该终端包括的单元可以通过软件和/或硬件方式实现。
第五方面,本申请提供了一种终端,该终端包括处理器。该处理器与存储器耦合,可用于执行存储器中的计算机程序,以实现第一方面和第一方面任一种可能的实现方式中的方法,或,实现第二方面和第二方面任一种可能的实现方式中的方法,或,实现第三方面和第三方面任一种可能的实现方式中的方法。
可选地,该终端还包括存储器。
可选地,该终端还包括通信接口,处理器与通信接口耦合。
第六方面,本申请提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序或指令,当该计算机程序或指令被执行时,以实现第一方面和第一方面任一种可能的实现方式中的方法,或,实现第二方面和第二方面任一种可能的实现方式中的方法,或,实现第三方面和第三方面任一种可能的实现方式中的方法。
第七方面,本申请提供了一种计算机程序产品,该计算机程序产品包括指令,当该指令被运行时,以实现第一方面和第一方面任一种可能的实现方式中的方法,或,实现第二方面和第二方面任一种可能的实现方式中的方法,或,实现第三方面和第三方面任一种可能的实现方式中的方法。
第八方面,本申请提供了一种芯片系统,该芯片系统包括至少一个处理器,用于支持实现上述第一方面和第一方面任一种可能实现方式中所涉及的功能,或,用于支持实现上述第二方面和第二方面任一种可能实现方式中所涉及的功能,或,用于支持实现上述第三方面和第三方面任一种可能实现方式中所涉及的功能,例如,接收或处理上述方法中所涉及的数据等。
在一种可能的设计中,所述芯片系统还包括存储器,所述存储器用于保存程序指令和数据,存储器 位于处理器之内或处理器之外。
该芯片系统可以由芯片构成,也可以包含芯片和其他分立器件。
应当理解的是,本申请的第四方面至第八方面与本申请的第一方面至第三方面的技术方案相对应,各方面及对应的可行实施方式所取得的有益效果相似,不再赘述。
附图说明
图1是本申请实施例提供的终端的结构示意图;
图2是适用于本申请实施例提供的文件下载方法的一种终端的软件的结构框图;
图3是适用于本申请实施例提供的文件下载方法的场景示意图;
图4是本申请实施例提供的文件下载方法的一示意性流程图;
图5是本申请实施例提供的第一界面的界面示意图;
图6是本申请实施例提供的第一终端显示多个终端的界面示意图;
图7是本申请实施例提供的存储空间不足的界面示意图;
图8是本申请实施例提供的文件下载方法的另一示意性流程图;
图9是本申请实施例提供的文件下载方法的又一示意性流程图;
图10是本申请实施例提供的第一终端显示多个终端的又一界面示意图;
图11是本申请实施例提供的整合分块文件的流程示意图;
图12是本申请实施例提供的通过界面显示文件目录的界面示意图;
图13是本申请实施例提供的通过界面显示文件目录的另一界面示意图。
具体实施方式
下面将结合附图,对本申请中的技术方案进行描述。
为便于清楚描述本申请实施例的技术方案,首先做出如下说明。
第一,在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。例如,第一终端和第二终端仅仅是为了区分不同的终端,并不对其先后顺序进行限定。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和位置进行限定,并且“第一”、“第二”等字样也并不限定一定不同。
第二,在本申请实施例中,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列模组、模块或单元的装置、系统、产品或设备不必限于清楚地列出的那些模组、模块或单元,而是可包括没有清楚地列出的或对于这些装置、系统、产品或设备固有的其它模组、模块或单元。
本申请实施例提供的方法可以应用于手机、平板电脑、智能手表、可穿戴设备、车载设备、笔记本电脑、个人计算机(personal computer,PC)、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)、分布式设备等终端上。本申请实施例对终端的具体类型不作任何限定。
此外,本申请实施例中所述的方法可以支持鸿蒙操作系统(Harmony OS)、安卓操作系统(Android operating system,Android OS)、Linux、Mac、iOS、视窗操作系统(Windows OS)和轻量级操作系统(如LiteOS)等操作环境。本申请实施例对此不作任何限定。
示例性地,图1示出了终端100的结构示意图。如图1所示,该终端100可以包括处理器110、外部存储器接口120、内部存储器121、通用串行总线(universal serial bus,USB)接口130、充电管理模块140、电源管理模块141、电池142、天线1、天线2、移动通信模块150、无线通信模块160、音频模块170、扬声器170A、受话器170B、麦克风170C、耳机接口170D、传感器模块180、按键190、马达191、指示器192、摄像头193、显示屏194、以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A、陀螺仪传感器180B、气压传感器180C、磁传感器180D、加速度传感器180E、距离传感器180F、接近光传感器180G、指纹传感器180H、温度传感器180J、触摸传感器180K、环境光传感器180L和骨传导传感器180M等。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application  processor,AP)、调制解调处理器、图形处理器(graphics processing unit,GPU)、图像信号处理器(image signal processor,ISP)、控制器、存储器、视频编解码器、数字信号处理器(digital signal processor,DSP)、基带处理器及神经网络处理器(neural-network processing unit,NPU)等中的一个或多个。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
其中,应用处理器通过音频模块170(如扬声器170A等)输出声音信号,或通过显示屏194显示图像或视频。
控制器可以是终端100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
处理器110可以通过执行指令,执行不同的操作,以实现不同的功能。该指令例如可以是设备出厂前预先保存在存储器中的指令,也可以是用户在使用过程中安装新的应用(application,APP)之后从APP中读取到的指令,本申请实施例对此不作任何限定。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口、集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口、通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口、移动产业处理器接口(mobile industry processor interface,MIPI)、通用输入输出(general-purpose input/output,GPIO)接口、SIM接口和/或USB接口等。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为终端100充电,也可以用于终端100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他终端,例如增强现实(augmented reality,AR)设备等。
可以理解的是,本申请示意的各模块间的接口连接关系,只是示意性说明,并不构成对终端100的结构限定。在另一些实施例中,终端100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过终端100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为终端100供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
终端100的无线通信功能可以通过天线1、天线2、移动通信模块150、无线通信模块160、调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。终端100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在终端100上的包括2G/3G/4G/5G等无线通信的解决方案。
无线通信模块160可以提供应用在终端100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙,全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信(near field communication,NFC)技术,红外(infrared,IR)技术等无线通信的解决方案。
在一些实施例中,终端100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合, 使得终端100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wide band code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),第五代(5th generation,5G)通信系统,BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(BeiDou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
终端100可以通过GPU、显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194,也可以称为屏幕,可用于显示图像、视频等。显示屏194可包括显示面板。在一些实施例中,终端100可以包括一个或多个显示屏194。
应理解,显示屏194还可以包括更多的组件。例如,背光板、驱动电路等。其中,背光板可用于提供光源,显示面板基于背光板提供的光源而发光。驱动电路可用于控制液晶层的液晶透光或不透光。
终端100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展终端100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行终端100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储终端100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
终端100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放、录音等。
可以理解的是,本申请示意的结构并不构成对终端100的具体限定。在另一些实施例中,终端100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
终端100的软件系统可以采用分层架构、事件驱动架构、微核架构、微服务架构或云架构。本申请以分层架构的Harmony OS为例,示例性说明终端100的软件结构。其中,本申请对终端的操作系统的类型不做限定。
图2是适用于本申请实施例提供的文件下载方法的一种终端的软件的结构框图。
如图2所示,分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Harmony OS分为四层,从上至下分别为应用层、框架层、系统服务层,以及内核层。
应用层可以包括一系列应用程序。如图2所示,应用程序层可以包括系统应用和第三方应用。系统应用可以理解为系统自带的一些应用,例如相机、图库、日历、通话、地图、蓝牙、视频和音乐等应用程序。第三方应用可以理解为非系统应用,可以从应用商店等下载安装的应用。
框架层可以包括用户界面(user interface,UI)框架、用户程序框架和能力(Ability)框架。框架层为Harmony OS的应用程序提供了Java语言、C语言、C++语言、JavaScript(JS)语言等多语言的用户程序框架和Ability框架,以及各种软硬件服务对外开放的多语言框架应用程序界面(application Program Interface,API);同时为采用Harmony OS的设备提供了C语言、C++语言、JS语言等多语言 的UI框架。
系统服务层可以包括系统基本能力子系统集、基础软件服务子系统集、增强软件服务子系统集和硬件服务子系统集。系统服务层是Harmony OS的核心能力集合,通过框架层为应用程序提供服务。
其中,系统基本能力子系统集可以由分布式软总线、分布式数据管理、分布式任务调度、方舟多语言运行时、公共基础库、多模输入、图形、安全、人工智能(artificial intelligence,AI)等子系统组成,系统基本能力子系统集可以为分布式应用在Harmony OS多设备上的运行、调度、迁移等操作提供基础能力。
方舟运行时可以提供C语言、C++语言、JS语言多语言运行时和基础的系统类库,也为使用方舟编译器静态化的Java程序(即应用程序或框架层中使用Java语言开发的部分)提供运行时。
基础软件服务子系统集可以由事件通知、电话、多媒体等子系统组成,可以为Harmony OS提供公共的、通用的软件服务。
增强软件服务子系统集可以由智慧屏专有业务、穿戴专有业务、物联网(internet of things,IoT)专有业务等子系统组成,可以为Harmony OS提供针对不同设备的、差异化的能力增强型软件服务。
硬件服务子系统集可以由位置服务、生物特征识别、穿戴专有硬件服务、IoT专有硬件服务等子系统组成,可以为Harmony OS提供硬件服务。
需要说明的是,根据不同设备形态的部署环境,基础软件服务子系统集、增强软件服务子系统集和硬件服务子系统集内部可以按子系统粒度裁剪,每个子系统内部又可以按功能粒度裁剪。本申请实施例对此不作任何限定。
在本申请实施例中,如图2所示,应用基本能力子系统可以包括分布式软总线和分布式数据管理,以使得终端具有能实现本申请提供的目标文件被分布式存储的能力。
内核层可以包括内核子系统和驱动子系统。Harmony OS采用多内核设计,基于内核子系统,Harmony OS支持针对不同资源受限设备选用适合的OS内核;内核抽象层(kernel abstract layer,KAL)通过屏蔽多内核差异,对上层提供基础的内核能力,包括进程管理/线程管理、内存管理、文件系统、网络管理和外设管理等。驱动子系统中的驱动框架是Harmony OS硬件生态开放的基础,可以提供统一外设访问能力和驱动开发、管理框架。
需要说明的是,图1和图2所示的终端的结构仅为示例,不应对本申请实施例产生任何限定。
为便于理解本申请实施例提供的文件下载方法,下面将对适用于本申请实施例提供的文件下载方法的应用场景进行说明。可理解地,本申请实施例描述的应用场景是为了更加清楚的说明本申请实施例的技术方案,并不构成对于本申请实施例提供的技术方案的限定。
图3是适用于本申请实施例提供的文件下载方法的场景示意图。
如图3所示,终端310接收来自云端的用于传输文件的消息,但用户希望将该文件存储在终端320上。图中的终端310以手机为例,终端320以智慧屏为例而示出,但不应对本申请构成任何限定,终端310和终端320也可以为如前所述的其他类型的终端,例如,平板电脑、PC等。如果希望将文件存储在终端320上,在已知的技术中,需要将文件下载至终端310上,再通过终端310转发至终端320。但这种方法浪费终端310的资源,如传输资源、存储资源等。另外,一旦终端320可用的存储空间不足以存储文件,将存储失败。因此,上述方法中,对各个终端的资源利用不合理。
应理解,图3所示的场景中,终端310从云端获取到用于传输文件的消息,也即,文件的发送方为云端,但不应对本申请构成任何限定。在本申请中,云端也可以替换为其他终端,也即,本申请提供的方法也可以适用于端对端的场景,换言之,文件的发送方也可以是同一局域网下的某一终端,本申请对此不作限定。
在文件下载过程中,为合理利用终端的资源,本申请提供了一种文件下载方法,第一终端显示用于指示下载目标文件的下载通知,响应于用户的操作,选择第二终端和第三终端,并分别向第二终端和第三终端发送下载命令,以指示下载相应的分块文件,整个过程中,第一终端无需下载目标文件,因此可以避免不必要的资源耗费,而且,第二终端和第三终端分别存储目标文件的一部分文件,可以避免第二终端存储空间不足导致的存储失败的问题,因此,本申请提供的方法有利于合理地利用各个终端的资源。
本申请还提供了另一种文件下载方法,第一终端显示用于指示下载目标文件的下载通知,响应于用户的操作,选择第二终端,并指示第二终端下载目标文件,在第二终端可用的存储空间小于存储目标文 件所需的存储空间的情况下,显示存储空间不足的通知,并响应于用户选择第三终端的操作,指示第三终端下载目标文件的剩余部分,整个过程中,第一终端无需下载目标文件,因此可以避免不必要的资源耗费,而且,第二终端和第三终端分别存储目标文件的一部分文件,可以避免第二终端存储空间不足导致的存储失败的问题,因此,本申请提供的方法有利于合理地利用各个终端的资源。
下面将结合具体的实施例详细描述本申请提供的文件下载方法。
在此之前,做出如下说明:
第一,本申请实施例中所涉及的目标文件的第一分块文件是目标文件的第一部分的一示例,目标文件的第二分块文件是目标文件的第二部分的一示例。
第二,在本申请实施例中,用户的第一操作、第二操作、第三操作等具体是什么操作,本申请对此不作具体限定,下面实施例中给出的具体的操作仅为示例,不对本申请实施例构成任何限定。另外,第一界面、第二界面以及第三界面等具体是什么样式的界面,本申请对此也不作具体限定。
应理解,下文所示的实施例以第一终端、第二终端、第三终端等各个终端交互为例来描述,但这不应对该方法的执行主体构成任何限定。只要能够通过运行记录有本申请实施例提供的方法的代码的程序,便可执行本申请实施例提供的方法。例如,第一终端也可以替换为配置在第一终端中的部件(如,芯片、芯片系统等),或其他能够调用程序并执行程序的功能模块,第二终端也可以替换为配置在第二终端中的部件(如,芯片、芯片系统等),或其他能够调用程序并执行程序的功能模块。本申请实施例对此不作限定。第一终端例如可以是图3中所示的终端310,第二终端例如可以是图3中所示的终端320。
图4是本申请实施例提供的文件下载方法的一示意性流程图。下面将详细描述图4所示的各个步骤。
步骤401,发送方向第一终端发送第一消息。相应地,第一终端接收到第一消息。第一终端接收到第一消息后,显示第一界面,第一界面显示下载通知。
其中,第一消息用于传输目标文件。目标文件例如包括但不限于:音视频文件、应用程序、安装包、文本文档(如.txt文件、.xml文件等)等,本申请实施例对目标文件的类型不作限定。
第一消息的发送方可以是云端(如图3中所示的场景中的云端),也即,第一终端接收来自云端的第一消息,该第一消息用于传输目标文件。第一消息的发送方还可以是同一局域网下的其他终端,也即,第一终端接收来自另一终端的第一消息,第一消息用于传输目标文件。
在本申请中,第一消息的发送方可以为目标文件的发送方,换言之,目标文件可以来源于云端或同一局域网下的另一终端,本申请对此不作限定。
第一终端接收第一消息后,显示下载通知,以指示用户下载目标文件。例如,微信上接收到一个消息,该消息是用于传输一个文本文档,该文本文档的下方提示用户可以下载该文本文档,虽然该终端接收到上述消息,但该文本文档并没有被下载到本地。
可选地,第一消息中例如可以包括目标文件的下载地址,目标文件的名称等相关的信息。
第一终端接收到来自发送方的第一消息后,显示第一界面,第一界面显示下载通知,该下载通知用于指示用户下载目标文件。
图5是本申请实施例提供的第一界面的界面示意图。
如图5所示,第一终端接收到第一消息后,显示第一界面,第一界面上显示有下载通知,以指示用户下载目标文件(如图5中目标文件的示例),用户可以选择对希望对目标文件执行的操作,如打开、下载等。例如,响应于用户选择下载目标文件的操作,第一终端可以通过界面弹出用于下载目标文件的终端,以供用户选择。下面结合图6给出第一终端通过界面弹出可供用户选择的用于下载目标文件的终端的示例。其中,图6所示的界面是第三界面的示例,第三界面可以显示包含第二终端在内的多个终端。
图6是本申请实施例提供的第一终端显示多个终端的界面示意图。如图6所示,第一终端通过界面显示多个终端,其中,图6中的a)和图6中的b)示出了第一终端通过用户界面显示多个终端的两种形式。
如图6中的a)所示,第一终端以列表的形式显示多个终端,该多个终端例如包括终端1、终端2、终端3以及终端4,每个终端对应有选择按钮。示例性地,第一终端以图标的形式显示出上述多个终端,以供用户选择希望存储目标文件的终端,响应于用户对多个终端中终端2对应的操作按钮的点击操作,第一终端确定用户希望存储目标文件的终端为终端2,进一步地,向终端2发送第一下载命令,以指示其下载目标文件。
如图6中的b)所示,第一终端以图标的形式显示多个终端,该多个终端例如包括终端1、终端2、终端3以及终端4。示例性地,第一终端以图标的形式显示出上述多个终端,以供用户选择希望存储目标文件的终端,响应于用户对多个终端中终端2对应的图标的点击操作,第一终端确定用户希望存储目标文件的终端为终端2,进一步地,向终端2发送第一下载命令,以指示其下载目标文件。
应理解,图6中的a)和图6中的b)示出的显示多个终端的两种形式仅为示例,不应对本申请实施例构成任何限定,第一终端还可以以其他形式显示多个终端。
步骤402,响应于用户选择第二终端的操作,第一终端向第二终端发送第一下载命令。相应地,第二终端接收来自第一终端的第一下载命令。其中,用户选择第二终端的操作为用户的第一操作的一示例。
其中,第二终端是用户希望存储目标文件的终端。第一下载命令用于指示第二终端下载上述目标文件。第二终端是用户希望存储上述目标文件的终端,换言之,第一终端接收到用于传输目标文件的第一消息,但用户希望将目标文件存储在第二终端上。
可选地,第一下载命令中携带如下至少一项信息:目标文件的下载地址或目标文件的大小。
其中,目标文件的下载地址可以用于下载目标文件,目标文件的大小可以用于确定终端可以的存储空间是否可以存储上述目标文件。
应理解,第一下载命令中还可以包括更多的参数,例如包括但不限于:命令类型、命令的标识、命令的发送方、命令的接收方、文件的标识以及长度偏移量(offset)等。在本申请中,终端之间可以使用二进制交互协议进行通信。
第一下载命令的一示例如下:
{“action(命令类型为)”:“download(下载)”,
“opid”(命令的标识为):“1612373622701”,
“from(命令的发送方为)”:“第一终端”,
“to(命令的接收方为)”:“第二终端”,
“fileId(文件的标识为)”:“xxx”,
“downloadUrl(下载地址为)”:“xxxx”,
“downloadParam(下载参数为)”:“xxxx(如目标文件的大小)”,
“offset(长度偏移量为)”:“0”}。
其中,长度偏移量可以是以目标文件的字节来计算的,例如,目标文件的大小为1兆(mega,M),则对应的长度偏移量的长度为1024个字节。
长度偏移量还可以是以数据块的偏移量来计算的。例如,一个整体的多媒体文件通常可以被分为若干数据块,这种情况下,长度偏移量可以是以数据块的偏移量来计算的。例如,长度偏移量为5,表示从第5块开始下载。
需要说明的是,在本申请中,长度偏移量可以指示开始位置,也可以指示开始位置和结束位置,本申请对此不作限定。例如,下载命令中的长度偏移量为0,表示从第0个字节开始下载。又例如,下载命令中的长度偏移量为0~500,表示从第0个字节开始下载,下载至第500个字节。为便于描述,本申请实施例中的长度偏移量以指示开始位置为例进行说明。
步骤403,第二终端从发送方下载目标文件。
第二终端接收到来自第一终端的第一下载命令后,从目标文件的发送方下载目标文件。如前所述,第一下载命令中包括目标文件的下载地址,第二终端可以基于第一下载命令中的下载地址,下载目标文件。
其中,第二终端从发送方下载目标文件,具体包括:第二终端向发送方请求下载目标文件,发送方接收到来自第二终端的请求后,将目标文件发送给第二终端,第二终端存储在本地。
应理解,第二终端在下载目标文件的过程中,可能存在可用的存储空间不足的情况(也即第二终端可用的存储空间可能小于存储目标文件所需的存储空间),这种情况下,第二终端继续执行步骤404至步骤407;在第二终端可用的存储空间大于或等于存储目标文件所需的存储空间(也即第二终端可用的存储空间充足)的情况下,第二终端可以不执行步骤404至步骤407,直接执行步骤408,也即,第二终端下载目标文件直至下载完成。
下面给出第二终端可以的存储空间小于存储目标文件所需的存储空间的一示例:
假设存储文本文档“1.txt”所需的存储空间为1G,但第二终端可用的存储空间为500M,则第二终端可以下载“1.txt”的第一分块文件(如长度0~offset的部分),第三终端可以下载“1.txt”的第二分块文件(如长度offset~结束(end)的部分)。
步骤404,第二终端向第一终端发送请求消息。
其中,上述请求消息可以用于指示第二终端可用的存储空间小于存储文件所需的存储空间,以向第一终端请求存储空间。上述请求消息中携带第二终端已下载目标文件的第一部分信息,例如可以携带有第二终端可以下载的目标文件的长度的指示信息,例如,第二终端下载过程中发现存储空间不足,只能下载目标文件的长度为0至500的部分,则上述请求消息中可以携带有长度偏移量500,该长度偏移量500指示第二终端可以下载目标文件的长度为0~500的部分。
示例性地,第二终端在下载目标文件的过程中,发现自身可用的存储空间不足,则可以向第一终端发送请求消息,以向第一终端请求存储资源。相应地,第一终端接收请求消息。
步骤405,第一终端显示第二界面,并响应于用户对第二界面的操作,确定第三终端。
第一终端接收到上述请求消息后,可以显示第二界面,以指示第二终端可用的存储空间不足,并向用户展示可供选择的多个终端。响应于用户选择多个终端中某一终端的操作,第一终端确定出第三终端,第三终端用于存储目标文件的剩余部分。
图7是本申请实施例提供的存储空间不足的界面示意图。如图7所示,第一终端接收到来自第二终端的请求消息后,确定第二终端可用的存储空间不足,进而可以通过界面提示用户第二终端可用的存储空间不足,上述存储空间不足的通知为第一通知的一示例,第一通知可以用于提示用户第二终端可用的存储空间不足,进而第一终端向用户展示可以选择的其他终端(如第一终端可以在界面上显示可供用户选择的用于存储目标文件的剩余部分的终端),以对目标文件进行分布式存储。例如,响应于用户选择第三终端的操作,第一终端执行步骤406,也即,向第二终端发送响应消息,以向第二终端指示第三终端。
步骤406,第一终端向第二终端发送响应消息。
第一终端接收到来自第二终端的请求消息后,确定第三终端,第三终端和第二终端用于对目标文件进行分布式存储,第二终端用于存储目标文件的第一分块文件,第三终端用于存储目标文件的第二分块文件。进一步地,第一终端向第二终端发送响应消息,以指示第三终端。
可选地,上述响应消息中可以包括第三终端的标识和以下至少一项:命令类型、命令的标识、命令的发送方以及命令的接收方等。上述响应消息的一示例如下:
{“action(命令的类型为)”:“alloc(分配空间)”,
“opid(命令的标识为)”:“1612373622701”,
“from(命令的发送方为)”:“第一终端”,
“to(命令的接收方为)”:“第二终端”,
“allocdeviceId(分配的终端为)”:“第三终端”
“offset(长度偏移量为)”:“500”}。
步骤407,第二终端向第三终端发送第二下载命令。
第二终端接收到来自第一终端的响应消息后,向第三终端发送第二下载命令,以指示第三终端下载目标文件的第二分块文件。
示例性地,第二终端在下载的过程中发现可用的存储空间不足,如只能下载目标文件的长度为0至500的部分,向第一终端请求存储资源,则上述第二下载命令指示第三终端下载目标文件的500至1000的部分。
第二下载命令中例如可以包括命令类型、命令的标识、命令的发送方、命令的接收方、文件的标识、文件的下载地址、长度偏移量(offset)等。
第二下载命令的一示例如下:
{“action(命令类型为)”:“download(下载)”,
“opid”(命令的标识为):“1612373622701”,
“from(命令的发送方为)”:“第二终端”,
“to(命令的接收方为)”:“第三终端”,
“fileId(文件的标识为)”:“xxx”,
“downloadUrl(下载地址为)”:“xxxx”,
“downloadParam(下载参数为)”:“xxxx(如目标文件的大小)”,
“offset(长度偏移量为)”:“500”}。
可选地,第一终端也可以直接向第三终端发送第二下载命令,也即,第二下载命令由第一终端发送,第一终端可以不向第二终端发送响应消息,第二终端也无需向第三终端发送第二下载命令。
步骤408,第三终端下载目标文件的剩余部分。
示例性地,第二终端下载目标文件的第一分块文件(如长度0~offset的部分)。第三终端根据第二下载命令中目标文件的下载地址和offset,下载目标文件的第二分块文件(如长度offset~end的部分)。
步骤409,第二终端下载目标文件直至下载完成。
如果第二终端可用的存储空间足以存储目标文件,则第二终端下载目标文件直至下载完成。
应理解,图4所示的实施例中各个步骤仅为示例,在其他的实施例中,可以包括更多或更少的步骤,本申请对此不作限定。例如,图4所示的方法还包括:第二终端和第三终端响应于用户的设置操作,确定用于存储下载的文件的存储空间的大小和存储位置,上述第二终端可用的存储空间是指定义好的用于存储下载的文件的存储空间中剩余的空间。另外,本申请实施例对图4所示的实施例中各个步骤的顺序不作限定。
图8是本申请实施例提供的文件下载方法的另一示意性流程图。下面将详细描述图8所示的各个步骤。
步骤801,发送方向第一终端发送第一消息。相应地,第一终端接收到第一消息。第一终端接收到第一消息后,显示第一界面,第一界面显示下载通知。
步骤802,响应于用户在第一界面上的选择,第一终端向第二终端发送第一下载命令。相应地,第二终端接收来自第一终端的第一下载命令。
关于步骤801和步骤802的相关描述可以参看图4中步骤401和步骤402的相关描述,此处不再赘述。
步骤803,第二终端判断自身可用的存储空间是否小于存储目标文件所需的存储空间。
如果第二终端可用的存储空间大于或等于存储目标文件所需的存储空间,则第二终端执行步骤804,也即下载目标文件,直至下载完成;如果第二终端可用的存储空间小于存储目标文件所需的存储空间,则第二终端执行步骤805至步骤809。
示例性地,第一下载命令中可以携带有目标文件的大小,第二终端可以根据目标文件的大小,判断自身可用的存储空间是否小于存储目标文件所需的存储空间。
步骤804,当自身可用的存储空间满足存储目标文件所需的存储空间时,第二终端从发送方下载目标文件。
步骤805,当自身可用的存储空间小于存储目标文件所需的存储空间时,第二终端向第一终端发送请求消息。
关于步骤804和步骤805的描述可以参看图4中的步骤403和步骤404的相关描述,此处不再赘述.
步骤806,第一终端向第二终端发送响应消息。
上述响应消息中可以包括第三终端的标识和以下至少一项:命令类型、命令的标识、命令的发送方以及命令的接收方等。上述响应消息的一示例如下:
{“action(命令的类型为)”:“alloc(分配空间)”,
“opid(命令的标识为)”:“1612373622701”,
“from(命令的发送方为)”:“第一终端”,
“to(命令的接收方为)”:“第二终端”,
“allocdeviceId(分配的终端为)”:“第三终端”
“offset(长度偏移量为)”:“500”}。
上述响应消息中还可以携带指示信息,以指示第二终端开始下载目标文件的第一分块文件。
步骤807,第二终端从发送方下载目标文件的第一分块文件。
步骤808,第二终端向第三终端发送第二下载命令。
关于第二下载命令的描述可以参看图4中的步骤407的相关描述,此处不再赘述。
步骤809,第三终端从发送方下载目标文件的第二分块文件。
如果第二终端可用的存储空间小于存储目标文件所需的存储空间,则第二终端下载目标文件的第一分块文件,第三终端下载目标文件的第二分块文件。
图4与图8的不同之处在于,在图4所示的实施例中,第二终端接收到第一下载命令后,先下载目标文件,在下载的过程中发现自身的存储空间不足;在图8所示的实施例中,第二终端接收到第一下载命令后,先判断自身可用的存储空间是否小于存储目标文件所需的存储空间,再下载目标文件。
基于上述技术方案,第一终端显示用于指示下载目标文件的下载通知,响应于用户的操作,选择第二终端,并指示第二终端下载目标文件,在第二终端可用的存储空间小于存储目标文件所需的存储空间的情况下,显示存储空间不足的通知,并响应于用户选择第三终端的操作,指示第三终端下载目标文件的剩余部分,整个过程中,第一终端无需下载目标文件,因此可以避免不必要的资源耗费,而且,第二终端和第三终端分别存储目标文件的一部分文件,可以避免第二终端存储空间不足导致的存储失败的问题,因此,本申请提供的方法有利于合理地利用各个终端的资源。
图9是本申请实施例提供的文件下载方法的又一示意性流程图。
步骤901,发送方向第一终端发送第一消息。相应地,第一终端接收来自发送方的第一消息。第一终端接收第一消息后,显示第一界面,第一界面显示下载通知。
其中,第一消息用于传输目标文件。目标文件来源于发送方,也即,发送方既是第一消息的发送方,也是目标文件的发送方,发送方向第一终端发送第一消息的理解可以参看步骤401。发送方可以是云端(如图3中所示的场景中的云端),也即,第一终端接收来自云端的第一消息,该第一消息用于传输目标文件。目标文件的发送方还可以是同一局域网下的其他终端,第一终端接收来自另一终端的第一消息,第一消息用于传输目标文件。另外,关于第一界面的相关描述可以参看图5。
步骤902,第一终端响应于用户的操作,确定用于存储目标文件的终端。
示例性地,第一终端响应于用户点击下载的操作,第一终端可以通过界面显示多个终端以及各个终端对应的可用的存储空间。可以理解,第一终端可以与上述多个终端(如第二终端、第三终端以及第四终端)建立连接,以获取到该多个终端中各个终端对应的可用的存储空间。
可选地,上述通过界面显示多个终端,如第二终端、第三终端等可以是录了同一账号的多个终端,也可以是属于同一个群组的多个终端,还可以是登录了同一Wi-Fi的多个终端,本申请对上述多个终端之间的关系不作具体限定。
图10是本申请实施例提供的第一终端显示多个终端的又一界面示意图。如图10所示,第一终端通过界面显示多个终端及其对应的可用的存储空间,如第一终端可用的存储空间为50M、第二终端可用的存储空间为60M、第三终端可用的存储空间为30M、第四终端可用的存储空间为70M,响应于用户选中第二终端和第三终端的操作,第一终端执行步骤903和步骤904,第二终端和第三终端对目标文件进行分布式存储,如第二终端存储目标文件的第一分块文件,第三终端存储目标文件的第二分块文件。
可选地,用户还可以设置第二终端和第三终端所存储的分块文件的大小。例如,响应于用户设置第二终端存储目标文件的长度为0~offset的部分,第三终端存储目标文件的长度为offset~end的部分,第一终端向第二终端指示下载目标文件的长度为0~offset的部分,指示第三终端下载目标文件的长度为offset~end的部分。
步骤903,第一终端向第二终端发送第一下载命令。相应地,第二终端接收来自第一终端的第一下载命令。
第一下载命令中例如可以包括命令类型、命令的标识、命令的发送方、命令的接收方、文件的标识、文件的下载地址、长度偏移量(offset)等。
第一下载命令的一示例如下:
{“action(命令类型为)”:“download(下载)”,
“opid”(命令的标识为):“1612373622701”,
“from(命令的发送方为)”:“第一终端”,
“to(命令的接收方为)”:“第二终端”,
“fileId(文件的标识为)”:“xxx”,
“downloadUrl(下载地址为)”:“xxxx”,
“downloadParam(下载参数为)”:“xxxx(如目标文件的大小)”,
“offset(长度偏移量为)”:“0~500”}。
步骤904,第一终端向第三终端发送第二下载命令。
第一终端向第三终端发送第二下载命令,以指示第三终端下载目标文件的第二分块文件。
第二下载命令中例如可以包括命令类型、命令的标识、命令的发送方、命令的接收方、文件的标识、文件的下载地址、长度偏移量(offset)等。
第二下载命令的一示例如下:
{“action(命令类型为)”:“download(下载)”,
“opid”(命令的标识为):“1612373622701”,
“from(命令的发送方为)”:“第一终端”,
“to(命令的接收方为)”:“第三终端”,
“fileId(文件的标识为)”:“xxx”,
“downloadUrl(下载地址为)”:“xxxx”,
“downloadParam(下载参数为)”:“xxxx(如目标文件的大小)”,
“offset(长度偏移量为)”:“500~1000”}。
可以看出,第一终端向第二终端发送的第一下载命令和第一终端向第三终端发送的第二下载命令类似,第一下载命令指示第二终端下载目标文件的0至500的部分,第二下载命令指示第三终端下载目标文件的500至1000(目标文件结束)的部分。
步骤905,第二终端下载目标文件的第一分块文件。
示例性地,第二终端基于第一下载命令中目标文件的下载地址和offset,下载目标文件的第一分块文件(如长度0~offset的部分)。
步骤906,第三终端下载目标文件的第二分块文件。
示例性地,第三终端根据第二下载命令中目标文件的下载地址和offset,下载目标文件的第二分块文件(如长度offset~end的部分)。
可选地,在本申请中,各个终端可用的存储空间是指预先定义好的用于存储下载的文件的存储空间的大小。另外,各个终端还可以预先设置用于存储目标文件的存储下载的文件的位置。
应理解,图9所示的实施例中各个步骤仅为示例,在其他的实施例中,可以包括更多或更少的步骤,本申请对此不作限定。另外,本申请实施例对图9所示的实施例中各个步骤的顺序不作限定。例如,步骤905和步骤906可以同时执行。
基于上述技术方案,第一终端显示用于指示下载目标文件的下载通知,响应于用户的操作,选择第二终端和第三终端,并分别向第二终端和第三终端发送下载命令,以指示下载相应的分块文件,整个过程中,第一终端无需下载目标文件,因此可以避免不必要的资源耗费,而且,第二终端和第三终端分别存储目标文件的一部分文件,可以避免第二终端存储空间不足导致的存储失败的问题,因此,本申请提供的方法有利于合理地利用各个终端的资源。
可以理解,如果目标文件被分布式存储,则在某些场景中,可能需要将各个目标文件的分块文件进行整合,得到目标文件。例如,目标文件需要被整合之后才能使用的场景。又例如,用户需要把目标文件转发至另一终端上的场景等。其中,需要整合才能使用的文件例如包括但不限于:音视频、应用程序、安装包等。不需要整合即可使用的文件例如包括:文本文档(如.txt文件、.xml文件等)。在本申请中,以第四终端对目标文件进行整合为例,第一终端可以命令第二终端和第三终端将自身存储的分块文件传输至第四终端,并向第四终端发送整合命令,以使第四终端对上述分块文件进行整合,得到目标文件,这样便于用户完整地使用目标文件。
图11是本申请实施例提供的整合分块文件的流程示意图。下面将结合图11详细描述整合分块文件得到目标文件的过程。其中,用于整合分块文件的终端以第四终端为例。
步骤1101,第一终端接收来自用户的整合指示。
响应于用户的操作,第一终端接收来自用户的整合指示。例如,响应于用户点击整合的操作,第一终端接收来自用户的整合指示。上述点击整合的操作为用户的第三操作和第二操作的一示例。
步骤1102,第一终端向第四终端发送整合命令。相应地,第四终端接收来自第一终端的整合命令。
其中,整合命令用于指示第四终端整合第一分块文件和第二分块文件,以得到目标文件。上述整合命令为第一命令的一示例。
可选地,第一命令包括以下任一项:整合命令、分享命令、安装命令或播放命令。
可选地,第一命令中包括目标文件的第一部分的长度偏移量和目标文件的第二部分的长度偏移量。
可选地,第一终端可以通过界面显示文件目录。
示例性地,第一终端通过界面显示目标文件的文件目标,例如,一部分目标文件被存储于第二终端,一部分目标文件被存储于第三终端,响应于用户选择第四终端来整合的情况下,第一终端向第四终端发送整合命令,以指示第四终端整合分块文件,以得到目标文件。
图12是本申请实施例提供的通过界面显示文件目录的界面示意图。如图12中的a)所示,第一终端的界面上显示有文件目录,其中,文件包括文件1、文件2和文件3,以文件1为例,例如,文件1的40%(记为第一分块文件)被存储于第二终端,文件1的60%(记为第二分块文件)被存储于第三终端。用户可以选择文件1,点击整合、安装、播放、或分享等按钮(图中示例性地示出了整合和安装按钮)。响应于用户点击整合按钮的操作,界面上弹出弹框,如图12中的b)所示,第一终端显示出可供用户选择的用于整合第一分块文件和第二分块文件的终端。例如,响应于用户选择第四终端的操作,第一终端向第四终端发送整合命令,并向第二终端发送第一传输命令,以指示第二终端向第四终端发送第一分块文件,并且,第一终端向第三终端发送第二传输命令,以指示第三终端向第四终端发送第二分块文件。另外,第四终端整合第一分块文件和第二分块文件后,如图12中的c)所示,第四终端还可以通过界面提示用户整合完成,并提示用户选择相应的操作,如分享、安装、播放、查看等,响应于用户选择播放的操作,第四终端可以对整合后的文件1(如视频)进行播放。
图13是本申请实施例提供的通过界面显示文件目录的另一界面示意图。如图13中的a)所示,第一终端的界面上显示有文件目录,其中,文件包括文件1、文件2和文件3,以文件1为例,例如,目标文件的40%(记为第一分块文件)被存储于第二终端,目标文件的60%(记为第二分块文件)被存储于第三终端。用户可以选择文件1,点击整合后分享按钮。响应于用户点击整合后分享按钮的操作,如图13中的b)所示,第一终端提示用户选择用于整合第一分块文件和第二分块文件的终端。例如,响应于用户选中第四终端的操作,第一终端向第四终端发送整合命令,并向第二终端发送第一传输命令,以指示第二终端向第四终端发送第一分块文件,并且,第一终端向第三终端发送第二传输命令,以指示第三终端向第四终端发送第二分块文件。另外,第四终端整合第二分块文件和第二分块文件后,可以自动完成分享的动作。
应理解,图12或图13所示的界面仅为示例,不应对本申请实施例构成任何限定。在其他的实施例中,界面可以由更多的呈现形式,如包括更多或更少的按钮,又如不同的图标所呈现的样式不同等,本申请对此不作限定。
步骤1103,第一终端向第二终端发送第一传输命令。相应地,第二终端接收来自第一终端的第一传输命令。
其中,第一传输命令用于指示第二终端向第四终端传输第一分块文件。
可选地,上述第一传输命令可以携带分块文件的发送方、分块文件的接收方,还可以携带命令类型、命令的标识以及文件的标识等。一示例,第一传输命令如下:
{“action(命令类型为)”:“transmit(传输)”,
“opid(命令的标识)”:“1612373622701”,
“from(分块文件的发送方)”:“第二终端”,
“to(分块文件的接收方)”:“第四终端”,
“fileId(文件的标识)”:“xxxx”}。
步骤1104,第二终端向第四终端发送目标文件的第一分块文件。
步骤1105,第一终端向第三终端发送第二传输命令。相应地,第三终端接收来自第一终端的第二传输命令。
可选地,上述第二传输命令可以携带分块文件的发送方、分块文件的接收方,还可以携带命令类型、命令的标识以及文件的标识等。一示例,第二传输命令如下:
{“action(命令类型为)”:“transmit(传输)”,
“opid(命令的标识)”:“1612373622701”,
“from(分块文件的发送方)”:“第三终端”,
“to(分块文件的接收方)”:“第四终端”,
“fileId(文件的标识)”:“xxxx”}。
步骤1106,第三终端向第四终端发送目标文件的第二分块文件。
应理解,图11所示的实施例中各个步骤仅为示例,在其他的实施例中,可以包括更多或更少的步骤,例如,若目标文件被分布式存储于第二终端、第三终端、第五终端,则第一终端还需要向第五终端发送第三传输命令,以指示第五终端向第四终端传输自身存储的分块文件。另外,本申请实施例对图11所示的实施例中各个步骤的顺序不作限定。例如,步骤1102、步骤1103和步骤1105可以同时执行。
还应理解,图11中所示的第四终端仅为示例,不应对本申请实施例构成任何限定。例如,第四终端和第三终端可以为同一终端,只要第四终端可用的存储空间能够存储目标文件即可。
基于上述技术方案,第一终端可以命令第二终端和第三终端将其自身存储目标文件的分块文件发送给第四终端进行整合,以得到整合后的目标文件,这样更方便用户对完整的目标文件的利用,有利于提高用户体验。
本申请实施例还提供了一种终端,该终端包括用于执行上述图4、图8、图9或图11中第一终端所执行的步骤的相应的单元,或,包括用于执行上述图4、图8、图9或图11中第二终端所执行的步骤的相应的单元,或,包括用于执行上述图4、图8、图9或图11中第三终端所执行的步骤的相应的单元,或,包括用于执行上述图11中第四终端所执行的步骤的相应的单元。该终端包括的单元可以通过软件和/或硬件方式实现。
本申请实施例还提供一种终端,该终端包括存储器和处理器,其中,存储器用于存储计算机程序,处理器用于调用并执行计算机程序,以使得该终端执行上述图4、图8、图9或图11中第一终端所执行的步骤,或者,以使得该终端执行上述图4、图8、图9或图11中第二终端所执行的步骤,或者,以使得该终端执行上述图4、图8、图9或图11中第三终端所执行的步骤,或者,以使得该终端执行上述图11中第四终端所执行的步骤。
本申请还提供了一种芯片系统,所述芯片系统包括至少一个处理器,用于实现上述图4、图8、图9或图11所示实施例中第一终端所执行的步骤中所涉及的功能,或,用于实现上述图4、图8、图9或图11所示实施例中第二终端所执行的步骤中所涉及的功能,或,用于实现上述图4、图8、图9或图11所示实施例中第三终端所执行的步骤中所涉及的功能,或,用于实现上述图11所示实施例中第四终端所执行的步骤中所涉及的功能。
在一种可能的设计中,所述芯片系统还包括存储器,所述存储器用于保存程序指令和数据,存储器位于处理器之内或处理器之外。
该芯片系统可以由芯片构成,也可以包含芯片和其他分立器件。
本申请实施例还提供一种计算机可读存储介质,其上存储有计算机程序,当该计算机程序被计算机执行时,使得该计算机执行上述图4、图8、图9或图11中第一终端所执行的步骤,或,以使得该计算机执行上述图4、图8、图9或图11中第二终端所执行的步骤,或,以使得该计算机执行上述图4、图8、图9或图11中第三终端所执行的步骤,或,以使得该计算机执行上述图11中第四终端所执行的步骤。
本申请实施例还提供一种计算机程序产品,包括计算机程序,当该计算机程序被运行时,使得计算机执行上述图4、图8、图9或图11中第一终端所执行的步骤,或,以使得该计算机执行上述图4、图8、图9或图11中第二终端所执行的步骤,或,以使得该计算机执行上述图4、图8、图9或图11中第三终端所执行的步骤,或,以使得该计算机执行上述图11中第四终端所执行的步骤。
应理解,本申请实施例中的处理器可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现场可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公 开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。
还应理解,本申请实施例中的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。应注意,本文描述的系统和方法的存储器旨在包括但不限于这些和任意其它适合类型的存储器。
本说明书中使用的术语“单元”、“模块”等,可用于表示计算机相关的实体、硬件、固件、硬件和软件的组合、软件、或执行中的软件。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各种说明性逻辑块(illustrative logical block)和步骤(step),能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。在本申请所提供的几个实施例中,应该理解到,所揭露的装置、设备和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或模块的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络模块上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上单元集成在一个模块中。
在上述实施例中,各功能模块的功能可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令(程序)。在计算机上加载和执行所述计算机程序指令(程序)时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,数字通用光盘(digital video disc,DVD))、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施 例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (20)

  1. 一种文件下载方法,其特征在于,应用于第一终端,所述方法包括:
    显示第一界面,所述第一界面显示下载通知,所述下载通知指示用户下载目标文件;
    响应于所述用户的第一操作,向第二终端发送第一下载命令,所述第一下载命令用于指示所述第二终端下载所述目标文件;
    在所述第二终端可用的存储空间小于存储所述目标文件所需的存储空间的情况下,显示第二界面,所述第二界面显示第一通知;
    响应于所述用户的第二操作,向第三终端发送第二下载命令,所述第二下载命令用于指示所述第三终端下载所述目标文件的第二部分,其中,所述目标文件的第一部分存储在所述第二终端,所述目标文件的第二部分存储在所述第三终端。
  2. 如权利要求1所述的方法,其特征在于,在所述响应于所述用户的第一操作,向第二终端发送第一下载命令之前,所述方法还包括:
    获取和所述第一终端通信连接的包含第二终端在内的多个终端;
    显示第三界面,所述第三界面显示所述多个终端;
    响应于用户的操作,从多个终端中选择所述第二终端。
  3. 如权利要求1或2所述的方法,其特征在于,在所述显示第一界面之前,所述方法还包括:
    接收来自云端或与所述第一终端处于同一局域网下的其他终端的第一消息,所述第一消息用于传输所述目标文件。
  4. 如权利要求1至3中任一项所述的方法,其特征在于,在显示第二界面之前,所述方法还包括:
    接收来自所述第二终端的请求消息,所述请求消息中携带所述第二终端已下载所述目标文件的第一部分信息。
  5. 如权利要求1至4中任一项所述的方法,其特征在于,所述第一下载命令中携带有所述目标文件的下载地址和/或所述目标文件的大小,所述第二下载命令中携带有所述目标文件的下载地址和/或所述目标文件的第二部分的长度偏移量。
  6. 如权利要求1至5中任一项所述的方法,其特征在于,所述方法还包括:
    响应于所述用户的第三操作,接收来自所述用户的整合指示;
    响应于所述用户的第四操作,向第四终端发送第一命令,所述第一命令用于指示所述第四终端整合所述目标文件的第一部分和所述目标文件的第二部分,以得到所述目标文件;
    向所述第二终端发送第一传输命令,所述第一传输命令用于指示所述第二终端向第四终端传输所述目标文件的第一部分;
    向所述第三终端发送第二传输命令,所述第二传输命令用于指示所述第三终端向第四终端传输所述目标文件的第二部分。
  7. 如权利要求6所述的方法,其特征在于,所述第一命令包括以下任一项:整合命令、分享命令、安装命令或播放命令。
  8. 如权利要求6或7所述的方法,其特征在于,所述第一命令中包括所述目标文件的第一部分的长度偏移量和所述目标文件的第二部分的长度偏移量。
  9. 一种文件下载方法,其特征在于,应用于第二终端,所述方法包括:
    接收来自第一终端的第一下载命令,所述第一下载命令用于指示所述第二终端下载目标文件;
    基于所述第一下载命令,下载所述目标文件;
    在所述第二终端可用的存储空间不足的情况下,向所述第一终端发送请求消息,所述请求消息中携带所述第二终端已下载所述目标文件的第一部分信息。
  10. 如权利要求9所述的方法,其特征在于,所述方法还包括:
    接收来自所述第一终端的响应消息,所述响应消息中携带第三终端的标识以及所述目标文件的第二部分的长度偏移量;
    向所述第三终端发送第二下载命令,所述第二下载命令用于指示所述第三终端下载所述目标文件的第二部分;其中,所述目标文件的第一部分存储在所述第二终端,所述目标文件的第二部分存储在所述第三终端。
  11. 一种文件下载方法,其特征在于,应用于第一终端,所述方法包括:
    显示第一界面,所述第一界面显示下载通知,所述下载通知指示用户下载目标文件;
    响应于用户的第一操作,向第二终端发送第一下载命令,所述第一下载命令用于指示所述第二终端下载所述目标文件的第一部分;
    向第三终端发送第二下载命令,所述第二下载命令用于指示所述第三终端下载所述目标文件的第二部分。
  12. 如权利要求11所述的方法,其特征在于,在所述响应于用户的第一操作,向第二终端发送第一下载命令之前,所述方法还包括:
    获取和所述第一终端通信连接的包含所述第二终端和第三终端在内的多个终端;
    显示第二界面,所述第二界面显示所述多个终端;
    响应于用户的操作,从多个终端中选择所述第二终端和所述第三终端。
  13. 如权利要求11或12所述的方法,其特征在于,在所述显示第一界面之前,所述方法还包括:
    接收来自云端或与所述第一终端处于同一局域网下的其他终端的第一消息,所述第一消息用于传输所述目标文件。
  14. 如权利要求11至13中任一项所述的方法,其特征在于,所述第一下载命令中携带有所述目标文件的下载地址和/或所述目标文件的第一部分的长度偏移量,所述第二下载命令中携带有所述目标文件的下载地址和/或所述目标文件的第二部分的长度偏移量。
  15. 如权利要求11至14中任一项所述的方法,其特征在于,所述方法还包括:
    响应于所述用户的第二操作,接收来自所述用户的整合指示;
    响应于所述用户的第三操作,向第四终端发送第一命令,所述第一命令用于指示所述第四终端整合所述目标文件的第一部分和所述目标文件的第二部分,以得到所述目标文件;
    向所述第二终端发送第一传输命令,所述第一传输命令用于指示所述第二终端向所述第四终端传输所述目标文件的第一部分;
    向所述第三终端发送第二传输命令,所述第二传输命令用于指示所述第三终端向所述第四终端传输所述目标文件的第二部分。
  16. 如权利要求15所述的方法,其特征在于,所述第一命令包括以下任一项:整合命令、分享命令、安装命令或播放命令。
  17. 一种终端,其特征在于,包括用于实现如权利要求1至16中任一项所述的方法的单元。
  18. 一种终端,其特征在于,包括处理器和存储器,其中,
    所述存储器用于存储计算机程序;
    所述处理器用于调用所述计算机程序,以使得所述终端执行权利要求1至16中任一项所述的方法。
  19. 一种计算机可读存储介质,其特征在于,所述存储介质中存储有计算机程序或指令,当所述计算机程序或指令被计算机执行时,实现如权利要求1至16中任一项所述的方法。
  20. 一种计算机程序产品,其特征在于,所述计算机程序产品包括指令,当所述指令被计算机运行时,实现如权利要求1至16中任一项所述的方法。
PCT/CN2023/127364 2022-11-04 2023-10-27 一种文件下载方法及相关装置 WO2024093853A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211379154.7 2022-11-04
CN202211379154.7A CN117991939A (zh) 2022-11-04 2022-11-04 一种文件下载方法及相关装置

Publications (1)

Publication Number Publication Date
WO2024093853A1 true WO2024093853A1 (zh) 2024-05-10

Family

ID=90898011

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/127364 WO2024093853A1 (zh) 2022-11-04 2023-10-27 一种文件下载方法及相关装置

Country Status (2)

Country Link
CN (1) CN117991939A (zh)
WO (1) WO2024093853A1 (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103685426A (zh) * 2012-09-25 2014-03-26 联想(北京)有限公司 信息处理设备和信息处理方法
CN103685295A (zh) * 2013-12-20 2014-03-26 乐视网信息技术(北京)股份有限公司 一种下载多媒体文件的方法、终端及系统
CN104092723A (zh) * 2014-04-04 2014-10-08 腾讯科技(深圳)有限公司 文件下载方法、装置及系统
KR20160038496A (ko) * 2014-09-30 2016-04-07 아주대학교산학협력단 파일 시스템을 이용한 저장공간 통합 방법 및 시스템
CN106550035A (zh) * 2016-11-04 2017-03-29 上海斐讯数据通信技术有限公司 一种文件下载终端及文件下载的方法
CN110825402A (zh) * 2019-09-26 2020-02-21 华为技术有限公司 一种下载数据包的方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103685426A (zh) * 2012-09-25 2014-03-26 联想(北京)有限公司 信息处理设备和信息处理方法
CN103685295A (zh) * 2013-12-20 2014-03-26 乐视网信息技术(北京)股份有限公司 一种下载多媒体文件的方法、终端及系统
CN104092723A (zh) * 2014-04-04 2014-10-08 腾讯科技(深圳)有限公司 文件下载方法、装置及系统
KR20160038496A (ko) * 2014-09-30 2016-04-07 아주대학교산학협력단 파일 시스템을 이용한 저장공간 통합 방법 및 시스템
CN106550035A (zh) * 2016-11-04 2017-03-29 上海斐讯数据通信技术有限公司 一种文件下载终端及文件下载的方法
CN110825402A (zh) * 2019-09-26 2020-02-21 华为技术有限公司 一种下载数据包的方法及装置

Also Published As

Publication number Publication date
CN117991939A (zh) 2024-05-07

Similar Documents

Publication Publication Date Title
WO2021052437A1 (zh) 一种应用启动方法及电子设备
US11985374B2 (en) Method of controlling the sharing of videos and electronic device adapted thereto
KR102277460B1 (ko) 화면을 공유하기 위한 방법 및 그 전자 장치
US10609276B2 (en) Electronic device and method for controlling operation of camera-related application based on memory status of the electronic device thereof
JP2023506936A (ja) マルチ画面共働方法およびシステム、ならびに電子デバイス
WO2021151350A1 (zh) 一种动态链接库的加载方法及装置
WO2022127661A1 (zh) 应用共享方法、电子设备和存储介质
CN116048628B (zh) 设备启动方法及电子设备
WO2018210063A1 (zh) 一种终端系统启动方法及终端
US20230367572A1 (en) Patch Package Installation Method and Apparatus
WO2024093853A1 (zh) 一种文件下载方法及相关装置
WO2022161024A1 (zh) 升级提示方法、终端设备及计算机可读存储介质
US10552113B2 (en) Electronic device and method for controlling operation thereof
WO2022111664A1 (zh) 打补丁的方法、相关设备及系统
CN117009023B (zh) 显示通知信息的方法及相关装置
CN112181406A (zh) 一种渲染引擎的共享方法和装置
WO2022228035A1 (zh) 应用程序的图标更新方法及相关装置
CN116684022B (zh) 一种搜包方法、电子设备及介质
WO2024083114A1 (zh) 一种软件分发方法、电子设备及系统
WO2022160999A1 (zh) 显示方法和电子设备
CN116700660B (zh) 音频播放方法和电子设备
CN116662270B (zh) 文件解析方法及相关装置
WO2024046062A1 (zh) 一种卡片跨设备交互方法及电子设备
WO2023051357A1 (zh) 一种虚拟设备运行方法
WO2024046084A1 (zh) 一种用户界面显示方法及相关装置