CN113992663B - Method for sending file, electronic device and readable storage medium - Google Patents

Method for sending file, electronic device and readable storage medium Download PDF

Info

Publication number
CN113992663B
CN113992663B CN202111635150.6A CN202111635150A CN113992663B CN 113992663 B CN113992663 B CN 113992663B CN 202111635150 A CN202111635150 A CN 202111635150A CN 113992663 B CN113992663 B CN 113992663B
Authority
CN
China
Prior art keywords
target
file
electronic device
target file
files
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111635150.6A
Other languages
Chinese (zh)
Other versions
CN113992663A (en
Inventor
高孟影
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Glory Smart Technology Development Co ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202111635150.6A priority Critical patent/CN113992663B/en
Publication of CN113992663A publication Critical patent/CN113992663A/en
Application granted granted Critical
Publication of CN113992663B publication Critical patent/CN113992663B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Abstract

In the method, when a first electronic device detects an operation of a user requesting to send a target file, a first identifier of the target file and the type of the target file are determined in response to the operation, different types of target files are stored in different storage spaces, and the first electronic device can directly query the storage space corresponding to the type of the target file according to the first identifier of the target file and the type of the target file, acquire the target file from the storage space, and send the target file to a second electronic device.

Description

Method for sending file, electronic device and readable storage medium
Technical Field
The present application relates to the field of terminal technologies, and in particular, to a method for sending a file, an electronic device, and a readable storage medium.
Background
Currently, many electronic devices have a function of quickly sending files, for example, a mobile phone a is a sending terminal, a mobile phone B is a receiving terminal, a user searches a nearby mobile phone B using the mobile phone a, selects a file such as a picture, a video, and an audio, and sends the selected file to the mobile phone B using the function of quickly sending the file, and the mobile phone B can receive a connection request of the mobile phone a, and select to receive the file or refuse to receive the file. When the number of files selected by the user is large, the time delay of receiving the connection request by the receiving end is long, and the user experience is poor.
Disclosure of Invention
The embodiment of the application provides a method for sending a file, an electronic device and a readable storage medium.
In a first aspect, an embodiment of the present application provides a method for sending a file, where the method is performed by a first electronic device, and the method includes: when the first operation is detected, responding to the first operation, and determining a first identifier of the target file and the type of the target file, wherein the first operation is an operation of requesting to send the target file; according to the first identification of the target file and the type of the target file, acquiring the target file from a storage space corresponding to the type of the target file, wherein each file type corresponds to one storage space of the first electronic device; and sending the target file to the second electronic equipment.
Based on the technical scheme, different types of target files are stored in different storage spaces, the first electronic device can directly inquire the storage space corresponding to the type of the target file according to the first identifier of the target file and the type of the target file, obtain the target file from the storage space and send the target file to the second electronic device, the time for inquiring the storage space can be saved, and therefore the time delay of the second electronic device for receiving the connection request is reduced.
With reference to the first aspect, in some implementations of the first aspect, determining the type of the target file includes: and determining the type of the target file according to the first identifier of the target file.
Alternatively, the first electronic device may detect which application the user uses to request the target file to be transmitted, and determine the type of the target file based on the detected type of the application.
With reference to the first aspect and the foregoing implementation manners, in some implementation manners of the first aspect, determining a type of the target file according to the first identifier of the target file includes: determining the number of target files; and when the number of the target files is within a preset number range, determining the type of the target files according to the first identification of the target files.
With reference to the first aspect and the foregoing implementations, in some implementations of the first aspect, the first identifier of the target file is a uniform resource identifier of the target file.
With reference to the first aspect and the foregoing implementation manners, in some implementation manners of the first aspect, acquiring the target file from a storage space corresponding to the type of the target file according to the first identifier of the target file and the type of the target file, includes: determining a second identifier of the target file according to the uniform resource identifier of the target file; and acquiring the target file from the storage space corresponding to the type of the target file according to the uniform resource identifier of the target file, the type of the target file and the second identifier of the target file.
The second identifier may be an identification number of the target file.
With reference to the first aspect and the foregoing implementation manners, in some implementation manners of the first aspect, the sending the target file to the second electronic device includes: determining an order in which to send a plurality of target files to a second electronic device; and sending the plurality of target files to the second electronic equipment according to the sequence.
With reference to the first aspect and the foregoing implementation manners, in some implementation manners of the first aspect, determining an order of sending the plurality of target files to the second electronic device includes: and determining the sequence of transmitting the target files to the second electronic equipment according to the sequence of selecting the target files by the user.
In a second aspect, the present application provides an electronic device comprising: a display screen; one or more processors; one or more memories; a module in which a plurality of applications are installed; the memory stores one or more programs that, when executed by the processor, cause the electronic device to perform the steps of: when the first operation is detected, responding to the first operation, and determining a first identifier of a target file and the type of the target file, wherein the first operation is an operation of requesting to send the target file; acquiring a target file from a storage space corresponding to the type of the target file according to the first identifier of the target file and the type of the target file, wherein each file type corresponds to one storage space of the electronic equipment; and sending the target file to the second electronic equipment.
With reference to the second aspect, in some implementations of the second aspect, the one or more programs, when executed by the processor, cause the electronic device to perform the steps of: and determining the type of the target file according to the first identifier of the target file.
With reference to the second aspect and the implementations described above, in some implementations of the second aspect, the one or more programs, when executed by the processor, cause the electronic device to perform the steps of: determining the number of target files; and when the number of the target files is within a preset number range, determining the type of the target files according to the first identification of the target files.
With reference to the second aspect and the foregoing implementation manners, in some implementation manners of the second aspect, the first identifier of the target file is a uniform resource identifier of the target file.
With reference to the second aspect and the foregoing implementations, in some implementations of the second aspect, the one or more programs, when executed by the processor, cause the electronic device to perform the steps of: determining a second identifier of the target file according to the uniform resource identifier of the target file; and acquiring the target file from the storage space corresponding to the type of the target file according to the uniform resource identifier of the target file, the type of the target file and the second identifier of the target file.
With reference to the second aspect and the implementations described above, in some implementations of the second aspect, the one or more programs, when executed by the processor, cause the electronic device to perform the steps of: determining an order in which to send a plurality of target files to a second electronic device; and sending the plurality of target files to the second electronic equipment according to the sequence.
With reference to the second aspect and the foregoing implementations, in some implementations of the second aspect, the one or more programs, when executed by the processor, cause the electronic device to perform the steps of: and determining the sequence of transmitting the target files to the second electronic equipment according to the sequence of selecting the target files by the user.
In a third aspect, the present application provides an apparatus, which is included in an electronic device, and has a function of implementing the behavior of the electronic device in the foregoing aspects and possible implementations of the foregoing aspects. The functions may be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above-described functions. Such as a display module or unit, a detection module or unit, a processing module or unit, etc.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which includes computer instructions, and when the computer instructions are executed on an electronic device, the electronic device is caused to execute any one of the above possible file sending methods of the first aspect.
In a fifth aspect, the present application provides a computer program product, which when run on an electronic device, causes the electronic device to execute any one of the above-mentioned possible file sending methods of the first aspect.
According to the method for sending the file, when the first electronic device detects an operation of requesting to send the target file by a user, the first electronic device responds to the operation to determine the first identifier of the target file and the type of the target file, different types of target files are stored in different storage spaces, and the first electronic device can directly inquire the storage space corresponding to the type of the target file according to the first identifier of the target file and the type of the target file, acquire the target file from the storage space and send the target file to the second electronic device.
Drawings
Fig. 1 is a schematic diagram of an example of display interfaces of a sending end and a receiving end when sending a file according to an application example;
fig. 2 is a schematic structural diagram of an example of an electronic device according to an embodiment of the present disclosure;
FIG. 3 is a schematic flow chart of an exemplary method for sending a file according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a storage space of an electronic device according to an embodiment of the present disclosure;
FIG. 5 is a block diagram of an exemplary software architecture of an electronic device according to an embodiment of the present disclosure;
FIG. 6 is a schematic interaction flow diagram of an exemplary method for sending a file according to an embodiment of the present application;
FIG. 7 is a schematic interaction flow chart of another method for sending a file according to an embodiment of the present application;
FIG. 8 is a schematic flow chart diagram illustrating an exemplary method for retrieving a target document according to an embodiment of the present application;
fig. 9 is a schematic flowchart of another method for sending a file according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
As shown in fig. 1, a sending end stores a plurality of files, such as pictures, videos, photo albums, memos, contacts, sound recordings, files in a file manager, and the like, and a user can select a plurality of files, such as 500 pictures, to select to send or share to a receiving end, as shown in (a) of fig. 1, the sending end displays a first interface, a plurality of selected pictures 101 are displayed above the first interface, a usable sending mode 102, such as quick sharing, bluetooth, or email, is displayed below the first interface, and electronic devices capable of using quick sharing, such as a mobile phone 1, a mobile phone 2, a mobile phone 3, and a smart screen, can be displayed, and the files can be quickly transmitted wirelessly without connecting a network between the devices.
When a user selects to use a fast sharing file to send, the user may click on an electronic device that is displayed on a sending end and that can use the fast sharing, for example, the user clicks on "mobile phone 1", and then the sending end sends a connection request to the mobile phone 1, as shown in (b) in fig. 1, the mobile phone 1 serves as a receiving end, and after receiving the connection request from the sending end, a second interface is displayed, where the second interface includes a popup window 201 for prompting the user, and the popup window 201 may include identification information of the sending end, for example, an equipment model "sending end" of the sending end, and may also include information of a media type, a file number, a file size, and the like that are shared by the sending end, where the media type is "picture", the file number is "500", and the file size is "46.99 MB". The pop-up window 201 also includes a "accept" or "reject" control that the user can click "accept" or "reject" to trigger the electronic device to confirm approval or rejection of the receipt of the file.
After a user clicks the mobile phone 1 in the first interface at the sending end, the sending end needs to search for the selected picture from the storage space, obtain information such as the media type and the picture size of the selected picture, then send a connection request to the receiving end, and the receiving end pops up the popup window 201. As shown in table 1, when the number of the selected pictures is small, the time required for the electronic device to search for the selected pictures is small, the time delay from the user clicking "mobile phone 1" at the sending end to the pop-up of the popup window 201 at the receiving end is small, for example, 5.04 seconds are required for 100 pictures, when the number of the selected pictures is large, the time required for the sending end to search for the selected pictures is large, and the time delay from the user clicking "mobile phone 1" at the sending end to the pop-up of the popup window 201 at the receiving end is long, for example, 16.654 seconds are required for 500 pictures.
Table 1 time delay for pop-up of pop-up window 201 at receiving end
Figure DEST_PATH_IMAGE001
The method provided by the embodiment of the application does not need to search the whole storage space, but specifically searches the storage space corresponding to the type of the target file, so that the time for searching the storage space can be saved, and the time delay of receiving a connection request by the second electronic device can be reduced.
The method for sending the file provided by the embodiment of the application can be applied to electronic devices such as a mobile phone, a tablet personal computer, an intelligent watch, a vehicle-mounted device, an intelligent screen, a notebook computer, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, and a Personal Digital Assistant (PDA). The embodiment of the present application does not set any limit to the specific type of the electronic device.
For example, fig. 2 is a schematic structural diagram of an example of the electronic device 100 provided in this embodiment of the application, and in specific implementation, the electronic device 100 may be a first electronic device or a second electronic device in this embodiment of the application.
The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charge management module 140, a power management module 141, a battery 142, 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 194, a Subscriber Identity Module (SIM) card interface 195, and the like. 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, a bone conduction sensor 180M, and the like.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors.
The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (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 Subscriber Identity Module (SIM) interface, and/or a Universal Serial Bus (USB) interface, etc.
The I2C interface is a bi-directional synchronous serial bus that includes a serial data line (SDA) and a Serial Clock Line (SCL). In some embodiments, processor 110 may include multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces, respectively. For example: the processor 110 may be coupled to the touch sensor 180K via an I2C interface, such that the processor 110 and the touch sensor 180K communicate via an I2C bus interface to implement the touch functionality of the electronic device 100.
The I2S interface may be used for audio communication. In some embodiments, processor 110 may include multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 via an I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may communicate audio signals to the wireless communication module 160 via the I2S interface, enabling answering of calls via a bluetooth headset.
The PCM interface may also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled by a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to implement a function of answering a call through a bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus used for asynchronous communications. The bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 170 may transmit the audio signal to the wireless communication module 160 through a UART interface, so as to implement the function of playing music through a bluetooth headset.
MIPI interfaces may be used to connect processor 110 with peripheral devices such as display screen 194, camera 193, and the like. The MIPI interface includes a Camera Serial Interface (CSI), a Display Serial Interface (DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the capture functionality of electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the electronic device 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal and may also be configured as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, and the like.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transmit data between the electronic device 100 and a peripheral device. And the earphone can also be used for connecting an earphone and playing audio through the earphone. The interface may also be used to connect other electronic devices, such as AR devices and the like.
It should be understood that the connection relationship between the modules according to the embodiment of the present invention is only illustrative, and is not limited to the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The charging management module 140 is configured to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive a wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
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 display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be used to monitor parameters such as battery capacity, battery cycle count, battery state of health (leakage, impedance), etc. In some other embodiments, the power management module 141 may also be disposed in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be disposed in the same device.
The electronic device 100 implements display functions via the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, with N being a positive integer greater than 1.
The electronic device 100 may implement a shooting function through the ISP, the camera 193, the video codec, the GPU, the display 194, the application processor, and the like.
The ISP is used to process the data fed back by the camera 193. For example, when a photo is taken, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converting into an image visible to naked eyes. The ISP can also carry out algorithm optimization on noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The light sensing element converts the optical signal into an electrical signal, which is then passed to the ISP where it is converted into a digital image signal. And the ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV and other formats. In some embodiments, the electronic device 100 may include 1 or N cameras 193, N being an integer greater than 1.
The digital signal processor is used for processing digital signals, and can process digital image signals and other digital signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to perform fourier transform or the like on the frequency bin energy.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, and the like.
The NPU is a neural-network (NN) computing processor, which processes input information quickly by referring to a biological neural network structure, for example, by referring to a transfer mode between neurons of a human brain, and can also learn by itself continuously. Applications such as intelligent recognition of the electronic device 100 can be realized through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, and the like.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to extend the storage capability of the electronic device 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, video, etc. are saved in an external memory card.
The internal memory 121 may be used to store computer-executable program code, which includes instructions. The internal memory 121 may include a program storage area and a data storage area. The storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, and the like) required by at least one function, and the like. The storage data area may store data (such as audio data, phone book, etc.) created during use of the electronic device 100, and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
The electronic device 100 may implement audio functions via the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or some functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also called a "horn", is used to convert the audio electrical signal into an acoustic signal. The electronic apparatus 100 can listen to music through the speaker 170A or listen to a hands-free call.
The receiver 170B, also called "earpiece", is used to convert the electrical audio signal into an acoustic signal. When the electronic apparatus 100 receives a call or voice information, it can receive voice by placing the receiver 170B close to the ear of the person.
The microphone 170C, also referred to as a "microphone," is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can input a voice signal to the microphone 170C by speaking the user's mouth near the microphone 170C. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C to achieve a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may further include three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and perform directional recording.
The headphone interface 170D is used to connect a wired headphone. The headset interface 170D may be the USB interface 130, or may be a 3.5mm open mobile electronic device platform (OMTP) standard interface, a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 180A is used for sensing a pressure signal, and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A can be of a variety of types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a sensor comprising at least two parallel plates having an electrically conductive material. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the electronic apparatus 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic apparatus 100 may also calculate the touched position from the detection signal of the pressure sensor 180A. In some embodiments, the touch operations that are applied to the same touch position but different touch operation intensities may correspond to different operation instructions. For example: and when the touch operation with the touch operation intensity smaller than the first pressure threshold value acts on the short message application icon, executing an instruction for viewing the short message. And when the touch operation with the touch operation intensity larger than or equal to the first pressure threshold value acts on the short message application icon, executing an instruction of newly building the short message.
The gyro sensor 180B may be used to determine the motion attitude of the electronic device 100. In some embodiments, the angular velocity of electronic device 100 about three axes (i.e., the x, y, and z axes) may be determined by gyroscope sensor 180B. The gyro sensor 180B may be used for photographing anti-shake. For example, when the shutter is pressed, the gyro sensor 180B detects a shake angle of the electronic device 100, calculates a distance to be compensated for by the lens module according to the shake angle, and allows the lens to counteract the shake of the electronic device 100 through a reverse movement, thereby achieving anti-shake. The gyroscope sensor 180B may also be used for navigation, somatosensory gaming scenes.
The air pressure sensor 180C is used to measure air pressure. In some embodiments, electronic device 100 calculates altitude, aiding in positioning and navigation, from barometric pressure values measured by barometric pressure sensor 180C.
The magnetic sensor 180D includes a hall sensor. The electronic device 100 may detect the opening and closing of the flip holster using the magnetic sensor 180D. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 may detect the opening and closing of the flip according to the magnetic sensor 180D. And then according to the opening and closing state of the leather sheath or the opening and closing state of the flip cover, the automatic unlocking of the flip cover is set.
The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). The magnitude and direction of gravity can be detected when the electronic device 100 is stationary. The method can also be used for recognizing the posture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
A distance sensor 180F for measuring a distance. The electronic device 100 may measure the distance by infrared or laser. In some embodiments, taking a picture of a scene, electronic device 100 may utilize range sensor 180F to range for fast focus.
The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light to the outside through the light emitting diode. The electronic device 100 detects infrared reflected light from nearby objects using a photodiode. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 may determine that there are no objects near the electronic device 100. The electronic device 100 can utilize the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear for talking, so as to automatically turn off the screen to achieve the purpose of saving power. The proximity light sensor 180G may also be used in a holster mode, a pocket mode automatically unlocking and locking the screen.
The ambient light sensor 180L is used to sense the ambient light level. Electronic device 100 may adaptively adjust the brightness of display screen 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust the white balance when taking a picture. The ambient light sensor 180L may also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 can utilize the collected fingerprint characteristics to unlock the fingerprint, access the application lock, photograph the fingerprint, answer an incoming call with the fingerprint, and so on.
The temperature sensor 180J is used to detect temperature. In some embodiments, electronic device 100 implements a temperature processing strategy using the temperature detected by temperature sensor 180J. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 performs a reduction in performance of a processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection. In other embodiments, the electronic device 100 heats the battery 142 when the temperature is below another threshold to avoid abnormal shutdown of the electronic device 100 due to low temperature. In other embodiments, when the temperature is lower than a further threshold, the electronic device 100 performs boosting on the output voltage of the battery 142 to avoid abnormal shutdown due to low temperature.
The touch sensor 180K is also called a "touch device". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is used to detect a touch operation applied thereto or nearby. The touch sensor can communicate the detected touch operation to the application processor to determine the touch event type. Visual output associated with the touch operation may be provided through the display screen 194. In other embodiments, the touch sensor 180K may be disposed on a surface of the electronic device 100, different from the position of the display screen 194.
The bone conduction sensor 180M may acquire a vibration signal. In some embodiments, the bone conduction sensor 180M may acquire a vibration signal of the human vocal part vibrating the bone mass. The bone conduction sensor 180M may also contact the human pulse to receive the blood pressure pulsation signal. In some embodiments, the bone conduction sensor 180M may also be disposed in a headset, integrated into a bone conduction headset. The audio module 170 may analyze a voice signal based on the vibration signal of the bone mass vibrated by the sound part acquired by the bone conduction sensor 180M, so as to implement a voice function. The application processor can analyze heart rate information based on the blood pressure beating signal acquired by the bone conduction sensor 180M, so as to realize the heart rate detection function.
The keys 190 include a power-on key, a volume key, and the like. The keys 190 may be mechanical keys. Or may be touch keys. The electronic apparatus 100 may receive a key input, and generate a key signal input related to user setting and function control of the electronic apparatus 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration cues, as well as for touch vibration feedback. For example, touch operations applied to different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also respond to different vibration feedback effects for touch operations applied to different areas of the display screen 194. Different application scenes (such as time reminding, receiving information, alarm clock, game and the like) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
Indicator 192 may be an indicator light that may be used to indicate a state of charge, a change in charge, or a message, missed call, notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card can be brought into and out of contact with the electronic apparatus 100 by being inserted into the SIM card interface 195 or being pulled out of the SIM card interface 195. The electronic device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support a Nano SIM card, a Micro SIM card, a SIM card, etc. The same SIM card interface 195 can be inserted with multiple cards at the same time. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as communication and data communication. In some embodiments, the electronic device 100 employs esims, namely: an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
It is to be understood that the illustrated structure of the embodiment of the present invention does not specifically limit the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
A method for sending a file provided by an embodiment of the present application is described below, and fig. 3 shows an exemplary flowchart of a method 300 for sending a file, where the method 300 includes at least the following steps.
S301, when the first operation is detected, the first electronic device responds to the first operation, determines a first identifier of the target file and the type of the target file, and the first operation is an operation of requesting to send the target file.
The target file may be a file selected by the user in a gallery, video, album, memo, contact, recording, file manager. The type of the target file is a media type (mimeType) corresponding to the target file stored in the electronic device. The type of object file may be text, image, audio, video, binary data, etc. The first Identifier of the target file may be a Uniform Resource Identifier (uri) or an Identity number (Identity, id).
The user can determine the target file to be sent at any position, such as an application (app). For example, the user may select multiple photos and multiple videos in an album, or the user may select multiple audios in a recording app, or the user may also select photos, videos, and texts simultaneously in a file manager.
Taking the scenario shown in fig. 1 as an example, a user may select multiple photos in an album and then perform a first operation, where the first operation is an operation in which the user requests to send a target file, for example, the first operation may be an operation in which the user clicks "send", and after the first operation is performed, the first electronic device displays a first interface. Or, the first operation may be an operation in which the user clicks the control "mobile phone 1", and the user requests to send the photo to the mobile phone 1 in a quick sharing manner. The first electronic device corresponds to the aforementioned transmitting end.
In one implementation, after detecting the first operation, the first electronic device determines a first identifier of the target file and a type of the target file. In another implementation manner, after detecting the first operation, the first electronic device determines a first identifier of the target file, determines the number of the target files, and determines the type of the target file when the number of the target files is within a preset number range.
Taking the first identifier uri as an example, the album stores the uri of each photo, and if the user selects one photo, the album provides the uri of the selected photo. In one implementation, the first electronic device may determine the type of the target file according to the uri of the target file, for example, the first electronic device stores a first association table, the first association table stores a correspondence between the uri of the target file and the type of the target file, each uri corresponds to a type of the target file, and when the first electronic device determines the uri of the selected photo, the first electronic device searches the first association table according to the uri, and may determine that the type of the selected photo is an image.
In another implementation, the first electronic device may detect which application program the user uses to request to use the fast sharing function, and then determine the type of the target file based on the detected type of the application program, for example, if the user requests to use the fast sharing function in an audio player, the first electronic device may determine that the type of the target file is audio, and in a case that the type of the target file cannot be determined according to the type of the application program, may determine the type of the target file according to the uri.
S302, the first electronic device obtains the target file from the storage space corresponding to the type of the target file according to the first identifier of the target file and the type of the target file.
All files of the first electronic device are stored in the whole storage space of the first electronic device, and the whole storage space can be divided into a plurality of sub storage spaces, wherein each type of file corresponds to one sub storage space. After the type of the target file is determined, determining the sub-storage space corresponding to the type of the target file according to the corresponding relation between the type of the target file and the sub-storage space, and acquiring the target file from the corresponding sub-storage space according to the first identifier of the target file.
For example, all files of the first electronic device are stored in a media library (MediaProvider) of the first electronic device, as shown in fig. 4, the media library is an overall storage space, and according to the type of the stored files, the media library may be divided into a plurality of sub-storage spaces, such as an audio library, a video library, an image library, etc., which respectively store files of media types such as audio (audio), video (video), image (image), etc. Files stored in the media library can be provided for APPs such as a Music player (Music), a Video player (Video), a Gallery (Gallery) and the like, and functions of adding, deleting, modifying, viewing and the like to the files are provided. The type of media library may be the SQLite database.
For example, when the type of the target file is determined to be an image, the first electronic device directly searches an image library and acquires the target file from the image library. When the type of the target file is determined to be the video, the first electronic equipment directly searches the video library and obtains the target file from the video library. The content acquired by the first electronic device includes the target file, and may further include information such as a path, a size, and a name of the target file.
S303, the first electronic device sends the target file to the second electronic device.
For example, the first electronic device generates preview information according to the acquired information such as the type, size, number and the like of the target file, and sends a connection request to the second electronic device, where the connection request includes the preview information, the second electronic device generates the popup window 201 and pops up the popup window 201 after receiving the connection request, the user clicks the "accept" control when the popup window 201 of the second electronic device is popped up by the user, the second electronic device sends reply information for accepting the connection request to the first electronic device, and the first electronic device sends the target file to the second electronic device when receiving the reply information. The second electronic device corresponds to the receiving end.
When there are multiple object files, the first electronic device may determine an order of transmitting the multiple object files to the second electronic device. Then, the first electronic device may sequentially transmit the plurality of object files to the second electronic device based on the order of the plurality of object files. In one implementation, the first electronic device may use an order in which the plurality of target files are selected by the user as an order in which the plurality of target files are transmitted to the second electronic device. In another implementation manner, the first electronic device may set a transmission order corresponding to the type of the target file, for example, the transmission order of the images is prior to the transmission order of the videos, the order of transmitting the plurality of target files to the second electronic device is determined according to the type of the target files, and the files of the same type may be sorted according to the file size, the order in which the target files are selected by the user, or the like.
The method for sending a file according to the embodiment of the present application is described below by taking a fast sharing manner as an example and combining a software structure of the electronic device 100.
For example, fig. 5 is a software structure diagram of the electronic device 100 according to the embodiment of the present disclosure, where the electronic device 100 may be divided into an application, a sharing frame, a sharing module, a transmission module, and a media library.
The application is used to provide the uri of the target file. The sharing frame is used for establishing connection between the application program and the sharing module, receiving the uri of the target file provided by the application program, and transmitting the uri of the target file to the sharing module. The sharing module is used for transmitting the uri of the target file to the transmission module, and the transmission module may be referred to as a Nearby hereinafter. The Nearby is used for acquiring the target file from the media library and sending the target file to the receiving end in a short-distance communication mode based on the simple transmission protocol. The media library is used for storing the target file.
Wherein, the simple transmission protocol is called simple protocol for short. In the simple protocol, after the first electronic device confirms a trusted connection relation with the second electronic device, the first electronic device can start to package the target file, so that an interaction link of repeated confirmation handshake is omitted, and four layers of protocol stacks, namely a presentation layer, a session layer, a transmission layer and a network layer, are simplified into one layer during packaging, so that the packaging times and packaging information are reduced, and the file transmission speed is increased.
For example, an application is an album, a user shares a file in the album, fig. 6 shows an exemplary flowchart of a method 600 for sending the file according to an embodiment of the present application, and the method 600 includes the following steps.
S601, the album sends the uri of the target file to a sharing frame.
The method comprises the steps that a user opens an album, the album comprises photos and videos, the user selects multiple photos or multiple videos in the album, when the user wants to share the selected photos and videos with friends, a first operation is executed, for example, the user clicks a selection interface to send or share the photos and videos, after the first operation is detected by first electronic equipment, the album displays a sharing frame, and as shown in a first interface in fig. 1, the album sends uri of the selected photos and videos to the sharing frame.
S602, the sharing module obtains the uri of the target file from the sharing frame.
The sharing frame provides an interface, the uri of the target file is stored in the interface, when the user selects to share the selected photo and video with friends in a fast sharing mode, the sharing module obtains information in the sharing frame through a reflection mechanism (such as reflactCall), and the reflection mechanism is a method for detecting and obtaining the uri of the target file stored in the interface by the sharing module. In addition, the sharing box can also listen to the number of (Listener) photos and videos that are selected.
S603, the sharing module calls an interface of the transmission module to send the uri of the target file to the transmission module.
S604, the transmission module obtains the target file from the media library MediaProvider according to the uri of the target file.
And S605, the transmission module establishes connection with the transmission module of the receiving end, sends preview information to the receiving end, and sends the acquired target file to the receiving end after the receiving end agrees to receive the file.
It should be noted that, the transmission module at the sending end may also establish connection with the transmission module at the receiving end when determining the receiving end.
Specifically, as shown in fig. 7, in step S601, the album sends Uri to the sharing frame through method 1, where method 1 may be updata intentforitermshare, and the method generates a Uri table for Uri of the selected photo and video, encapsulates the Uri table in an object, and sends the Uri table to the sharing frame in the form of an object, for example, updata intentforitermshare identifies whether the number of the selected photo and video is greater than 500, when the number of the selected photo and video is not greater than 500, the method generates the Uri table for Uri of the selected photo and video, encapsulates the Uri table in an object Intent, and sends the Uri table to the sharing frame in the form of Intent when an Action of Intent is set to send multiple target files. Intent is used to describe the actions of a single operation, the data involved in the actions, and additional data. The sharing frame analyzes Intent to obtain a Uri table of the picture and the video. Wherein, Uri table includes a plurality of Uri, and a plurality of Uri can arrange according to the order that photo and video are selected by the user.
In step S602, the sharing module obtains the Uri table through Method 2, where Method 2 may be Method setup shareinforris (Method = Method _ SET _ SHARE _ INFO _ Uri).
In step S603, the sharing module executes the method 3, calls an interface of the transmission module, such as sendfile (Uri), and transmits the Uri table to the transmission module, where the method 3 may be dosetshareinfouri, and the sharing module further sends the device information of the receiving end to the transmission module.
In steps S604 and S605, the transmission module may define a Cursor (Cursor) through a sendfile (uri) interface, and obtain the selected photo and video from the MediaProvider by using the Cursor. The transmission module determines a receiving end designated by a user through a sendfile (uri) interface, sends preview information of a target file to the receiving end, and monitors whether a popup window of the receiving end pops up or not. The process of the transmission module acquiring the target file through the sendfile (uri) interface is at least as shown in steps S801 to S803 in fig. 8.
Fig. 8 is a flowchart illustrating a method 800 for a transport module to obtain a target file from a media library according to an embodiment of the present application, where the method 800 includes at least the following steps.
S801, the transmission module determines the id of the target file according to the uri of the target file.
And the transmission module determines the id corresponding to each uri in sequence according to each uri to obtain a plurality of ids. The transmission module determines the type corresponding to the target file according to each uri and the first association table, the type corresponding to the photo is an Image (Image), and the type corresponding to the Video is a Video (Video). According to the type of the target file, the image uri and the video uri can be divided into a plurality of uris, the image id and the video id are divided into a plurality of ids, the image uri is marked as imageuri, the video uri is marked as video uri, the image id is marked as imageids, and the video id is marked as video ids.
It should be noted that the type of the target file may also be determined by other modules and transmitted to the transmission module along with the Uri table.
S802, the transmission module obtains the target file from the media library.
For an image and a video, a first cursor imageCursor for searching the image and a second cursor videoCursor for searching the video are respectively defined.
The transmission module queries a sub-database of the image stored in a media provider of a media library through a first vernier imageclient: image, in an implementation manner, a transmission module can directly search through an id to determine a first id in images, the images cursor firstly locates a first image in an image library, the id of the first image is compared with the first id in the images, when the first image is the target file and the first id is the same, the first image is obtained, and when the first image is different from the first image, the images cursor sequentially jumps backwards until the image with the id same as the first id in the images is found. And traversing the images, and acquiring information such as path, size, name and the like of each photo with id belonging to the images from the image library.
In another implementation manner, the transmission module may search through the uri, and when the uri may be directly located in a specific image, the transmission module may directly acquire the target file. When the uri is located in a group of images, the transmission module determines the target file by comparing the id in the images with the id of the group of images.
The transmission module queries a sub-database storing videos in a media library MediaProvider through a second vernier videoclient: video, based on the same method as that for obtaining a photograph, obtains information such as a path, a size, a name, and the like of each video whose id belongs to videos from the video library.
It is worth mentioning that the embodiment of the present application can perform batch search according to the type of the file, that is, while the first cursor imageCursor searches the image library, the second cursor videoCursor can also search the video library, so as to save the search time. Because the number of the photos and the number of the videos are not necessarily the same, the transmission module may acquire all the selected photos first or all the selected videos first, and after acquiring all the selected photos and videos, the selected photos and videos are sorted according to the order selected by the user.
And S803, the transmission module constructs a target file collection to generate preview information.
After acquiring all the target files, the transmission module sequences the selected photos and videos according to the sequence selected by the user, constructs a target file collection filepathfileShaInfoIterm, and counts the size, type, quantity and other information of the target files to generate preview information.
It should be noted that the method shown in fig. 8 may further include the following optional steps before step S801.
Step S804, determine the total number of selected photos and videos.
That is, the total number (TotalNum) of the target files is determined first, and different method flows are executed according to the number of different target files. Fig. 9 shows an exemplary flowchart of a method 900 for sending a file according to an embodiment of the present application, where the method 900 includes the following steps.
S901, the transmission module judges whether the number of the target files is within a first preset range.
The transfer module may determine the number of target files based on the number of uri when the uri of the target file is received. When the number of the target files is within a first preset range, for example, the number of the selected photos and videos is greater than 500, step S902 and step S903 are performed.
When the number of target files is not within the first preset range, step S904 is performed.
S902, call sendMassiveFile () interface of transmission module.
And S903, the transmission module searches the media library through the image library to acquire the target file.
When the number of the target files is within the first preset range, the transmission module may directly determine the types and sources of APPs of the target files, for example, 500 photos from the gallery, at this time, the transmission module calls a sendmasivefile () interface to search the media gallery through the gallery, and the target files are obtained by simplifying information to be obtained.
S904, the transmission module judges whether the number of the target files is in a second preset range.
When the number of the target files is within the second preset range, for example, the number of the selected photos and videos is between 100 and 500, steps S905 to S909 are performed.
When the number of target files is not within the second preset range, for example, the number of selected photos and videos is less than 100, steps S910 to S913 are performed.
S905 calls the sendFile () interface of the transmission module.
S906, the transmission module identifies the type corresponding to each uri, determines the id corresponding to each uri according to the uri, and divides the uri and the id into imageuri/videouri and images/videos according to the type.
S907, the transmission module traverses imageUris and acquires information such as path, size and name of each photo with id belonging to images from the image library through the first cursor imageCursor.
And S908, the transmission module traverses the video Uris and acquires information such as path, size, name and the like of each video with id belonging to the video from the video library through the second cursor video Cursor.
S909 creates a target file collection in order, and generates preview information.
S910, judging whether the target file is a file at a specified position.
If yes, go to step S911 to step S914; if not, go to step S915.
And S911, calling a sendFile () interface of the transmission module.
And when the target file is a picture within 100 or a contact two-dimensional code within 100, or the target file is audio and video shared by APPs (application program) such as recording and file management, or the target file is audio and video shared by third-party applications, calling a sendFile () interface of the transmission module.
S912, the transmission module determines a plurality of ids according to the uri to obtain ids.
And S913, the transmission module acquires information such as the path, the size and the name of the file with id belonging to ids from the media library through the third Cursor Cursor and sorts the information according to the sequence.
At this time, the target file is directly acquired from the whole storage space without dividing the type of the target file.
S914, the transmission module constructs a target file collection to generate preview information.
S915, calling sendText () interface of the transmission module.
In other cases, such as a text file, the sendText () interface of the transfer module is called to obtain the target file.
Details which are not described in the embodiments of the present application refer to the foregoing embodiments, and are not described herein again for the sake of brevity.
To sum up, an embodiment of the present application provides a method for sending a file, where when detecting an operation of a user requesting to send a target file, a first electronic device determines a first identifier of the target file and a type of the target file in response to the operation, and different types of target files are stored in different storage spaces, and the first electronic device may directly query a storage space corresponding to the type of the target file according to the first identifier of the target file and the type of the target file, obtain the target file therefrom, and send the target file to a second electronic device.
In this embodiment, the electronic device may be divided into functional modules according to the method example, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated module can be implemented in the form of hardware. It should be noted that, the division of the modules in this embodiment is schematic, and is only one logic function division, and another division manner may be available in actual implementation.
It should be noted that all relevant contents of each step related to the above method embodiment may be referred to the functional description of the corresponding functional module, and are not described herein again.
The electronic device provided by the embodiment is used for executing the method for sending the file, so that the same effect as the implementation method can be achieved. In case an integrated unit is employed, the electronic device may comprise a processing module, a storage module and a communication module. The processing module may be configured to control and manage actions of the electronic device, and for example, may be configured to support the electronic device to execute steps executed by the processing unit. The memory module can be used to support the electronic device in executing stored program codes and data, etc. The communication module can be used for supporting the communication between the electronic equipment and other equipment.
The processing module may be a processor or a controller. Which may implement or execute the various illustrative logical blocks, modules, and circuits described in connection with the disclosure herein. A processor may also be a combination of computing functions, e.g., a combination of one or more microprocessors, a Digital Signal Processing (DSP) and a microprocessor, or the like. The storage module may be a memory. The communication module may specifically be a radio frequency circuit, a bluetooth chip, a Wi-Fi chip, or other devices that interact with other electronic devices.
In an embodiment, when the processing module is a processor and the storage module is a memory, the electronic device according to this embodiment may be a device having the structure shown in fig. 2.
The present embodiment also provides a computer-readable storage medium, in which computer instructions are stored, and when the computer instructions are run on an electronic device, the electronic device is caused to execute the above related method steps to implement the method for sending a file in the above embodiments.
The present embodiment also provides a computer program product, which when running on a computer, causes the computer to execute the above related steps to implement the method for sending a file in the above embodiments.
In addition, embodiments of the present application also provide an apparatus, which may be specifically a chip, a component or a module, and may include a processor and a memory connected to each other; the memory is used for storing computer execution instructions, and when the device runs, the processor can execute the computer execution instructions stored in the memory, so that the chip can execute the method for sending the file in the above-mentioned method embodiments.
The electronic device, the computer-readable storage medium, the computer program product, or the chip provided in this embodiment are all configured to execute the corresponding method provided above, so that the beneficial effects achieved by the electronic device, the computer-readable storage medium, the computer program product, or the chip may refer to the beneficial effects in the corresponding method provided above, and are not described herein again.
Through the description of the above embodiments, those skilled in the art will understand that, for convenience and simplicity of description, only the division of the above functional modules is used as an example, and in practical applications, the above function distribution may be completed by different functional modules as needed, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, a module or a unit may be divided into only one logic function, and may be implemented in other ways, for example, a plurality of units or components may be combined or integrated into another apparatus, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed to a plurality of different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partially contributed to by the prior art, or all or part of the technical solutions may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a variety of media that can store program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (11)

1. A method of transmitting a file, the method performed by a first electronic device, the method comprising:
when a first operation is detected, determining a first identifier of a target file and the number of the target files in response to the first operation, wherein the first operation is an operation of requesting to send the target file;
judging whether the number of the target files is within a first preset range or not;
when the number of the target files is within the first preset range, acquiring the target files through a first preset interface;
when the number of the target files is not in the first preset range, judging whether the number of the target files is in a second preset range or not;
when the number of the target files is within the second preset range, determining the type of the target files according to the first identification of the target files, and acquiring the target files from a storage space corresponding to the type of the target files according to the first identification of the target files and the type of the target files, wherein each file type corresponds to one storage space of the first electronic equipment, and the file types are media types;
when the number of the target files is not within the second preset range, judging whether the target files are files at specified positions or not;
when the target file is a file at a certain position, acquiring the target file according to a second identifier of the target file;
when the target file is not the file at the designated position, acquiring the target file through a second preset interface;
and sending the target file to a second electronic device.
2. The method of claim 1, wherein the first identifier of the target file is a uniform resource identifier of the target file.
3. The method according to claim 2, wherein the obtaining the target file from a storage space corresponding to the type of the target file according to the first identifier of the target file and the type of the target file comprises:
determining a second identifier of the target file according to the uniform resource identifier of the target file;
and acquiring the target file from a storage space corresponding to the type of the target file according to the uniform resource identifier of the target file, the type of the target file and the second identifier of the target file.
4. The method of claim 1, wherein the object file is multiple, and wherein the sending the object file to the second electronic device comprises:
determining an order in which to send the plurality of target files to the second electronic device;
and sending a plurality of target files to the second electronic equipment according to the sequence.
5. The method of claim 4, wherein the determining the order in which to send the plurality of target files to the second electronic device comprises:
and determining the sequence of transmitting the target files to the second electronic equipment according to the sequence of selecting the target files by the user.
6. An electronic device, comprising:
a display screen;
one or more processors;
one or more memories;
a module in which a plurality of applications are installed;
the memory stores one or more programs that, when executed by the processor, cause the electronic device to perform the steps of:
when a first operation is detected, responding to the first operation, and determining a first identifier of a target file and the number of the target file, wherein the first operation is an operation of requesting to send the target file;
judging whether the number of the target files is within a first preset range or not;
when the number of the target files is within the first preset range, acquiring the target files through a first preset interface;
when the number of the target files is not in the first preset range, judging whether the number of the target files is in a second preset range or not;
when the number of the target files is within the second preset range, determining the type of the target files according to the first identification of the target files, and acquiring the target files from a storage space corresponding to the type of the target files according to the first identification of the target files and the type of the target files, wherein each file type corresponds to one storage space of the electronic equipment, and the file types are media types;
when the number of the target files is not within the second preset range, judging whether the target files are files at specified positions or not;
when the target file is a file at a certain position, acquiring the target file according to a second identifier of the target file;
when the target file is not the file at the designated position, acquiring the target file through a second preset interface;
and sending the target file to a second electronic device.
7. The electronic device of claim 6, wherein the first identifier of the target file is a uniform resource identifier of the target file.
8. The electronic device of claim 7, wherein the one or more programs, when executed by the processor, cause the electronic device to perform the steps of:
determining a second identifier of the target file according to the uniform resource identifier of the target file;
and acquiring the target file from a storage space corresponding to the type of the target file according to the uniform resource identifier of the target file, the type of the target file and the second identifier of the target file.
9. The electronic device of claim 6, wherein the one or more programs, when executed by the processor, cause the electronic device to perform the steps of:
determining an order in which to send the plurality of target files to the second electronic device;
and sending a plurality of target files to the second electronic equipment according to the sequence.
10. The electronic device of claim 9, wherein the one or more programs, when executed by the processor, cause the electronic device to perform the steps of:
and determining the sequence of transmitting the target files to the second electronic equipment according to the sequence of selecting the target files by the user.
11. A computer-readable storage medium having stored thereon computer instructions which, when run on an electronic device, cause the electronic device to perform the method of any of claims 1-5.
CN202111635150.6A 2021-12-29 2021-12-29 Method for sending file, electronic device and readable storage medium Active CN113992663B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111635150.6A CN113992663B (en) 2021-12-29 2021-12-29 Method for sending file, electronic device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111635150.6A CN113992663B (en) 2021-12-29 2021-12-29 Method for sending file, electronic device and readable storage medium

Publications (2)

Publication Number Publication Date
CN113992663A CN113992663A (en) 2022-01-28
CN113992663B true CN113992663B (en) 2022-06-21

Family

ID=79734880

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111635150.6A Active CN113992663B (en) 2021-12-29 2021-12-29 Method for sending file, electronic device and readable storage medium

Country Status (1)

Country Link
CN (1) CN113992663B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116049095A (en) * 2022-05-05 2023-05-02 荣耀终端有限公司 Data migration method, electronic equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021037146A1 (en) * 2019-08-30 2021-03-04 华为技术有限公司 File sharing method and device for mobile terminal

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100131851A1 (en) * 2008-11-21 2010-05-27 Randall Reese Machine, Program Product, And Computer-Implemented Method For Randomized Slide Show Of Files
US10511887B2 (en) * 2010-08-30 2019-12-17 Saturn Licensing Llc Reception apparatus, reception method, transmission apparatus, transmission method, program, and broadcasting system
CN110798397B (en) * 2019-10-25 2022-11-04 维沃移动通信有限公司 File sending method and device and electronic equipment

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021037146A1 (en) * 2019-08-30 2021-03-04 华为技术有限公司 File sharing method and device for mobile terminal

Also Published As

Publication number Publication date
CN113992663A (en) 2022-01-28

Similar Documents

Publication Publication Date Title
CN114467297B (en) Video call display method and related device applied to electronic equipment
CN110347269B (en) Empty mouse mode realization method and related equipment
CN113542839B (en) Screen projection method of electronic equipment and electronic equipment
CN111666119A (en) UI component display method and electronic equipment
CN111628916B (en) Method for cooperation of intelligent sound box and electronic equipment
CN111742539B (en) Voice control command generation method and terminal
WO2022001619A1 (en) Screenshot method and electronic device
CN113254409A (en) File sharing method, system and related equipment
CN114615423A (en) Method and equipment for processing callback stream
CN112445762A (en) File sharing method and equipment for mobile terminal
CN111492678B (en) File transmission method and electronic equipment
CN113141483A (en) Screen sharing method based on video call and mobile device
CN113992663B (en) Method for sending file, electronic device and readable storage medium
CN112740148A (en) Method for inputting information into input box and electronic equipment
CN114756785A (en) Page display method and device, electronic equipment and readable storage medium
CN112532508B (en) Video communication method and video communication device
CN114995715B (en) Control method of floating ball and related device
CN111031492A (en) Call demand response method and device and electronic equipment
CN113380240B (en) Voice interaction method and electronic equipment
CN114661258A (en) Adaptive display method, electronic device, and storage medium
CN114915721A (en) Method for establishing connection and electronic equipment
CN114430441A (en) Incoming call prompting method, system, electronic equipment and storage medium
CN111339513A (en) Data sharing method and device
CN112929870A (en) Event subscription method and electronic equipment
CN114691066A (en) Application display method and electronic equipment

Legal Events

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

Effective date of registration: 20230904

Address after: 201306 building C, No. 888, Huanhu West 2nd Road, Lingang New Area, Pudong New Area, Shanghai

Patentee after: Shanghai Glory Smart Technology Development Co.,Ltd.

Address before: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040

Patentee before: Honor Device Co.,Ltd.