Method and apparatus for transmitting clipboard data
By transferring the target data from the copy app's storage space to the collaborative app's storage space at the sending end and generating a second location information, the problem of images failing to copy successfully when copying and pasting across devices is solved, thus improving the user experience.
Patent Information
- Application Number
- CN202110780907.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-09
- Publication Date
- 2026-01-09
- Estimated Expiration
- 2041-07-09
AI Technical Summary
When copying and pasting across devices, images cannot be successfully copied to the receiving device, affecting the user experience.
By transferring the target data from the storage space of the copying app to the storage space of the collaborative app at the sending end, generating second location information, and sending it to the receiving end, cross-device copy and paste of images and text formats can be achieved.
The issue of images failing to copy and paste successfully across devices has been resolved, improving the user experience.
Smart Images

Figure CN115599565B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the terminal field, and in particular to a method and device for sending clipboard data. BACKGROUND
[0002] A clipboard is a region in the memory of a computer for temporarily storing exchanged information. Different applications (APPs) can share information through the clipboard. For example, a user temporarily stores data of APP1 in the clipboard through a copy operation, and then sends the data of APP1 in the clipboard to APP2 through a paste operation, thereby completing information sharing.
[0003] For a cross-device copy-paste scenario, part of the content in the clipboard data of the sending end may not be acquired by the receiving end, for example, When a mobile phone sends clipboard data to a computer, the pictures in the clipboard data cannot be acquired by the computer, thereby affecting the user experience. The present application provides a method and device for sending clipboard data, which can solve the problem that pictures cannot be successfully copied in a cross-device copy-paste scenario, and improve the user experience. SUMMARY
[0004] The present application provides a method and device for sending clipboard data, which can solve the problem that pictures cannot be successfully copied in a cross-device copy-paste scenario, and improve the user experience.
[0005] In a first aspect, a method for sending clipboard data is provided, including: a first device receiving a copy operation, the copy operation being used to copy target data including a target picture and / or a target text, the target text being a text with a format; the first device acquiring first position information of the target data in response to the copy operation, the first position information being used to indicate a storage position of the target data in a storage space of a copy APP; the first device writing the target data into a storage space of a collaborative APP according to the first position information; and the first device sending clipboard data including second position information to a second device, the second position information being used to indicate a storage position of the target data in the storage space of the collaborative APP.
[0006] The picture and the text format belong to complex data, and the target data cannot be directly written into the clipboard when copying the target data containing the picture and the text format. The data written into the clipboard of the first device is actually the storage address (i.e., the first position information) of the target data in the storage space of the copying APP. When the second device receives the first position information, the first device is requested to obtain the target data based on the first position information. At this time, since the target data is not in the storage space of the collaborative APP, the collaborative APP cannot deliver the target data to the second device, thereby causing the cross-device copying to fail. The method provided in the application first transfers the target data from the storage space of the copying APP to the storage space of the collaborative APP to generate second position information. Then, the second address information is sent to the second device. In this way, when the second device requests the collaborative APP of the first device to obtain the target data according to the second address information, the collaborative APP of the first device can read out the target data from the storage space of the first device and send the target data to the second device, thereby completing the cross-device copying and pasting of complex data such as pictures and text formats.
[0007] Optionally, the first position information includes a uniform resource identifier (URI) of the target data, and the first device writes the target data into the storage space of the collaborative APP according to the first position information, including: the first device reads hyper text markup language (html) from the storage space of the copying APP according to the URI, and the html content includes the target data; and the first device writes the html content into the storage space of the collaborative APP.
[0008] Optionally, before the first device writes the html content into the storage space of the collaborative APP, the method further includes: the first device converts a first picture tag in the html content into a second picture tag, the first picture tag is a picture tag that cannot be recognized by the second device, the second picture tag is a picture tag that can be recognized by the second device, and the second picture tag is the second position information.
[0009] Some paste APPs cannot recognize the first picture tag, which may cause paste failure. The embodiment can solve the problem that the picture cannot be successfully copied during cross-device copying and pasting by converting the first picture tag that cannot be recognized by the second device into the second picture tag that can be recognized by the second device, thereby improving the user experience.
[0010] Optionally, the first picture tag is a v:imagedata tag, and the second picture tag is an img tag.
[0011] Optionally, the target data is the target picture, the first location information includes a first source (src) path of the target picture, and the first device writes the target data into the storage space of the collaborative APP according to the first location information, including: the first device generates a URI according to the first src path, the URI being used to indicate a storage location of the target picture in the storage space of the copy APP; the first device reads the target picture from the storage space of the copy APP according to the URI; and the first device writes the target picture into the storage space of the collaborative APP.
[0012] Some copy APPs write content into the clipboard that is not a URI, but html content containing a src path, and the content parser cannot parse the src path, so the collaborative APP can convert the src path into a URI, so that the target picture storage address can be parsed by the content parser, and the target picture can be obtained through the content provider, thereby solving the problem that the picture cannot be successfully copied when cross-device copying and pasting.
[0013] Optionally, the first src path is located in html content, and the method further includes: the first device replaces the first src path in the html content with a second src path, the second src path indicating a storage location of the target picture in the storage space of the collaborative APP, and the second src path being the second location information.
[0014] After generating the second src path, the first src path in the html content also needs to be replaced with the second src path, so that the target picture can be read from the storage location indicated by the second src path and sent to the second device when the second device requests to obtain the target picture.
[0015] Optionally, the method further includes: the first device receives a request message including the second location information from the second device, the request message being used to request to obtain the target data; the first device reads the target data from the storage space of the collaborative APP according to the second location information; and the first device sends the target data to the second device.
[0016] In a second aspect, an apparatus for sending clipboard data is provided, including units for performing any of the methods in the first aspect. The apparatus can be a terminal device or a chip in a terminal device. The apparatus can include an input unit and a processing unit.
[0017] When the apparatus is a terminal device, the processing unit can be a processor, and the input unit can be a communication interface; the terminal device can further include a memory for storing computer program code, which, when executed by the processor, causes the terminal device to perform any of the methods in the first aspect.
[0018] When the apparatus is a chip in a terminal device, the processing unit can be a processing unit inside the chip, and the input unit can be an output interface, a pin, or a circuit, etc.; the chip can further include a memory, which can be a memory inside the chip (for example, a register, a cache, etc.), or a memory outside the chip (for example, a read-only memory, a random access memory, etc.); the memory is used to store computer program code, which, when executed by the processor, causes the chip to perform any of the methods in the first aspect.
[0019] In a third aspect, a computer-readable storage medium is provided, which stores computer program code, which, when executed by an apparatus for sending clipboard data, causes the apparatus to perform any of the methods in the first aspect.
[0020] In a fourth aspect, a computer program product is provided, which includes computer program code, which, when executed by an apparatus for sending clipboard data, causes the apparatus to perform any of the methods in the first aspect. BRIEF DESCRIPTION OF DRAWINGS
[0021] Figure 1 FIG. 1 is a schematic diagram of a hardware system suitable for the apparatus of the present application;
[0022] Figure 2 FIG. 2 is a schematic diagram of a software system suitable for the apparatus of the present application;
[0023] Figure 3 FIG. 3 is a schematic diagram of a cross-device copy-paste scenario suitable for the present application;
[0024] Figure 4 FIG. 4 is a schematic diagram of a cross-device copy-paste process provided by the present application;
[0025] Figure 5 FIG. 5 is a schematic diagram of a cross-device copy-paste embodiment provided by the present application;
[0026] Figure 6 FIG. 6 is a schematic diagram of another cross-device copy-paste embodiment provided by the present application;
[0027] Figure 7 FIG. 7 is a schematic diagram of a single-device copy-paste process provided by the present application. DETAILED DESCRIPTION
[0028] The technical solutions in the embodiments of the present application will be described below with reference to the drawings.
[0029] Figure 1 A hardware structure of a device suitable for the present application is shown.
[0030] The device 100 can be a mobile phone, a smart screen, a tablet computer, a wearable electronic device, a vehicle-mounted electronic device, an augmented reality (AR) device, a virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a projector, etc. The specific type of the device 100 is not limited in the embodiments of the present application.
[0031] The device 100 can 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 antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a loudspeaker 170A, a receiver 170B, a microphone 170C, a headset interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, a barometric 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, etc.
[0032] It should be noted that, Figure 1 The structures shown do not constitute a specific limitation on the device 100. In other embodiments of the present application, the device 100 can include more or fewer components than those shown, or the device 100 can include a combination of some of the components shown, or the device 100 can include sub-components of some of the components shown. Figure 1 The structures shown do not constitute a specific limitation on the device 100. In other embodiments of the present application, the device 100 can include more or fewer components than those shown, or the device 100 can include a combination of some of the components shown, or the device 100 can include sub-components of some of the components shown. Figure 1 The structures shown do not constitute a specific limitation on the device 100. In other embodiments of the present application, the device 100 can include more or fewer components than those shown, or the device 100 can include a combination of some of the components shown, or the device 100 can include sub-components of some of the components shown. Figure 1 The structures shown do not constitute a specific limitation on the device 100. In other embodiments of the present application, the device 100 can include more or fewer components than those shown, or the device 100 can include a combination of some of the components shown, or the device 100 can include sub-components of some of the components shown.Figure 1 The illustrated components can be implemented in hardware, software, or a combination of both hardware and software.
[0033] The processor 110 can include one or more processing units. For example, the processor 110 can include at least one of the following processing units: 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, a neural-network processing unit (NPU). Among them, different processing units can be independent devices, or can be integrated devices.
[0034] The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching and executing instructions.
[0035] The memory in the processor 110 can also be configured to store instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can save instructions or data that have just been used or are repeatedly used by the processor 110. If the processor 110 needs to use the instructions or data again, it can directly call from the memory. Avoiding repeated access reduces the waiting time of the processor 110, thereby improving the efficiency of the system.
[0036] In some embodiments, the processor 110 can include one or more interfaces. For example, the processor 110 can include at least one of the following interfaces: 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, a USB interface.
[0037] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 can contain multiple sets of I2C bus. The processor 110 can 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 can be coupled to the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface, and the touch function of the device 100 is realized.
[0038] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can contain multiple sets of I2S bus. The processor 110 can be coupled to the audio module 170 through the I2S bus, and communication between the processor 110 and the audio module 170 is realized. In some embodiments, the audio module 170 can deliver audio signals to the wireless communication module 160 through the I2S interface, and the function of answering a phone through a Bluetooth earphone is realized.
[0039] The PCM interface can also be used for audio communication, which samples, quantizes and encodes analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled through the PCM interface. In some embodiments, the audio module 170 can also deliver audio signals to the wireless communication module 160 through the PCM interface, and the function of answering a phone through a Bluetooth earphone is realized. Both the I2S interface and the PCM interface can be used for audio communication.
[0040] The UART interface is a universal serial data bus, which is used for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is usually used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface, and the Bluetooth function is realized. In some embodiments, the audio module 170 can deliver audio signals to the wireless communication module 160 through the UART interface, and the function of playing music through a Bluetooth earphone is realized.
[0041] The MIPI interface can be used to connect the processor 110 and peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), and the like. In some embodiments, the processor 110 and the camera 193 communicate through the CSI interface to implement the photographing function of the device 100. The processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the device 100.
[0042] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal interface or as a data signal interface. In some embodiments, the GPIO interface can be used to connect the processor 110 and the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, and the sensor module 180. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, or a MIPI interface.
[0043] The USB interface 130 is an interface that complies with the USB standard specification, for example, it can be a Mini USB interface, a Micro USB interface, or a USB Type C interface. The USB interface 130 can be used to connect a charger to charge the device 100, to transmit data between the device 100 and a peripheral device, and to connect a headset to play audio through the headset. The USB interface 130 can also be used to connect other devices 100, such as AR devices.
[0044] Figure 1 The connection relationship between the modules shown is only illustrative and does not constitute a limitation on the connection relationship between the modules of the device 100. Alternatively, the modules of the device 100 can also use a combination of the above-mentioned various connection methods.
[0045] The charging management module 140 is used to receive power from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive the current of the wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive electromagnetic waves through the wireless charging coil of the device 100 (the current path is shown as a dashed line). The charging management module 140 charges the battery 142 while also providing power to the device 100 through the power management module 141.
[0046] The power management module 141 is configured to connect the battery 142 and the charging management module 140 to the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power 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 can also be configured to monitor parameters such as battery capacity, battery cycle count, and battery health status (e.g., leakage, impedance), and the like. Alternatively, the power management module 141 can be disposed in the processor 110, or the power management module 141 and the charging management module 140 can be disposed in the same device.
[0047] The wireless communication functions of the device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, and the like.
[0048] The antenna 1 and the antenna 2 are configured to transmit and receive electromagnetic wave signals. Each antenna in the device 100 can be configured to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example, the antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in combination with a tuning switch.
[0049] The mobile communication module 150 can provide a solution for wireless communication implemented on the device 100, such as at least one of the following solutions: a second generation (2 th generation (3G) mobile communication solution, a fourth generation (4 th generation (3G) mobile communication solution, a fourth generation (4 th generation (3G) mobile communication solution, a fourth generation (4 th generation (3G) mobile communication solution, a fourth generation (4 The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), and the like. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and then transmit the processed signals to the modem processor for demodulation. The mobile communication module 150 can also amplify the signals modulated by the modem processor, and the amplified signals can be converted into electromagnetic waves by the antenna 1 and radiated. In some embodiments, at least part of the functions of the mobile communication module 150 can be disposed in the processor 110. In some embodiments, at least part of the functions of the mobile communication module 150 and at least part of the modules of the processor 110 can be disposed in the same device.
[0050] The modem processor can include a modulator and a demodulator. The modulator is configured to modulate a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is configured to demodulate a received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal processed by the baseband processor is transmitted to the application processor. The application processor outputs a sound signal through an audio device (e.g., the speaker 170A, the microphone 170B), or displays an image or a video through the display screen 194. In some embodiments, the modem processor can be a separate device. In other embodiments, the modem processor can be independent of the processor 110, and can be disposed in the same device as the mobile communication module 150 or other functional modules.
[0051] Similar to the mobile communication module 150, the wireless communication module 160 can also provide a wireless communication solution applied to the device 100, such as at least one of the following solutions: wireless local area network (WLAN), bluetooth (BT), bluetooth low energy (BLE), ultra wide band (UWB), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology. The wireless communication module 160 can be one or more devices integrated with at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signal, and transmits the processed signal to the processor 110. The wireless communication module 160 can also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic wave radiation via the antenna 2.
[0052] In some embodiments, the antenna 1 of the device 100 is coupled with the mobile communication module 150, and the antenna 2 of the device 100 is coupled with the wireless communication module 160, so that the electronic device 100 can communicate with a network and other electronic devices through wireless communication technology. The wireless communication technology can include at least one of the following communication technologies: global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, IR technology. The GNSS can include at least one of the following positioning technologies: global positioning system (GPS), global navigation satellite system (GLONASS), beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS), satellite based augmentation systems (SBAS).
[0053] The device 100 can implement a display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs that execute program instructions to generate or change display information.
[0054] The display screen 194 can be used to display images or videos. The display screen 194 includes a display panel. The display panel can adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a mini light-emitting diode (Mini LED), a micro light-emitting diode (Micro LED), a micro OLED, or a quantum dot light emitting diode (QLED). In some embodiments, the device 100 can include 1 or N display screens 194, N being a positive integer greater than 1.
[0055] The device 100 can implement the photographing function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor, etc.
[0056] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, the 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 converts it into an image visible to the naked eye. The ISP can optimize the noise, brightness, and color of the image through algorithms, and can also optimize the exposure and color temperature of the shooting scene, etc. In some embodiments, the ISP can be arranged in the camera 193.
[0057] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into a standard red green blue (RGB), YUV, etc. format image signal. In some embodiments, the device 100 can include 1 or N cameras 193, N being a positive integer greater than 1.
[0058] The digital signal processor is used to process digital signals, which can process digital image signals, but also other digital signals. For example, when the device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.
[0059] The video codec is used to compress or decompress digital video. The device 100 can support one or more video codecs. In this way, the device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG 2, MPEG 3 and MPEG 4.
[0060] The NPU is a kind of processor that draws on the structure of biological neural network, such as drawing on the transmission mode between human brain neurons to process input information quickly, and can also constantly self-learn. Through the NPU, the device 100 can realize intelligent cognition and other functions, such as: image recognition, face recognition, voice recognition and text understanding.
[0061] The external memory interface 120 can be used to connect an external memory card, such as a secure digital (SD) card, to expand the storage capacity of the device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to realize data storage functions. For example, music, video and other files are saved in the external memory card.
[0062] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 can include a program storage area and a data storage area. The program storage area can store an operating system and application programs required by at least one function (such as a sound playing function and an image playing function). The data storage area can store data created during the use of the device 100 (such as audio data and a phone book). In addition, the internal memory 121 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, and a universal flash storage (UFS), etc. The processor 110 executes various processing methods of the device 100 by running instructions stored in the internal memory 121 and / or instructions stored in the memory provided in the processor.
[0063] The device 100 can realize 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, etc.
[0064] The audio module 170 is configured to convert digital audio information into an analog audio signal output, and can also be configured to convert an analog audio input into a digital audio signal. The audio module 170 can also be configured to encode and decode audio signals. In some embodiments, the audio module 170 or some of the functional modules of the audio module 170 can be disposed in the processor 110.
[0065] The speaker 170A, also known as a loudspeaker, is configured to convert an audio electrical signal into a sound signal. The device 100 can listen to music or engage in hands-free calls through the speaker 170A.
[0066] The receiver 170B, also known as an earpiece, is configured to convert an audio electrical signal into a sound signal. When a user uses the device 100 to receive a call or a voice message, the user can listen to the voice through the receiver 170B by placing the receiver 170B close to the ear.
[0067] The microphone 170C, also known as a microphone or a microphone, is configured to convert a sound signal into an electrical signal. When a user makes a call or sends a voice message, the user can input a sound signal into the microphone 170C by speaking close to the microphone 170C. The device 100 can be provided with at least one microphone 170C. In other embodiments, the device 100 can be provided with two microphones 170C to achieve a noise reduction function. In other embodiments, the device 100 can also be provided with three, four or more microphones 170C to achieve functions such as identifying the source of sound and directional recording. The processor 110 can process the electrical signal output by the microphone 170C, for example, the audio module 170 and the wireless communication module 160 can be coupled through a PCM interface, and the microphone 170C converts the environmental sound into an electrical signal (such as a PCM signal) and transmits it to the processor 110 through the PCM interface; the processor 110 analyzes the volume and frequency of the electrical signal to determine the volume and frequency of the environmental sound.
[0068] The earphone interface 170D is configured to connect a wired earphone. The earphone interface 170D can be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0069] The pressure sensor 180A is configured to sense a pressure signal and convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194. The pressure sensor 180A can be of various types, such as a resistive pressure sensor, an inductive pressure sensor, or a capacitive pressure sensor. The capacitive pressure sensor can include at least two parallel plates of conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes, and the device 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation is applied to the display screen 194, the device 100 detects the touch operation based on the pressure sensor 180A. The device 100 can also calculate the position of the touch based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, an instruction to view a short message is executed; when a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the short message application icon, an instruction to create a new short message is executed.
[0070] The gyroscope sensor 180B can be configured to determine the motion attitude of the device 100. In some embodiments, the angular velocity of the device 100 around three axes (i.e., the x-axis, the y-axis, and the z-axis) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake photography. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of shaking of the device 100, calculates the distance that needs to be compensated for the lens module based on the angle, and lets the lens offset the shaking of the device 100 by reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used in scenarios such as navigation and motion sensing games.
[0071] The barometric pressure sensor 180C is configured to measure air pressure. In some embodiments, the device 100 calculates the altitude based on the air pressure value measured by the barometric pressure sensor 180C, and assists in positioning and navigation.
[0072] The magnetic sensor 180D includes a Hall sensor. The device 100 can detect the opening and closing of a flip cover leather case using the magnetic sensor 180D. In some embodiments, when the device 100 is a flip phone, the device 100 can detect the opening and closing of the flip cover based on the magnetic sensor 180D. The device 100 can set features such as automatic unlocking of the flip cover based on the detected opening and closing state of the leather case or the opening and closing state of the flip cover.
[0073] The acceleration sensor 180E can detect the magnitude of acceleration of the device 100 in various directions (typically the x-axis, the y-axis, and the z-axis). When the device 100 is stationary, the acceleration sensor 180E can detect the magnitude and direction of gravity. The acceleration sensor 180E can also be used to identify the attitude of the device 100, as an input parameter for landscape / portrait screen switching and pedometer applications.
[0074] The distance sensor 180F is configured to measure distance. The device 100 can measure distance by infrared or laser. In some embodiments, for example, in a scene shooting, the device 100 can utilize the distance sensor 180F to measure distance for fast focusing.
[0075] The proximity light sensor 180G can include, for example, a light-emitting diode (LED) and a light detector, e.g., a photodiode. The LED can be an infrared LED. The device 100 emits infrared light outwardly through the LED. The device 100 detects infrared reflected light from nearby objects using the photodiode. When reflected light is detected, the device 100 can determine that there is an object nearby. When no reflected light is detected, the device 100 can determine that there is no object nearby. The device 100 can utilize the proximity light sensor 180G to detect whether a user is holding the device 100 close to the ear for a call, so as to automatically turn off the screen for power saving. The proximity light sensor 180G can also be used for automatic unlocking and automatic screen locking in a holster mode or a pocket mode.
[0076] The ambient light sensor 180L is configured to sense ambient light brightness. The device 100 can adaptively adjust the display screen 194 brightness according to the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust white balance when taking a picture. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the device 100 is in a pocket to prevent accidental touch.
[0077] The fingerprint sensor 180H is configured to collect a fingerprint. The device 100 can utilize the collected fingerprint characteristics to implement functions such as unlocking, accessing application lock, taking a picture, and answering an incoming call.
[0078] The temperature sensor 180J is configured to detect temperature. In some embodiments, the device 100 utilizes the temperature detected by the temperature sensor 180J to implement a temperature handling strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the device 100 implements a performance reduction of a processor located near the temperature sensor 180J, so as to reduce power consumption to implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the device 100 heats the battery 142 to avoid abnormal shutdown of the device 100 caused by low temperature. In other embodiments, when the temperature is lower than yet another threshold, the device 100 implements a voltage boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
[0079] Touch sensor 180K, also referred to as a touch device. Touch sensor 180K can be disposed on display screen 194, and touch sensor 180K and display screen 194 together form a touch screen, also referred to as a touch panel. Touch sensor 180K is configured to detect a touch operation applied thereto or in the vicinity thereof. Touch sensor 180K can transmit a detected touch operation to the application processor to determine a touch event type. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K can also be disposed on the surface of device 100 and disposed in a location different from display screen 194.
[0080] Bone conduction sensor 180M can acquire a vibration signal. In some embodiments, bone conduction sensor 180M can acquire a vibration signal of a human body sound vibration bone block. Bone conduction sensor 180M can also contact a human body pulse to receive a blood pressure pulsation signal. In some embodiments, bone conduction sensor 180M can also be disposed in an earphone to form a bone conduction earphone. Audio module 170 can analyze a voice signal based on the vibration signal of the sound vibration bone block acquired by bone conduction sensor 180M to implement a voice function. The application processor can analyze heart rate information based on the blood pressure pulsation signal acquired by bone conduction sensor 180M to implement a heart rate detection function.
[0081] Keys 190 include a power key and a volume key. Keys 190 can be mechanical keys or touch keys. Device 100 can receive a key input signal to implement a function related to the key input signal.
[0082] Motor 191 can generate a vibration. Motor 191 can be used for incoming call prompting or touch feedback. Motor 191 can generate different vibration feedback effects for touch operations applied to different application programs. For touch operations applied to different regions of display screen 194, motor 191 can also generate different vibration feedback effects. Different application scenarios (e.g., time reminders, received messages, alarms, and games) can correspond to different vibration feedback effects. The touch vibration feedback effects can also be customizable.
[0083] Indicator 192 can be an indicator light, which can be used to indicate a charging state and a power change, and can also be used to indicate a message, a missed call, and a notification.
[0084] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into the SIM card interface 195 to make contact with the device 100, or it can be removed from the SIM card interface 195 to detach from the device 100. The device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1. Multiple cards can be inserted into the same SIM card interface 195 simultaneously; the multiple cards can be of the same or different types. The SIM card interface 195 is also compatible with external memory cards. The device 100 interacts with the network through the SIM card to realize functions such as voice calls and data communication. In some embodiments, the device 100 uses an embedded SIM (eSIM) card, which can be embedded in the device 100 and cannot be separated from it.
[0085] The hardware system of device 100 has been described in detail above. The software system of device 100 is described below. The software system can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment takes a layered architecture as an example to exemplarily describe the software system of device 100.
[0086] like Figure 2 As shown, a layered architecture software system is divided into several layers, each with a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the software system can be divided into four layers, from top to bottom: the application layer, the application framework layer, the Android Runtime and system libraries, and the kernel layer.
[0087] The application layer can include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.
[0088] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer may include some predefined functions.
[0089] For example, the application framework layer includes a window manager, content provider, content resolver, view system, phone manager, resource manager, and notification manager.
[0090] The window manager is used to manage windowed applications. It can obtain the screen size, determine if a status bar is present, lock the screen, and capture the screen.
[0091] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, and phone books.
[0092] The content resolver is used to obtain data provided by the content provider and to modify, add, delete, or update the data.
[0093] The view system includes visual controls, such as controls that display text and controls that display pictures. The view system can be used to build an application. A display interface can be composed of one or more views, for example, a display interface that includes a short message notification icon can include a view that displays text and a view that displays a picture.
[0094] The phone manager is used to provide the communication function of the device 100, such as the management of the call state (on or off).
[0095] The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, and video files.
[0096] The notification manager enables the application to display notification information in the status bar, which can be used to convey a type of message that can automatically disappear after a short stay without user interaction. For example, the notification manager is used for download completion notification and message reminders. The notification manager can also manage notifications that appear in the form of a chart or a scroll bar text in the top status bar of the system, such as notifications of applications running in the background. The notification manager can also manage notifications that appear in the form of a dialog window on the screen, such as text information prompts in the status bar, alert sounds, electronic device vibrations, and indicator light flashes.
[0097] The Android runtime includes the core library and the virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
[0098] The core library contains two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android.
[0099] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the java files of the application layer and the application framework layer into binary files. The virtual machine is used to perform functions such as management of object life cycle, stack management, thread management, security and exception management, and garbage collection.
[0100] The system library can include a plurality of functional modules, such as a surface manager, media libraries, a three-dimensional graphics processing library (for example, an open graphics library for embedded systems (OpenGL ES) and a 2D graphics engine (for example, a skia graphics library (SGL)).
[0101] The surface manager is used to manage a display subsystem and provides fusion of 2D layers and 3D layers for a plurality of application programs.
[0102] The media libraries support playback and recording of a plurality of audio formats, playback and recording of a plurality of video formats, and static image files. The media libraries can support a plurality of audio and video coding formats, such as MPEG4, H.264, moving picture experts group audio layer III (MP3), advanced audio coding (AAC), adaptive multi-rate (AMR), joint photographic experts group (JPG), and portable network graphics (PNG).
[0103] The three-dimensional graphics processing library can be used to implement three-dimensional graphics drawing, image rendering, synthesis, and layer processing.
[0104] The two-dimensional graphics engine is a drawing engine for 2D drawing.
[0105] The kernel layer is a layer between hardware and software. The kernel layer can include a display driver, a camera driver, an audio driver, and a sensor driver, and the like.
[0106] The working flow of the software system and the hardware system of the device 100 will be described below in conjunction with a display interface scenario.
[0107] When the user performs a touch operation on the touch sensor 180K, a corresponding hardware interrupt is sent to the kernel layer, and the kernel layer processes the touch operation into a raw input event, which includes, for example, touch coordinates and a timestamp of the touch operation. The raw input event is stored in the kernel layer, and the application framework layer obtains the raw input event from the kernel layer, identifies the control corresponding to the raw input event, and notifies the application (APP) corresponding to the control. For example, the touch operation is a single-click operation, and the APP corresponding to the control is a gallery APP. After the gallery APP is woken up by the single-click operation, the gallery APP can call the display driver of the kernel layer through an API, and control the display screen 194 to display the interface of the gallery APP through the display driver.
[0108] The method for sending clipboard data provided in the present application is described below.
[0109] Figure 3 is a scenario applicable to the present application. The mobile phone 310 has a software and hardware system as shown in Figure 1 and Figure 2 , and the mobile phone 310 and the personal computer (PC) 320 are in a cooperative working mode. The mobile phone 310 and the PC 320 can work cooperatively through a wired connection or a wireless connection, and the specific working mode of the mobile phone 310 and the PC 320 is not limited in the present application.
[0110] For example, the mobile phone 310 and the PC 320 can establish a communication connection through a USB data line or through WLAN or Bluetooth, and the mobile phone 310 and the PC 320 can transmit cooperative working data through the communication connection when working cooperatively.
[0111] The user selects a picture and a line of text on the mobile phone 310, clicks “copy” in the pop-up dialog box, and then the user can operate the paste shortcut key (such as the combination of “Ctrl” and “V”) on the PC 320 to paste the picture and text on the PC 320. In some cases, the paste result shown in Figure 3 is obtained, in which the picture fails to be pasted on the PC 320, and the format (font, font size, etc.) of the text is also not preserved.
[0112] The reason for the situation shown in Figure 3 is that the clipboard data contains resource location information of the picture data and the text format data, and the PC 320 cannot obtain the picture data and the text format data according to the resource location information after obtaining the resource location information.
[0113] The application provides a method for sending clipboard data, which can solve the above problems, and the main process of the method is as shown in Figure 4
[0114] When the user clicks "copy" on the interface of the mobile phone 310, the clip data is transmitted from the copy APP to the clipboard, and the clip data contains text content and a uniform resource identifier (URI), wherein the URI is used to indicate the storage position of the picture data and the text format data.
[0115] The copy process mainly involves the following four objects: a handoff clipboard manager, clip data, a clip data item, and clip description.
[0116] The handoff clipboard manager is a sub-module of the APP (such as the Honor Share APP) and is used to manage the clipboard, for example, to listen to the data changes of the clipboard.
[0117] There is only one copy of the clip data in the clipboard, and when new clip data enters the clipboard, the clip data previously saved in the clipboard will disappear.
[0118] The clip data item is an object related to the copy content, and the clip data item can be text, URI or intent data. One clip data can contain one or more clip data items, wherein when the copy content is simple data (such as text content or intent data), the simple data can be directly put into the clip data as a clip data item; when the copy content is complex data such as pictures, text formats, etc., the complex data cannot be directly put into the clip data, but the resource position information (i.e., URI) of the complex data is put into the clip data as a clip data item.
[0119] The clip data description is clip metadata, which is used to describe the type of the clip data item.
[0120] The collaborative app installed on the 310 phone detects changes in clipboard data through the clipboard manager and retrieves the clipboard data. Subsequently, the collaborative app sends the URI from the clipboard data to the ContentResolver, which parses the storage location of the image and text data from the URI. The ContentResolver then sends this storage location (the parsed URI result) to the ContentProvider. The ContentProvider, based on this storage location, reads the image and text data (the resources indicated by the URI) from the database of the copying app and stores them in the collaborative app's database. (For brevity...) Figure 4 (The clipboard manager represents the database of the collaborative app).
[0121] When a user uses the paste shortcut on PC 320, optionally, the collaborative app on mobile phone 310 sends the text content and address information (indicating the storage address of image data and text format data in the collaborative app's database) to the collaborative app (PC Manager) on PC 320. Subsequently, the collaborative app on PC 320 writes the text content and address information to the clipboard, so that the paste app on PC 320 can retrieve this data from the clipboard. After retrieving the address information, the paste app on PC 320 sends a request message containing that address information to the collaborative app on mobile phone 310, requesting the image data and text format data. The collaborative app on mobile phone 310 then sends the image data and text format data to the paste app on PC 320 based on the address information, thus completing the pasting of the image and text format data.
[0122] As another optional implementation, when the user operates the paste shortcut on the PC 320, the collaboration APP of the mobile phone 310 can directly send the text content, image data, and text format data to the collaboration APP of the PC 320; subsequently, the collaboration APP of the PC 320 writes the text content, image data, and text format data to the clipboard of the PC 320 so that the paste APP of the PC 320 can read them.
[0123] The following sections describe implementations of this method in different application scenarios.
[0124] Example 1.
[0125] Office software is installed on the 310 mobile phone. (An example of copying an app), the user follows... Figure 3 The operation shown The user copies images and text. After receiving the copy command, the mobile phone 310 follows the instructions. Figure 5 The process shown will proceed to the next step.
[0126] S501, The text content and URI (indicating the storage location of picture data and text format data) are written into the clipboard, wherein the text content does not contain format information (such as font information, font size information and color information) of the text.
[0127] The own data can be shared out through a ContentProvider interface, and the ContentProvider interface is responsible for organizing data (for example, storing data, reading data and exposing data in the form of a database) and providing the data to other APPs.
[0128] The clipboard obtains the text and URI from the ContentProvider interface.
[0129] S502, the clipboard manager listens to the data change of the clipboard, and obtains the clipboard data (i.e. the text and URI) when the data of the clipboard changes.
[0130] For example, the clipboard manager can listen to the clipboard in the following ways.
[0131]
[0132] After obtaining the clipboard data, the clipboard manager can perform the following steps to obtain the clipboard data.
[0133] S503, the clipboard manager calls the ContentResolver interface to obtain the AssetFileDescriptor object corresponding to the URI.
[0134] For example, the ContentResolver first obtains the URI, and then obtains the AssetFileDescriptor object according to the URI and the following method.
[0135] ContentResolver resolver = mContext.getContentResolver();
[0136] AssetFileDescriptor assetFileDescriptor = resolver.openAssetFileDescriptor (uri, "r").
[0137] S504, the AssetFileDescriptor object calls the getFileDescriptor interface to obtain the FileDescriptor object.
[0138] S505, the clipboard manager creates a FileReader or FileInputStream based on the FileDescriptor object, and reads Hypertext Markup Language (HTML) content through the FileReader or FileInputStream.
[0139] The HTML content contains text formatting information and image URLs. An example of an image URL is shown below.
[0140] <v:imagedata
[0141] src=" / storage / emulated / 0 / Android / data / cn.wps.moffice_eng / .cache / KingsoftOffice / .temp / 28029
[0142] / 6a1e8d7c-473d-488a-b6f2-06fef0dc3b77.png"embosscolor="white"
[0143] o:title="">.
[0144] The above image URL belongs to the v:imagedata tag and cannot be displayed on a PC 320. Therefore, the image address needs to be converted to a different format. One possible implementation is for PC 320 to convert the image address; another possible implementation is for mobile phone 310 to convert the image address. The conversion methods are the same in both implementations, and the steps for mobile phone 310 to convert the image address are shown in S506.
[0145] S506, the clipboard manager replaces all v:imagedata tags in the HTML content with img tags.
[0146] Here is an example of the img tag.
[0147] <img
[0148] src=" / storage / emulated / 0 / Android / data / cn.wps.moffice_eng / .cache / KingsoftOffice / .temp / 28029
[0149] / 6a1e8d7c-473d-488a-b6f2-06fef0dc3b77.png" emboss color="white" o:title="" / >.
[0150] After generating the html content containing the img tag, the clipboard manager sends the html content containing the img tag in S507 and S508.
[0151] In S507, the clipboard manager sends the html content containing the img tag to the communication module of the mobile phone 310.
[0152] In S508, the mobile phone 310 sends the html content containing the img tag to the PC 320 through the communication module.
[0153] For example, the communication module of the mobile phone 310 packages the html content containing the img tag to generate a data packet conforming to the WLAN standard, and then the data packet is processed by the physical layer of the mobile phone 310 and transmitted in the form of radio waves through the antenna, wherein the physical layer can perform channel coding, interleaving, scrambling, modulation, layer mapping and precoding on the data packet, and the specific manner of sending the data packet by the mobile phone 310 is not limited in the embodiments of the present application.
[0154] In S509, the PC 320 receives the html content containing the img tag from the mobile phone 310 through the communication module.
[0155] For example, the physical layer of the PC 320 performs channel estimation, demodulation, decoding and other processing on the received wireless signal to generate a data packet, and then the communication module of the PC 320 parses the data packet to obtain the html content containing the img tag.
[0156] In S510, the PC manager (an example of a collaborative APP) of the PC 320 obtains the html content containing the img tag from the communication module and sends the html content to the clipboard.
[0157] Since the img tag contained in the html content can be recognized by the paste APP (such as the PC manager) on the PC 320, the PC manager can obtain the image file corresponding to the img tag from the cache of the PC 320. )identify, when the user in PC 320 paste operation, PC 320 can get the picture data from the img tag source (source, src) path; in addition, PC 320 also get the text format data from the html content src path. Subsequently, PC 320 sends the request message containing the picture data and text format data src path to mobile phone 310, requests to obtain the picture data and text format data.
[0158] Mobile phone 310 receives the request message, according to the src path in the request message to find the picture data and text format data in the memory location (i.e., the picture data and text format data in the collaborative APP database storage location), the picture data and text format data in the memory to PC 320, thus completing the picture and text format paste.
[0159] Example two.
[0160] Mobile phone 310 is installed with office software (Copy APP an example), the user according to the operation shown in Figure 3 The picture in Copy operation, mobile phone 310 receives the user's copy operation, according to the flow shown in Figure 5 The subsequent steps are executed.
[0161] S601, The html content is written into the clipboard, which contains the src path of the picture shown in Figure 3 , wherein the storage location indicated by the src path is the location of the picture data in Database.
[0162] S602, the clipboard manager listens to the data change of the clipboard, and gets the clipboard data (i.e., html content) when the data of the clipboard changes.
[0163] For example, the clipboard manager can listen to the clipboard in the following way.
[0164]
[0165] In the html content written into the clipboard, the storage location of the picture data indicated by the src path is located in Database, can not be directly read by the clipboard manager, therefore, the clipboard manager clipboard manager can execute the following steps to save the picture data in the database of the collaborative APP, so as to facilitate the clipboard manager to read.
[0166] S603, the clipboard manager traverses the src path of the picture in the html content and generates the URI corresponding to the src path.
[0167] For example, the picture tag with src path in the html content is <img type="image png"src="content: com.microsoft.office.officemobile.word data user 0 com.microsoft.office.officehub files temp clip.png"> The URI generated based on the src path in the picture tag can be content: / / com.microsoft.office.officemobile.word / data / user / 0 / com.microsoft.office.officehub / files / temp / clip.png.
[0168] S604, the clipboard manager calls the ContentResolver interface to obtain the AssetFileDescriptor object.
[0169] For example, the ContentResolver first obtains the URI in S603, and then obtains the AssetFileDescriptor object according to the URI and the following method.
[0170] ContentResolver resolver = mContext.getContentResolver();
[0171] AssetFileDescriptor assetFileDescriptor = resolver.openAssetFileDescriptor(uri, "r").
[0172] S605, the AssetFileDescriptor object calls the getFileDescriptor interface to obtain the FileDescriptor object.
[0173] S606, the clipboard manager creates FileReader or FileInputStream according to the FileDescriptor object, and reads the picture content through FileReader or FileInputStream to generate the local picture.
[0174] S607, the clipboard manager replaces all the old src paths in the html content with the new src path (the storage location of the picture data in the database of the collaborative APP) to generate the updated html content.
[0175] For example, the picture tag with the old src path is:
[0176] <img type="image / png"
[0177] src="content: / / com.microsoft.office.officemobile.word / data / user / 0 / com.microsoft.office.officehub / files / temp / clip.png">
[0178] The new src path is:
[0179] src=" / storage / emulated / 0 / HwClipboard / clip.png";
[0180] The image tag containing the new src path is:
[0181] <img type="image / png"
[0182] src=" / storage / emulated / 0 / HwClipboard / clip.png">.
[0183] After generating the updated html content, the clipboard manager performs S608 and S609 to send the updated html content.
[0184] S608, the clipboard manager sends the updated html content to the communication module of the mobile phone 310.
[0185] S609, the mobile phone 310 sends the updated html content to the PC 320 through the communication module.
[0186] For example, the communication module of the mobile phone 310 packages the updated html content to generate a data packet conforming to the WLAN standard; then, the data packet is processed by the physical layer of the mobile phone 310 and transmitted in the form of radio waves through the antenna, wherein the physical layer can perform channel coding, interleaving, scrambling, modulation, layer mapping, and precoding on the data packet, and the specific manner of sending the data packet by the mobile phone 310 is not limited in the embodiments of the present application.
[0187] S610, the PC 320 receives the updated html content from the mobile phone 310 through the communication module.
[0188] For example, the physical layer of the PC 320 performs channel estimation, demodulation, decoding, and other processing on the received wireless signal to generate a data packet; then, the communication module of the PC 320 parses the data packet to obtain the updated html content.
[0189] S611, the PC housekeeper of the PC 320 acquires the updated html content from the communication module, and sends the html content to the clipboard.
[0190] When the user performs the paste operation on the PC 320, the PC 320 acquires the new src path from the updated html content, and sends a request message containing the new src path to the mobile phone 310, requesting to acquire the picture data.
[0191] After the mobile phone 310 receives the request message, the mobile phone 310 finds the location of the picture data in the memory (i.e., the storage location of the picture data in the database of the collaborative APP) according to the new src path in the request message, and sends the picture data and the text format data in the memory to the PC 320, thereby completing the paste of the picture.
[0192] The above-mentioned embodiment one and embodiment two are both cross-device copy and paste scenarios, and the present application further provides a method for performing copy and paste on different APPs of one device.
[0193] As shown in Figure 7 , when the user clicks "copy" on the interface of the copy APP (e.g., ) of the mobile phone 310, the clip data is transmitted from the copy APP to the clipboard, and the clip data contains text content and a URI, wherein the URI is used to indicate the storage location of the picture data and the text format data.
[0194] The copy process mainly involves the following four objects: the clipboard manager (HandoffClipboardManager), the clip data (ClipData), the clip data item (ClipData.Item), and the clip data description (ClipDescription). The four objects are the same as the corresponding objects in Figure 4 , and will not be described here.
[0195] After the collaborative APP installed on the mobile phone 310 listens to the change of the data of the clipboard through the clipboard manager, the collaborative APP acquires the clip data from the clipboard; then, the collaborative APP sends the URI in the clip data to the content resolver (ContentResolver), and the content resolver parses the storage location of the picture data and the text format data from the URI; the content resolver sends the storage location (the parsing result of the URI) to the content provider (ContentProvider), and the content provider reads the picture data and the text format data (the resources indicated by the URI) from the database of the copy APP based on the storage location, and stores the picture data and the text format data in the database of the collaborative APP (for the sake of simplicity, Figure 7 , the database of the collaborative APP is represented by the clipboard manager).
[0196] When the user operates the paste shortcut key on the mobile phone 310, the collaborative APP of the mobile phone 310 sends the text content and the address information (indicating the storage address of the picture data and the text format data in the database of the collaborative APP) to the paste APP (such as ) optionally; after the paste APP acquires the address information, the paste APP sends a request message containing the address information to the collaborative APP to request to acquire the picture data and the text format data; the collaborative APP sends the picture data and the text format data to the paste APP according to the address information, thereby completing the paste of the picture and the text format.
[0197] As another optional implementation, when the user operates the paste shortcut key on the mobile phone 310, the collaborative APP of the mobile phone 310 can directly send the text content, the picture data and the text format data to the paste APP.
[0198] The application further provides a computer program product, which, when executed by a processor, implements the method described in any of the method embodiments of the application.
[0199] The computer program product can be stored in a memory and finally converted into an executable object file capable of being executed by the processor through a processing process such as preprocessing, compiling, assembling and linking.
[0200] The application further provides a computer readable storage medium, which stores a computer program, and the computer program, when executed by a computer, implements the method described in any of the method embodiments of the application. The computer program can be a high-level language program or an executable target program.
[0201] The computer-readable storage medium can be a volatile memory or a nonvolatile memory, or can include both volatile memory and nonvolatile memory. The nonvolatile memory can be a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM) used as an external cache. By way of example, and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous dynamic RAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and direct Rambus RAM (DR RAM). The computer-readable storage medium can also be other media capable of storing data, such as a hard disk, a floppy disk, or a tape.
[0202] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and apparatuses and the generated technical effects can refer to the corresponding processes and technical effects in the foregoing method embodiments, and will not be described here.
[0203] In several embodiments provided in the present application, the disclosed system, device and method can be implemented in other ways. For example, some features of the above-described method embodiments can be omitted or not performed. The above-described device embodiments are merely illustrative, and the division of units is merely a logical function division. In actual implementation, another division manner can be used, and multiple units or components can be combined or integrated into another system. In addition, the coupling between units or the coupling between components can be direct coupling or indirect coupling, and the above-mentioned coupling includes electrical, mechanical or other forms of connection.
[0204] It should be understood that, in various embodiments of the present application, the size of the serial number of each process does not mean the execution order, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0205] In addition, the terms "system" and "network" are often used interchangeably herein. The term "and / or", herein merely describes an associated relationship between associated objects, which means that there can be three relationships, for example, A and / or B, which can represent three cases: A exists alone, A and B exist together, and B exists alone. In addition, the character " / " generally represents an "or" relationship between the front and back associated objects.
[0206] In summary, the above only describes the preferred embodiments of the technical scheme of the present application, and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method of sending clipboard data, characterized by, The method comprises the following steps: A first device receives a copy operation, the copy operation is used to copy target data including a target picture and / or a target text, the target text is a text with a format, the first device is a mobile phone, an operating system of the first device is an Android system, a copy APP and a collaboration APP are installed on the first device; The first device acquires first position information of the target data in response to the copy operation, and writes the first position information into a clipboard, the first position information is used to indicate a storage position of the target data in a storage space of the copy APP; The first device acquires the first position information from the clipboard after the data of the clipboard changes through listening of the collaboration APP, and sends the first position information to a content parser; The first device parses the storage position of the target data in the storage space of the copy APP from the first position information through the content parser, and sends the storage position to a content provider; The first device reads out the target data according to the storage position of the target data in the storage space of the copy APP through the content provider, and writes the target data into a storage space of the collaboration APP; The first device sends clipboard data including second position information to a second device, the second position information is used to indicate the storage position of the target data in the storage space of the collaboration APP, the second device is a personal computer, an operating system of the second device is a Windows system, and a paste APP is installed on the second device; The second device receives a paste operation performed by a user; The second device sends a request message to the first device in response to the paste operation, the request message carries the second position information; The first device finds the target data in the storage space of the collaboration APP according to the second position information in response to the request message, and sends the target data to the second device; The second device receives the target data through the paste APP.
2. The method of claim 1, wherein, The first position information includes a uniform resource identifier (URI) of the target data, The first device reads hypertext markup language (HTML) content from the storage space of the copy APP according to the URI through the content provider, the HTML content includes the target data; The first device writes the HTML content into the storage space of the collaboration APP. Before the first device writes the HTML content into the storage space of the collaboration APP, the method further comprises the following steps:
3. The method of claim 2, wherein, The first device converts a first picture tag in the HTML content into a second picture tag, the first picture tag is a picture tag that cannot be recognized by the second device, the second picture tag is a picture tag that can be recognized by the second device, and the second picture tag is the second position information. 4. The method of claim 3, wherein, The first picture tag is a v:imagedata tag, and the second picture tag is an img tag.
5. The method of claim 1, wherein, The target data is the target picture, and the first position information includes a first src path of the target picture, The first device reads the target data according to a storage position of the target data in the storage space of the copy APP and writes the target data into the storage space of the collaborative APP through the content provider, and the method comprises the steps that: The first device generates a URI according to the first src path, and the URI is used to indicate the storage position of the target picture in the storage space of the copy APP; The first device reads the target picture from the storage space of the copy APP according to the URI; The first device writes the target picture into the storage space of the collaborative APP.
6. The method of claim 5, wherein, The first src path is located in html content, and the method further comprises: The first device replaces the first src path in the html content with a second src path, the second src path indicates the storage position of the target picture in the storage space of the collaborative APP, and the second src path is the second position information.
7. An apparatus for transmitting clipboard data, the apparatus comprising: The apparatus comprises a processor and a memory, the processor and the memory are coupled, the memory is used to store a computer program, and when the computer program is executed by the processor, the apparatus executes the method in any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and when the computer program is executed by the processor, the processor executes the method in any one of claims 1 to 7.
9. A chip, characterized by The apparatus comprises a processor, and when the processor executes instructions, the processor executes the method in any one of claims 1 to 6.
Citation Information
Patent Citations
Method, device and system for synchronizing clipboards between terminal equipment
CN104216787A
Method, device and system for image copy / paste
CN105160018A