Data transmission method and terminal equipment
By establishing a direct data transmission channel between the first and third devices, the problems of low data transmission efficiency and cumbersome operation in the existing technology are solved, realizing efficient cross-device data transmission and improving user experience.
Patent Information
- Application Number
- CN202511431023.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-02
- Publication Date
- 2026-02-13
AI Technical Summary
In existing technologies, users cannot directly transfer data from their mobile phones to tablets. They must first drag and drop the data to their computer using a mouse and then to their tablet, resulting in low data transfer efficiency, cumbersome operation, and a poor user experience.
By establishing a direct data transmission channel between the first and third devices, data can be transmitted through this channel, avoiding the need for intermediate devices and improving data transmission efficiency.
It enables users to efficiently drag and drop data directly from the first device to the third device, reducing operation steps and improving user experience.
Smart Images

Figure CN121531064A_ABST
Abstract
Description
[0001] This application is a divisional application of Chinese patent application No. 202211071845.0, filed on September 2, 2022, entitled "Data Transmission Method, Terminal Equipment, Storage Medium and Program Product". Technical Field
[0002] This application relates to the field of terminal technology, and in particular to a data transmission method and terminal device. Background Technology
[0003] To meet users' work and study needs, multiple terminal devices can support keyboard and mouse crossover to achieve cross-device collaboration. For example, after a user's computer, mobile phone, and tablet are connected, they can share the computer's mouse and keyboard. In other words, the user can control the mobile phone and tablet using the computer's mouse and keyboard. For instance, the user can drag and drop files, text, and images from the mobile phone or tablet to the computer using the mouse, or vice versa.
[0004] In this scenario, if a user wants to transfer data from their phone to a tablet, they must first drag and drop the data from the phone to the computer using a mouse, and then drag and drop the data from the computer to the tablet using the mouse. They cannot directly transfer data from the phone to the tablet, which reduces data transfer efficiency and is cumbersome, thus negatively impacting the user experience. Summary of the Invention
[0005] This application provides a data transmission method that can improve data transmission efficiency, reduce user operations, and enhance user experience.
[0006] In a first aspect, a data transmission method is provided, comprising: a first device detecting a first operation by a user, the first operation being used to move an identifier of target data from a third device to the first device via a second device using a mouse, wherein the third device and the second device support keyboard and mouse traversal, and the second device and the first device support keyboard and mouse traversal; the first device responding to the first operation by sending a request for target data to the third device via the second device; and the first device receiving target data from the third device.
[0007] The first operation involves moving the identifier of target data from a third device, through a second device, to a first device using a mouse. Moving it to the first device can be understood as dragging it to the first device; that is, the user controls the mouse to drag the identifier of the target data from the second device to the first device. The identifier of the target data can be an image, document, text, music, video, etc., and this application embodiment does not limit this.
[0008] The target data is data that the user drags and drops. It can be any data that supports dragging and dropping, and can also be called dragged data. This application embodiment does not limit this.
[0009] The first device is the one that receives the target data; it can also be understood as the device that drags the target data in. The second device can be understood as an intermediate device, which neither drags data in nor out. The third device is the one that sends the target data; it can also be understood as the device that drags the target data out.
[0010] Optionally, the first and third devices can be running the Android operating system and can be referred to as Android devices. The second device can be running the Windows operating system.
[0011] For example, in Figure 2 In the example shown, the first device can be a tablet 103, the second device can be a computer 101, and the third device can be a mobile phone 102. Figure 5 In the example shown, the first device can be a mobile phone 102, the second device can be a computer 101, and the third device can be a tablet 103.
[0012] The first device requests the target data by sending a message to the first device, which can then be sent by the second device to the third device.
[0013] The data transmission method provided in this application can support users to drag and drop data from a first device through a second device to a third device, which can improve data transmission efficiency, reduce user operations, and improve user experience.
[0014] In conjunction with the first aspect, in some implementations of the first aspect, the first device receiving target data from the third device includes: the first device establishing a data transmission channel with the third device; and the first device receiving the target data from the third device through the data transmission channel.
[0015] The data transmission method provided in this application establishes a direct data transmission channel between the first and third devices. Data transmission via this channel eliminates the need for a second device to relay data, resulting in higher efficiency and further improvements in data transmission efficiency.
[0016] In conjunction with the first aspect, in some implementations of the first aspect, after the first device receives target data from the third device through the data transmission channel, the method further includes: the first device dismantling the data transmission channel.
[0017] The data transmission method provided in this application allows the first device to dismantle the data transmission channel after data transmission and re-establish it when data transmission is needed, which helps save power consumption of the first device and avoids resource waste.
[0018] In conjunction with the first aspect, in some implementations of the first aspect, the first device receiving target data from the third device includes: the first device receiving target data from the third device through the second device.
[0019] The first device receives target data from the third device through the second device. In other words, the first device can obtain target data from the second device, and the target data of the second device is sent by the third device.
[0020] The data transmission method provided in this application allows the first device to obtain target data from the second device, and the target data of the second device is sent by the third device. This method can reuse existing data transmission methods with minimal modifications, which is beneficial for application and promotion.
[0021] In conjunction with the first aspect, in some implementations of the first aspect, before sending the information requesting target data to the third device via the second device, the method further includes: the first device determining whether the area into which the mouse drags the identifier of the target data is a preset area; sending the information requesting target data to the third device via the second device includes: if the area into which the identifier of the target data is dragged is a preset area, the first device sends the information requesting target data to the third device via the second device.
[0022] The preset area is a region provided by the first device that allows data to be dragged in. It may vary depending on the application, and this application embodiment does not limit it.
[0023] If the target data identifier is dragged into the preset area, the drag operation is complete, and the first device can send a request for the target data to the third device via the second device. If the target data identifier is dragged into the preset area, the drag operation fails, and the first device does not need to request the target data.
[0024] The data transmission method provided in this application, when the area where the target data is dragged into is a preset area, requests the target data from a third device through a second device, which is beneficial for displaying the dragged data in the preset area.
[0025] In conjunction with the first aspect, in some implementations of the first aspect, the target data includes at least one of the following: text data, image data, document data, email data, compressed file data, music data, or video data.
[0026] In a second aspect, a data transmission method is provided, comprising: a third device detecting a first operation by a user, the first operation being used to move an identifier of target data from the third device to the first device via a second device using a mouse, the third device and the second device supporting keyboard and mouse traversal, and the second device and the first device supporting keyboard and mouse traversal; the third device responding to the first operation by receiving information requesting target data from the first device via the second device; and the third device sending the target data to the first device.
[0027] In conjunction with the second aspect, in some implementations of the second aspect, the third device sends target data to the first device, including: the third device establishing a data transmission channel with the first device; and the third device sending the target data to the first device through the data transmission channel.
[0028] In conjunction with the second aspect, in some implementations of the second aspect, after the third device sends the target data to the first device through the data transmission channel, the method further includes: the third device dismantling the data transmission channel.
[0029] In conjunction with the second aspect, in some implementations of the second aspect, the third device sends target data to the first device, including: the third device sends target data to the first device through the second device.
[0030] In conjunction with the second aspect, in some implementations of the second aspect, before receiving information about the target data requested from the first device via the second device, the method further includes: the third device responding to the first operation to obtain a universal resource identifier (URI) that identifies the target data; and the third device determining the data corresponding to the URI as the target data.
[0031] When the third device detects the first operation, it can first obtain the URI of the target data identifier in order to determine the target data based on the URI.
[0032] In conjunction with the second aspect, in some implementations of the second aspect, the target data includes at least one of the following: text data, image data, document data, email data, compressed file data, music data, or video data.
[0033] Thirdly, a data transmission method is provided, comprising: a second device detecting a first operation by a user, the first operation being used to move an identifier of target data from a third device through the second device to the first device using a mouse, the third device and the second device supporting keyboard and mouse traversal, and the second device and the first device supporting keyboard and mouse traversal; the second device responding to the first operation receiving information requesting target data from the first device; and the second device sending information requesting target data to the third device.
[0034] The data transmission method provided in this application, in which the second device receives information requesting target data and then sends the information requesting target data to the third device, facilitates communication between the first device and the third device.
[0035] In conjunction with the third aspect, in some implementations of the third aspect, before the second device sends the information requesting target data to the third device, the method further includes: the second device responding to the first operation to determine the movement state as moving from the third device to the first device; the second device sending the information requesting target data to the third device includes: the second device sending the information requesting target data to the third device based on the information requesting target data and the movement state.
[0036] The movement state can also be called the drag state, and this application embodiment does not limit it. The movement state can be drag completed, dragged to the first device, dragged to the second device, or dragged to the third device, etc.
[0037] If the move status is "drag to first device," it means the target data is being moved from the third device to the first device. If the move status is "drag to third device," it means the target data is being moved from the first device to the third device. If the move status is "drag to second device," it means the target data is being moved from either the first or third device to the second device. If the move status is "drag complete," it means the move operation is complete.
[0038] The second device can send information requesting target data to the third device based on the information and movement status of the requested target data to enable communication between the first device and the third device.
[0039] In conjunction with the third aspect, in some implementations of the third aspect, the method further includes: the second device receiving target data from the third device; the second device sending the target data to the first device.
[0040] In conjunction with the third aspect, in some implementations of the third aspect, the target data includes at least one of the following: text data, image data, document data, email data, compressed file data, music data, or video data.
[0041] Fourthly, a terminal device is provided, including a processing module and a transceiver module. The processing module is configured to: detect a first user operation, wherein the first operation involves moving the identifier of target data from a third device to a third device via a second device using a mouse, wherein the third device and the second device support keyboard and mouse traversal; the transceiver module is configured to: respond to the first operation by sending a request for target data from the second device to the third device; and receive target data from the third device.
[0042] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the above-mentioned processing module is further used to: establish a data transmission channel with the third device; the above-mentioned transceiver module is further used to: receive target data from the third device through the data transmission channel.
[0043] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the above processing module is also used to: dismantle the data transmission channel.
[0044] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the aforementioned transceiver module is also used to: receive target data from the third device via the second device.
[0045] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the above-mentioned processing module is further used to: determine whether the area into which the mouse drags the identifier of the target data is a preset area; the above-mentioned transceiver module is further used to: if the area into which the identifier of the target data is dragged is a preset area, send information requesting the target data to the third device through the second device.
[0046] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the target data includes at least one of the following: text data, image data, document data, email data, compressed file data, music data, or video data.
[0047] Fifthly, a terminal device is provided, comprising: a processing module and a transceiver module. The processing module is configured to: detect a first user operation, the first operation being to move an identifier of target data from a second device to a first device using a mouse, supporting keyboard and mouse traversal between the second device and the first device; the transceiver module is configured to: respond to the first operation, receive information requesting target data from the first device via the second device; and send the target data to the first device.
[0048] In conjunction with the fifth aspect, in some implementations of the fifth aspect, the above-mentioned processing module is further used to: establish a data transmission channel with the first device; the above-mentioned transceiver module is further used to: send target data to the first device through the data transmission channel.
[0049] In conjunction with the fifth aspect, in some implementations of the fifth aspect, the above processing module is also used to: dismantle the data transmission channel.
[0050] In conjunction with the fifth aspect, in some implementations of the fifth aspect, the aforementioned transceiver module is also used to: send target data to the first device via the second device.
[0051] In conjunction with the fifth aspect, in some implementations of the fifth aspect, the above processing module is further configured to: in response to the first operation, obtain the generic resource identifier (URI) of the target data identifier; and determine the data corresponding to the URI as the target data.
[0052] In conjunction with the fifth aspect, in some implementations of the fifth aspect, the target data includes at least one of the following: text data, image data, document data, email data, compressed file data, music data, or video data.
[0053] Sixthly, a terminal device is provided, comprising: a processing module and a transceiver module. The processing module is configured to: detect a first user operation, the first operation being to move an identifier of target data from a third device to the first device via a mouse, the third device supporting keyboard and mouse traversal, and the first device supporting keyboard and mouse traversal; the transceiver module is configured to: respond to the first operation by receiving information requesting target data from the first device; and sending the information requesting target data to the third device.
[0054] In conjunction with the sixth aspect, in some implementations of the sixth aspect, the above-mentioned processing module is further configured to: in response to the first operation, determine the movement state as moving from the third device to the first device; the above-mentioned transceiver module is further configured to: send the information requesting the target data to the third device based on the information requesting the target data and the movement state.
[0055] In conjunction with the sixth aspect, in some implementations of the sixth aspect, the aforementioned transceiver module is also used to: receive target data from a third device; and send target data to a first device.
[0056] In conjunction with the sixth aspect, in some implementations of the sixth aspect, the target data includes at least one of the following: text data, image data, document data, email data, compressed file data, music data, or video data.
[0057] In a seventh aspect, this application provides a terminal device including a processor coupled to a memory, which can be used to execute instructions in the memory to implement the method in any possible implementation of any of the above aspects. Optionally, the device further includes a memory. Optionally, the device further includes a transceiver, with the processor coupled to the transceiver.
[0058] Eighthly, this application provides a processor, including: an input circuit, an output circuit, and a processing circuit. The processing circuit is used to receive signals through the input circuit and transmit signals through the output circuit, causing the processor to execute the method in any possible implementation of any of the above aspects.
[0059] In specific implementation, the processor can be a chip, the input circuit can be input pins, the output circuit can be output pins, and the processing circuit can be transistors, gate circuits, flip-flops, and various logic circuits. The input signal received by the input circuit can be received and input by, for example, but not limited to, a receiver, and the signal output by the output circuit can be, for example, but not limited to, output to and transmitted by a transmitter. Furthermore, the input circuit and the output circuit can be the same circuit, which is used as both the input circuit and the output circuit at different times. This application does not limit the specific implementation of the processor and various circuits.
[0060] Ninthly, this application provides a processing apparatus, including a processor and a memory. The processor is used to read instructions stored in the memory and can receive signals via a receiver and transmit signals via a transmitter to execute the method in any possible implementation of any of the above aspects.
[0061] Optionally, there may be one or more processors and one or more memories.
[0062] Alternatively, the memory can be integrated with the processor, or the memory can be set up separately from the processor.
[0063] In the specific implementation process, the memory can be a non-transitory memory, such as read-only memory (ROM), which can be integrated with the processor on the same chip or set on different chips. This application does not limit the type of memory or the way the memory and processor are set.
[0064] It should be understood that the relevant data interaction process, such as sending indication information, can be the process of outputting indication information from the processor, and receiving capability information can be the process of the processor receiving input capability information. Specifically, the processed output data can be output to the transmitter, and the input data received by the processor can come from the receiver. Here, the transmitter and receiver can be collectively referred to as a transceiver.
[0065] The processing device in the ninth aspect above can be a chip. The processor can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, integrated circuit, etc. When implemented in software, the processor can be a general-purpose processor that reads software code stored in a memory. The memory can be integrated into the processor or located outside the processor and exist independently.
[0066] In a tenth aspect, this application provides a computer-readable storage medium storing a computer program (also referred to as code or instructions) that, when run on a computer, causes the computer to perform the method in any of the possible implementations of any of the above aspects.
[0067] In one aspect, this application provides a computer program product comprising: a computer program (also referred to as code or instructions) that, when run, causes a computer to perform a method in any of the possible implementations of any of the above aspects. Attached Figure Description
[0068] Figure 1 This is a diagram illustrating how to transfer photos across devices;
[0069] Figure 2 This is a schematic diagram illustrating a cross-device photo transfer method provided in an embodiment of this application;
[0070] Figure 3 This is a schematic diagram illustrating another method of transmitting photos across devices, as provided in an embodiment of this application.
[0071] Figure 4 This is a schematic diagram illustrating another method of cross-device photo transmission provided in an embodiment of this application;
[0072] Figure 5 This is a schematic diagram illustrating a failure to transfer files across devices, as provided in an embodiment of this application.
[0073] Figure 6 This is a software structure block diagram of a PC provided in an embodiment of this application;
[0074] Figure 7 This is a software structure block diagram of an Android device provided in an embodiment of this application;
[0075] Figure 8 This is a schematic flowchart illustrating a method for connecting a keyboard and mouse according to an embodiment of this application;
[0076] Figure 9 This is a schematic flowchart of a mouse-crossing detection method provided in an embodiment of this application;
[0077] Figure 10 This is a schematic diagram illustrating the establishment of a screen coordinate system provided in an embodiment of this application;
[0078] Figure 11 This is a schematic flowchart illustrating a data transmission method provided in an embodiment of this application;
[0079] Figure 12 This is a schematic flowchart illustrating a method for acquiring data provided in an embodiment of this application;
[0080] Figure 13 This is a schematic flowchart illustrating another method for acquiring data provided in an embodiment of this application;
[0081] Figure 14 This is a schematic diagram of a terminal device provided in an embodiment of this application;
[0082] Figure 15 This is a schematic diagram of another terminal device provided in an embodiment of this application. Detailed Implementation
[0083] The technical solutions in this application will now be described with reference to the accompanying drawings.
[0084] To facilitate a clear description of the technical solutions in the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" are not necessarily different.
[0085] It should be noted that, in this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.
[0086] Furthermore, "at least one" refers to one or more, while "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, and c can mean: a, or b, or c, or a and b, or a and c, or b and c, or a, b, and c, where a, b, and c can be single or multiple.
[0087] To meet users' work and study needs, multiple terminal devices can support keyboard and mouse crossover to achieve cross-device collaboration. For example, after a user's computer, mobile phone, and tablet are connected, they can share the computer's mouse and keyboard. In other words, the user can control the mobile phone and tablet using the computer's mouse and keyboard. For instance, the user can drag and drop files, text, and images from the mobile phone or tablet to the computer using the mouse, or vice versa.
[0088] For example, Figure 1 This diagram illustrates a method for transferring photos across devices. (For example...) Figure 1 As shown in Figure 'a', the communication system includes a computer 101, a mobile phone 102, and a tablet 103. The operating system of the computer 101 is Windows, while the operating systems of the mobile phone 102 and tablet 103 are Android. Keyboard and mouse communication is possible between the computer 101 and the mobile phone 102, and also between the computer 101 and the tablet 103; that is, the computer 101, mobile phone 102, and tablet 103 can share a mouse and keyboard. In this configuration, the computer 101 can be referred to as the source device or transmitter, and the mobile phone 102 and tablet 103 can be referred to as the peer devices or receivers, but this embodiment is not limited to these definitions.
[0089] After the keyboard and mouse of computer 101 are transferred to mobile phone 102 or tablet 103, cross-screen collaboration can be achieved. That is to say, users can use the mouse to click, drag or double-click on mobile phone 102 or tablet 103, and use the keyboard to input information on mobile phone 102 or tablet 103.
[0090] After the keyboard and mouse of computer 101 are transferred to mobile phone 102 or tablet 103, cross-device transfer of files, photos, and music is also possible. In other words, users can drag and drop files, photos, and music from mobile phone 102 or tablet 103 to computer 101, and vice versa. It is understood that the embodiments of this application are not limited to files, photos, and music.
[0091] like Figure 1 As shown in 'a', when a user takes a screenshot of the main interface of mobile phone 102, mobile phone 102 responds to the user's screenshot operation, takes the screenshot, and displays the image in the lower left corner of the interface. The user can drag the image to the desktop of computer 101 using the mouse. When computer 101 detects the user's dragging of the image to the main interface of computer 101, it responds to this operation and can display... Figure 1 b in the example. Figure 1As shown in b, computer 101 can display a drag-and-drop icon for the image, and correspondingly, the image in the lower right corner of the phone 102's interface disappears. When computer 101 detects that the user has canceled the drag-and-drop operation on the image, in response to this operation, it can save the image to the file manager and display the file manager's interface, i.e., display... Figure 1 c in the example. Figure 1 As shown in c, computer 101 saves the image to the file manager, names the image as 20220405_1 by default, displays the image format as png, shows the image size as 302.08 kilobytes (kb), and displays the time the image was saved as "just now".
[0092] In the aforementioned communication system, if a user wants to transfer a screenshot from mobile phone 102 to tablet 103, they can only drag and drop the data from mobile phone 102 to computer 101 using the mouse, and then drag and drop the data from computer 101 to tablet 103 using the mouse. The data from the mobile phone cannot be directly transferred to the tablet, which reduces data transfer efficiency and is cumbersome and detrimental to user experience.
[0093] In view of this, the embodiments of this application provide a data transmission method that can improve data transmission efficiency, reduce user operations, and enhance user experience. That is, users can directly drag and drop data from mobile phone 102 to tablet 103 via computer 101 using a mouse, or directly drag and drop data from tablet 103 to mobile phone 102 via computer 101, without first dragging the data to computer 101 and then to tablet 103.
[0094] To better understand the embodiments of this application, the scenarios in which the embodiments of this application are used will be introduced first.
[0095] Figure 2 This diagram illustrates a method for transferring photos across devices. (For example...) Figure 2 As shown, the user drags and drops an image from phone 102 onto the main screen of tablet 103. Figure 2 As shown in Figure 'a', when a user takes a screenshot of the main interface of phone 102, phone 102 responds to the user's screenshot operation, takes the screenshot, and displays the image in the lower left corner of the interface. The user can drag the image from computer 101 to the main interface of tablet 103 using the mouse. When computer 101 detects the user's dragging of the image to its main interface, it responds to this operation by displaying... Figure 2 b in the example. Figure 2 As shown in b, computer 101 can display the drag icon A, and correspondingly, the image in the lower right corner of the phone 102's interface disappears. Computer 101 detects the user's drag-and-drop operation to tablet 103, and in response to this operation, it can display... Figure 2 c in the example. Figure 2As shown in 'c', Tablet 103 can display the drag icon 'B'. When Tablet 103 detects that the user has canceled the drag operation on the image, in response to this operation, it can save the image to the file manager and display the file manager interface, i.e., display... Figure 2 The d in the example. Figure 2 As shown in d, the tablet 103 saves the image to the file manager and names the image as 20220405_1 by default. The image is displayed in PNG format and its size is 302.08 kilobytes (kb).
[0096] It should be noted that the file manager supports any type of data, so the Tablet 103 can be used to save images, music, and files that are dragged and dropped onto the main interface.
[0097] Figure 3 This illustrates another method for transferring photos across devices. (For example...) Figure 3 As shown, the user drags and drops an image from phone 102 onto the chat interface of tablet 103. Figure 3 As shown in Figure 'a', when a user takes a screenshot of the main interface of mobile phone 102, mobile phone 102 responds to the user's screenshot operation, takes the screenshot, and displays the image in the lower left corner of the interface. The user can drag the image from computer 101 to the chat interface of tablet 103 using the mouse. When computer 101 detects the user's dragging of the image to its main interface, it responds to this operation by displaying... Figure 3 b in the example. Figure 3 As shown in b, computer 101 can display the drag icon A, and correspondingly, the image in the lower right corner of the phone 102's interface disappears. Computer 101 detects the user's drag-and-drop operation to tablet 103, and in response to this operation, it can display... Figure 3 c in the example. Figure 3 As shown in 'c', Tablet 103 can display the drag icon B in the chat interface. When Tablet 103 detects that the user has canceled the drag operation on the image, in response to this operation, it can display the image in the chat interface, i.e., display... Figure 3 The d in the example. Figure 3 As shown in d, Tablet 103 is displayed in the chat interface.
[0098] It should be noted that chat applications can support data types such as images and files, and allow data transfer.
[0099] Figure 4 This illustrates yet another method of transferring photos across devices. (For example...) Figure 4 As shown, the user drags and drops a picture from phone 102 into the gallery application on tablet 103. Figure 4As shown in Figure 'a', when a user takes a screenshot of the main interface of phone 102, phone 102 responds to the user's screenshot operation, takes the screenshot, and displays the image in the lower left corner of the interface. The user can drag and drop the image from computer 101 to the gallery application on tablet 103 using the mouse. When computer 101 detects the user's dragging and dropping of the image to its main interface, it responds to this operation by displaying... Figure 4 b in the example. Figure 4 As shown in b, computer 101 can display the drag icon A, and correspondingly, the image in the lower right corner of the phone 102's interface disappears. Computer 101 detects the user's drag-and-drop operation to tablet 103, and in response to this operation, it can display... Figure 4 c in the example. Figure 4 As shown in 'c', Tablet 103 can display a drag icon B in the Gallery app. When Tablet 103 detects that the user has canceled the drag operation on the image, in response to this operation, it can save the image to the Gallery app, i.e., display the drag icon B. Figure 4 The d in the example. Figure 4 As shown in d, Tablet 103 can display the image in the Gallery app.
[0100] It should be noted that the gallery app only supports the transfer of image data and does not allow the transfer of other data.
[0101] If a user drags and drops a file into the Gallery app, and the Gallery app does not support the file format, the Gallery app will not save the dragged data, and the drag will fail.
[0102] For example, Figure 5 This diagram illustrates a scenario where cross-device file transfer fails. For example... Figure 5 As shown in Figure 'a', Tablet 103 displays a file manager interface, which includes two documents: one is the meeting agenda, and the other is the meeting content. Computer 101 displays the main interface, and mobile phone 102 displays the gallery application interface, which includes five pictures, represented by icons for Photo 1, Photo 2, Photo 3, Photo 4, and Photo 5. If the user drags the meeting document from Tablet 103 to the gallery application on mobile phone 102 via Computer 101, and Tablet 103 detects this dragging action (dragging the document off-screen onto Computer 101), it can display [the relevant information]. Figure 2 b in the example. Figure 2 As shown in b, the interface displayed on tablet 103 only includes the meeting agenda document, while computer 101 can display a drag-and-drop icon A. Computer 101 detects the user dragging the document off-screen and onto phone 102, and in response to this action, it can display... Figure 5 c in the example. Figure 5As shown in 'c', phone 102 can display a drag icon B in the Gallery app. When phone 102 detects that the user has canceled the drag operation on the document, it responds to this operation by determining whether the document is a data type supported by the Gallery app. If the document does not conform to the data type supported by the Gallery app, it can refuse to receive the document and can display [the drag icon B]. Figure 4 The d in the example. Figure 4 As shown in d, the tablet 103, computer 101, and mobile phone 102 display the initial interface before the drag operation, without any changes.
[0103] It should be noted that the drag icon B mentioned above can vary depending on the data type being dragged. The correspondence between data types and drag icon B can be preset.
[0104] To achieve the above functions, this application provides specific implementation methods for data transmission.
[0105] The method provided in this application embodiment can be applied to a communication system that allows keyboard and mouse to travel between devices, and the communication system includes three devices. The communication system may include a personal computer and an Android device. The Android device includes Android device 1 and Android device 2, as described above. Figure 1 The communication system 100 described herein includes a PC (computer 101), a mobile phone 102 (Android device 1), and a tablet 103 (Android device 2), but this embodiment is not limited to these. A personal computer can be a desktop computer, a laptop computer (such as 101 above), a mini-laptop, a tablet computer, or an ultrabook, etc. The personal computer's software system is Windows. An Android device is a device running the Android system, such as a mobile phone (such as mobile phone 102 above), a tablet (such as mobile phone 103 above), etc.
[0106] To better understand the embodiments of this application, the PC, Android device 1, and the software structure of Android device 1 in the embodiments of this application will be described below.
[0107] For example, Figure 6 A software architecture block diagram of a PC is shown. For example... Figure 6 As shown, the PC includes a business layer, a capability layer, and a driver layer.
[0108] The business layer includes applications, a user interface (UI) implementation module, a keyboard and mouse business module, and a drag-and-drop module. The applications include gallery, chat, and file manager applications. The UI implementation module provides a visual interface for the user. For example, the UI implementation module can display the above... Figure 1The main interface shown, etc. The keyboard and mouse business module is used to call the keyboard virtualization capability module to achieve keyboard and mouse crossover. The drag and drop module is used to call the drag and drop framework to monitor the user's drag and drop operations.
[0109] The capability layer includes a drag-and-drop framework, a communication module (Magic Link), a PC management framework, a keyboard virtualization module, an audio system, and a storage system. The drag-and-drop framework supports user drag-and-drop operations. The communication module communicates with Android devices. The keyboard virtualization module acquires and transmits keyboard and mouse events. The PC management framework manages PC management options. The audio system manages high-performance audio playback. The storage system stores data.
[0110] The driver layer includes Bluetooth driver, audio driver, Wi-Fi driver, and human interface device (HID) driver.
[0111] Figure 7 A software architecture block diagram of an Android device is shown. Figure 7 As shown, an Android device includes an application layer, an application framework layer, an Android runtime and system libraries, and a kernel layer.
[0112] The application layer includes a keyboard and mouse business module, a UI implementation module, a drag-and-drop module, a keyboard and mouse virtualization capability module, a communication module (Magic Link), and the application itself. The UI implementation module provides a visual interface for the user. For example, it displays the main interface and the application's interface. The drag-and-drop module invokes the drag-and-drop framework to monitor user drag-and-drop operations. The keyboard and mouse virtualization capability module provides keyboard and mouse virtualization capabilities, i.e., acquiring and transmitting keyboard and mouse events. The communication module provides inter-device connection channels and data transmission capabilities. The application includes applications such as a gallery, chat, and file manager.
[0113] The application framework layer includes a drag-and-drop framework, a multi-screen framework, an input management module, and a storage system. The drag-and-drop framework provides drag-and-drop functionality for keyboard and mouse movement. The input management module handles keyboard and mouse event reporting. The storage system stores data. The multi-screen framework enables multi-screen keyboard and mouse operation.
[0114] The Android runtime and system libraries include core libraries, the virtual machine, the surface manager, media libraries, and 3D graphics processing libraries. The Android runtime is responsible for the scheduling and management of the Android system. The core libraries consist of two parts: one part contains the functionalities that Java needs to call, and the other part comprises the Android core libraries. The application layer and application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection. System libraries can contain modules with multiple functionalities, such as the surface manager, media libraries, and 3D graphics processing libraries.
[0115] The Surface Manager manages the display subsystem and provides fusion of 2D and 3D layers for multiple applications. The Media Library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as JPG and PNG. The 3D Graphics Processing Library implements 3D graphics drawing, image rendering, compositing, and layer processing.
[0116] The kernel layer is the layer between hardware and software. It drives the hardware, enabling it to function. The kernel layer includes Bluetooth drivers, audio drivers, Wi-Fi drivers, virtual input drivers, and HID drivers. The virtual input driver is used to inject input events.
[0117] To better understand the embodiments of this application, the embodiments of this application are combined with the above. Figure 5 and Figure 6 The modules involved will be described in detail for the methods provided in the embodiments of this application.
[0118] After the PC and Android device are successfully connected, before transferring data, you can first confirm that the keyboard and mouse are successfully connected. If the connection is successful, then you can proceed with data transfer.
[0119] For example, Figure 8 A schematic flowchart of a keyboard and mouse connection method 800 is shown. Figure 8 As shown, the method 800 can be applied to communication systems including PCs and Android devices, such as the aforementioned communication system 100, but the embodiments of this application are not limited thereto. The software architecture diagram of the PC can be as follows: Figure 6 As shown, the software architecture diagram of an Android device can be as follows: Figure 7 As shown, the embodiments of this application are not limited thereto.
[0120] The method 800 may include the following steps:
[0121] The S801 PC's keyboard and mouse service module establishes a transmission connection with the Android device's keyboard and mouse service module.
[0122] After the PC and the Android device are connected, the keyboard and mouse service modules of the PC and the Android device can establish a transmission connection. The Android device can be either Android device 1 or Android device 2; this embodiment does not limit the choice.
[0123] S802: The PC's keyboard and mouse service module sends an instruction to the Android device's keyboard and mouse service module to enable the keyboard and mouse service. Correspondingly, the Android device's keyboard and mouse service module receives the instruction to enable the keyboard and mouse service.
[0124] The instruction message for enabling keyboard and mouse services is used to instruct the keyboard and mouse service module of the Android device to enable keyboard and mouse services.
[0125] The keyboard and mouse service, also known as the keyboard and mouse traversal option, is indicated by the message that the keyboard and mouse service module on the Android device should enable the keyboard and mouse traversal option.
[0126] The keyboard and mouse service module of S803 and Android devices determines whether keyboard and mouse service is supported based on the instruction information to enable keyboard and mouse service.
[0127] The keyboard and mouse service, also known as the keyboard and mouse traversal option, is enabled or disabled by the user. The Android device's keyboard and mouse service module determines whether the service is supported; that is, it determines whether the user has checked, selected, or enabled the keyboard and mouse traversal option.
[0128] If the user selects, checks, or enables the keyboard and mouse traversal option, the keyboard and mouse service module on the Android device can support keyboard and mouse services. If the user does not select, does not check, or disables the keyboard and mouse traversal option, the keyboard and mouse service module on the Android device does not support keyboard and mouse services and keyboard and mouse traversal is not possible.
[0129] S804. When keyboard and mouse services are supported, the keyboard and mouse service module of the Android device sends an instruction to enable the keyboard and mouse service to the keyboard and mouse virtualization capability module of the Android device. Correspondingly, the keyboard and mouse virtualization capability module of the Android device receives the instruction to enable the keyboard and mouse service.
[0130] The S805 and Android device's keyboard and mouse virtualization module registers virtual input (Uinput) based on the instruction information indicating that the keyboard and mouse service is enabled.
[0131] Uinput is used to inject keyboard and mouse events.
[0132] S806, the keyboard and mouse virtualization capability module of the Android device sends registration result A to the keyboard and mouse service module of the Android device, and the corresponding keyboard and mouse service module of the Android device receives the registration result A.
[0133] Registration result A can be used to indicate whether the Uinput registration was successful. The registration result can be either success or failure. In one embodiment, success and failure can be represented by binary identifiers. For example, 1 represents success and 0 represents failure.
[0134] S807, based on the instruction information that the keyboard and mouse service is enabled, the keyboard and mouse virtualization module of the Android device sends an instruction information to the multi-screen framework module of the Android device to register cursor position listening. Correspondingly, the multi-screen framework module of the Android device receives the instruction information to register cursor position listening and registers cursor position listening.
[0135] After registering a cursor position listener in the multi-screen framework module, you can monitor the cursor position.
[0136] It should be noted that the order of registering Uinput and sending the instruction to register cursor position listening is not limited based on the keyboard and mouse service activation instruction information of the Android device's keyboard and mouse virtualization capability module. In other words, the execution order of the above S805 and S808 is not limited in the embodiments of this application.
[0137] S808, the keyboard and mouse virtualization capability module of the Android device sends registration result B to the keyboard and mouse service module of the Android device, and correspondingly, the keyboard and mouse service module of the Android device receives the registration result B.
[0138] Registration result B can be used to indicate whether the registration of the cursor position listener was successful. The registration result can be either success or failure. In one embodiment, success and failure can be represented by binary identifiers. For example, 1 represents success and 0 represents failure.
[0139] S809. When keyboard and mouse services are supported, the keyboard and mouse service module of the Android device sends an instruction to register drag and drop listener to the drag and drop management module of the Android device. Correspondingly, the keyboard and mouse virtualization capability module of the Android device receives the instruction to register drag and drop listener.
[0140] It should be noted that, when keyboard and mouse services are supported, the order in which the keyboard and mouse service module of the Android device sends the instruction information to start the keyboard and mouse service and the instruction information to register drag and drop listening is not limited. In other words, the execution order of S804 and S809 is not limited in this application embodiment.
[0141] S810: The drag-and-drop management module of the Android device sends an instruction to the multi-screen framework module of the Android device to register drag-and-drop listeners. Correspondingly, the multi-screen framework module of the Android device receives the instruction to register drag-and-drop listeners.
[0142] S811, the keyboard and mouse service module of the Android device saves the processing result A, where the processing result A includes whether the keyboard and mouse service is started, whether the Uinput registration is successful, and whether the cursor position listener registration is successful.
[0143] For example, the processing result A may include the keyboard and mouse service being started, Uinput being successfully registered, and cursor position listener being successfully registered.
[0144] S812, the keyboard and mouse service module of the Android device sends the processing result A to the keyboard and mouse service module of the PC, and correspondingly, the keyboard and mouse service module of the PC receives the processing result A.
[0145] S813, the PC's keyboard and mouse service module sends an instruction to the PC's keyboard and mouse virtualization capability module to enable the keyboard and mouse service, and correspondingly, the PC's keyboard and mouse service module receives the instruction to enable the keyboard and mouse service.
[0146] S802 and S813 are sent in parallel by the PC's keyboard and mouse service module, therefore S802 to S812 and S813 to S818 are executed in parallel.
[0147] The keyboard and mouse virtualization module of S814 and PC registers keyboard and mouse event listeners based on the instruction information to enable keyboard and mouse services.
[0148] The PC's keyboard and mouse virtualization module can register keyboard and mouse event listeners to detect these events. For example, the PC's keyboard and mouse virtualization module can detect keyboard presses and mouse movements such as moving, clicking, and dragging.
[0149] The keyboard and mouse virtualization module of S815 and PC sets up keyboard and mouse event interception based on the instruction information to enable keyboard and mouse services.
[0150] When the keyboard and mouse are circumvented, the keyboard and mouse events are intercepted on the PC side, and the response to the keyboard and mouse events is executed by the Android device. Therefore, the PC's keyboard and mouse virtualization module is configured to intercept keyboard and mouse events so as to intercept keyboard and mouse events after they are circumvented.
[0151] The execution order of S814 and S815 described above is not limited in the embodiments of this application.
[0152] The keyboard and mouse virtualization module of S816 and PC saves the processing result B, which includes whether the keyboard and mouse device registration was successful and whether the keyboard and mouse event interception was successfully set.
[0153] For example, the processing result B may include successful registration of keyboard and mouse components and successful setting of keyboard and mouse event interception.
[0154] S818, the PC's keyboard and mouse virtualization module sends processing result B to the PC's keyboard and mouse service module, and correspondingly, the PC's keyboard and mouse service module receives the processing result B.
[0155] The keyboard and mouse service module of S818 and PC sends the processing result B to the keyboard and mouse service module of Android device, and correspondingly, the keyboard and mouse service module of Android device receives the processing result B.
[0156] The keyboard and mouse service modules of S819, PC, and Android devices can all compare processing result A with processing result B to determine whether the keyboard and mouse are successfully connected.
[0157] If both result A and result B are successful, the keyboard and mouse service modules of the PC and the Android device can determine that the keyboard and mouse connection is successful. If at least one result in either result A or result B is a failure, the keyboard and mouse service modules of the PC and the Android device can determine that the keyboard and mouse connection is unsuccessful.
[0158] If the keyboard and mouse connection between the PC's keyboard and mouse service module and the Android device's keyboard and mouse service module fails, both will be restored to the initialization state, that is, the above registration process will be re-executed.
[0159] The keyboard and mouse connection method provided in this application embodiment connects different devices between data transmissions to prepare for subsequent data transmissions, which is conducive to the smooth progress of data transmission.
[0160] It should be noted that the keyboard and mouse connection between the PC and the two Android devices is done in the same way, following the process described in method 800 above.
[0161] After confirming a successful keyboard and mouse connection using the above method (800), the PC and Android device can transfer data.
[0162] Before introducing data transmission, let's first introduce a method for detecting mouse movement. PCs and / or Android devices can use this method to listen for mouse movement.
[0163] For example, Figure 9 A schematic flowchart of a mouse-crossing detection method 900 is shown. Figure 9 As shown, the method 900 may include the following steps:
[0164] The S901 PC's keyboard virtualization module obtains the mouse position.
[0165] The mouse position is the coordinate of the mouse on the screen. The PC's keyboard virtualization module can create a two-dimensional coordinate system on the screen, and the mouse's coordinates in the two-dimensional coordinate system are the mouse position. The mouse position can be represented by (XRaw, YRaw), but the embodiments of this application are not limited to this.
[0166] For example, Figure 10 A schematic diagram illustrating the establishment of a screen coordinate system is shown. (For example...) Figure 10 As shown, a coordinate system is established on screen OABC with point O as the origin, the line containing OA as the X-axis, and the line containing OC as the Y-axis. The screen resolution is 1920*1080. The length of line segment OA is equal to the length of line segment CB (1920), and the length of line segment OC is equal to the length of line segment AB (1080). Therefore, in the coordinate system, the coordinates of point O are (0,0), point A is (1920,0), point B is (1920,1080), and point C is (0,1080). The mouse position is the mouse's coordinate in the coordinate system; for example, the mouse position could be (1920,960).
[0167] When the keyboard virtualization module of the S902 PC detects mouse movement, it obtains the mouse displacement.
[0168] Mouse displacement refers to the distance the mouse moves. Mouse displacement can be represented by (Lx, Ly). Lx and Ly can be positive or negative values, and this embodiment does not limit this.
[0169] The keyboard virtualization module of S903 and PC calculates the position of the mouse after it moves based on the mouse position and mouse displacement.
[0170] The position of the mouse after movement can be represented by (curX, curY). The position of the mouse after movement can be represented by the following formulas: curX = XRaw + Lx; curY = YRaw + Ly.
[0171] The S904 PC's keyboard virtualization module determines whether the mouse's position exceeds the screen after movement.
[0172] If curX is less than the minimum value of the screen on the X-axis or greater than the maximum value of the screen on the X-axis, the PC's keyboard virtualization module can determine that the mouse is off-screen. If curY is less than the minimum value of the screen on the Y-axis or greater than the maximum value of the screen on the Y-axis, the PC's keyboard virtualization module can determine that the mouse is off-screen.
[0173] If the mouse position after movement exceeds the screen, it can be determined that the mouse has crossed the screen, and S905 is executed. If the mouse position after movement does not exceed the screen, the current position can be determined, and mouse movement can continue to be acquired, and S902 is executed.
[0174] S905. If the mouse moves beyond the screen, the PC's keyboard virtualization module can determine that the mouse has crossed the screen.
[0175] The PC can also determine the direction the mouse moves, for example, moving left, right, up, or down.
[0176] For example, in the above Figure 10 In the example shown, if curX is less than 0, the PC can determine that the mouse's movement direction is left. If curX is greater than 1920, the PC can determine that the mouse's movement direction is right. If curY is less than 0, the PC's keyboard virtualization module can determine that the mouse's movement direction is upward. If curX is greater than 1080, the PC can determine that the mouse's movement direction is downward.
[0177] The mouse crossing detection method provided in this application can determine whether the mouse has exceeded the screen and the crossing direction by measuring the mouse position and displacement, which helps to improve the accuracy of detecting mouse crossing.
[0178] The data transmission method provided in the embodiments of this application will be described below.
[0179] For example, Figure 11 A schematic flowchart of a data transmission method 1100 is shown. This method 1100 can be applied to a communication system including a PC and Android devices, wherein the Android devices include Android device 1 and Android device 2. For example, in the above-described communication system 100, the PC is computer 101, but the embodiments of this application are not limited thereto. The software architecture diagram of the PC can be as follows: Figure 6 As shown, the software architecture diagram of an Android device can be as follows: Figure 7 As shown, the embodiments of this application are not limited thereto.
[0180] The method 1100 may include the following steps:
[0181] S1101, The application on Android device 1 detected the user's action of dragging out data.
[0182] The application can be at least one of a gallery, chat, or file manager, but this application embodiment is not limited to a gallery, chat, or file manager. The user's drag-and-drop operation can be the user dragging and dropping data with the mouse. The data dragged by the user can be images, files, text, compressed files, emails, music, videos, etc. It is understood that the data dragged by the user can be any data that supports dragging and dropping, and this application embodiment does not limit this.
[0183] Android device 1 can be the aforementioned mobile phone 102 or tablet 103, and this application embodiment does not limit it.
[0184] For example, in the above Figure 5 In the example shown, Android device 1 can be tablet 103, and the application can be a file manager that detects the user dragging out a document.
[0185] S1102, In response to the user's drag-out data operation, the application of Android device 1 sends data drag-out information to the drag-out frame of Android device 1, and correspondingly, the drag-out frame of Android device 1 receives the data drag-out information.
[0186] S1103, The Android device 1 drag-and-drop framework sends the data drag-out information to the Android device 1 drag-and-drop module based on the data drag-out information, and correspondingly, the Android device 1 drag-and-drop module receives the data drag-out information.
[0187] S1104. The drag-and-drop module of Android device 1 obtains the universal resource identifier (URI) of the dragged data based on the information of the dragged data.
[0188] A URI is used to represent the data to be manipulated.
[0189] S1105, the application on Android device 1 receives the user's drag-out operation.
[0190] Applications on Android device 1 can determine whether a user has dragged data off the screen based on the method described above 900.
[0191] S1106, The application of Android device 1 sends a drag-out command to the drag module of PC, and the drag module of PC receives the drag-out command.
[0192] The PC can be the computer 101 described above, but the embodiments of this application are not limited to this.
[0193] The drag-out command is used to inform the PC's drag-and-drop module that data has been dragged into the PC. The drag-out command can be represented by a flag bit, but this embodiment is not limited to this. For example, the drag-out command may include flag bit 1 to indicate that data has been dragged into the PC.
[0194] It should be noted that S1106 is a simplified notation. The application on Android device 1 cannot communicate directly with the drag-and-drop module on the PC. Instead, the application on Android device 1 sends the drag-and-drop command to the drag-and-drop framework on Android device 1. The drag-and-drop framework then transmits the command to the drag-and-drop module on Android device 1, which in turn sends the command to the communication module. The communication module on Android device 1 receives the command and transmits it to the communication module on the PC. Finally, the communication module on the PC sends the command to the drag-and-drop module on the PC.
[0195] The drag-and-drop module of S1107 and PC is based on the command to drag off the screen and can record the drag-and-drop status.
[0196] The drag-and-drop status can be any of the following: drag complete, drag to PC, drag to Android device 1, or drag to Android device 2.
[0197] The PC's drag-and-drop module, based on the drag-out-of-screen command, can record the drag-and-drop status as "drag to PC". If the PC's drag-and-drop module detects the user dragging data in, it can record (or update) the drag-and-drop status as "drag complete". If the PC's drag-and-drop module detects the user dragging data out of the screen, it can record (or update) the drag-and-drop status as "drag to Android device 2".
[0198] The S1108 PC's drag module detects the user's dragging action off the screen.
[0199] The drag-and-drop module of S1109 and PC responds to the user's drag-and-drop operation and can update the drag-and-drop status.
[0200] The PC's drag-and-drop module responds to the user's dragging action off the screen and can update the drag-and-drop status to drag to Android device 2.
[0201] The drag-and-drop module of S1110 and PC sends a drag-and-drop instruction to the drag-and-drop module of Android device 2, and correspondingly, the drag-and-drop module of Android device 2 receives the drag-and-drop instruction.
[0202] It should be noted that S1110 is a simplified notation. The drag-and-drop module of the PC cannot communicate directly with the drag-and-drop module of the Android device 2. The drag-and-drop module of the PC can first send the drag-and-drop instruction information to the communication module of the PC, then the communication module of the PC sends the drag-and-drop instruction information to the communication module of the Android device 2, and finally the communication module of the Android device 2 sends the drag-and-drop instruction information to the drag-and-drop module of the Android device 2.
[0203] In the above Figure 2 , Figure 3 , Figure 4 or Figure 5In the example shown, if Android device 1 is a mobile phone 102, then Android device 2 is a tablet 103; if Android device 1 is a tablet 103, then Android device 2 is a mobile phone 102, but the embodiments of this application are not limited to this.
[0204] S1111 The drag module of Android device 2 initiates dragging by calling the interface provided by the drag framework of Android device 2 based on the indication information of dragging out of the screen, and draws an icon according to the image (bitmap) corresponding to the dragged data.
[0205] The drag-and-drop module on Android Device 2 supports drag-and-drop functionality by calling the drag-and-drop framework. The drag-and-drop module on Android Device 2 can display an icon at the mouse position based on the bitmap image corresponding to the dragged data.
[0206] The drag-and-drop module on Android Device 2 can preset multiple data types and their corresponding bitmaps. For example, data types can include images, files, text, videos, and music.
[0207] The drag-and-drop module on Android Device 2 determines the data type of the dragged data based on the on-screen indication and then determines the bitmap accordingly. The drag-and-drop module on Android Device 2 can then display an icon at the mouse cursor's location based on this bitmap.
[0208] Icons can be Figure 2 , Figure 3 , Figure 4 or Figure 5 The drag icon B in the example is shown, but the embodiments of this application are not limited thereto.
[0209] S1112, Android device 2 determines whether the draggable frame block is dragged into the draggable area.
[0210] The draggable area refers to the area where data is allowed to be dragged in. If a user drags data into the draggable area, the application can display the dragged data there. If the user does not drag data into the draggable area, the application will not allow the data to be dragged in, and the user's drag-and-drop operation will fail.
[0211] S1113. If the item is dragged into a draggable area, the drag-and-drop framework of Android device 2 sends a business callback message to the application of Android device 2. Correspondingly, the application of Android device 2 receives this business callback message. Based on the business callback message, the application of Android device 2 performs the business callback, that is, executes the business logic following the drag-and-drop action.
[0212] The data transmission method provided in this application embodiment can support users to drag and drop data from Android device 1 to Android device 2 via PC, realizing data transmission across multiple devices. It eliminates the need to first drag and drop from Android device 1 to PC and then from PC to Android device 2, reducing the PC's relay, which is beneficial to improving data transmission efficiency, avoiding cumbersome operations, and improving user experience.
[0213] If a user drags data from Android device 1 to Android device 2 via a PC, Android device 2 can retrieve the data from Android device 1. This application provides two methods for retrieving data.
[0214] The first method for obtaining data involves Android device 1 sending data to PC, and then PC sending the data to Android device 2.
[0215] For example, Figure 12 A schematic flowchart of a data acquisition method 1200 is shown. Figure 12 As shown, the method 1200 includes the following steps:
[0216] S1201, the application on Android device 2 detected the user's drag-and-drop data operation.
[0217] The application can be at least one of a gallery, chat, or file manager, but this application embodiment is not limited to a gallery, chat, or file manager. The application on Android device 1 and the application on Android device 2 can be the same or different, and this application embodiment does not limit this.
[0218] For example, in the above Figure 3 In the example shown, the application on Android device 2 is a chat application.
[0219] S1202, In response to the user's drag-and-drop operation, the application of Android device 2 sends a request for data to the drag-and-drop module of Android device 2, and the drag-and-drop module of Android device 2 receives the request for data.
[0220] The request data information is used to request dragged data from the drag module of Android device 2.
[0221] It should be noted that when an application on Android Device 2 responds to a user's drag-and-drop operation, it can first send a data request to the drag-and-drop framework on Android Device 2, and then the drag-and-drop framework on Android Device 2 will send the data request to the drag-and-drop module on Android Device 2.
[0222] S1203, the drag-and-drop module of Android device 2 sends the request data information to the drag-and-drop module of PC based on the request data information, and the drag-and-drop module of PC receives the request data information accordingly.
[0223] It should be noted that the drag-and-drop module of Android device 2, based on the requested data information, can first send the requested data information to the communication module of Android device 2, then the communication module of Android device 2 sends the requested data information to the communication module of the PC, and finally the communication module of the PC sends the requested data information to the drag-and-drop module of the PC.
[0224] S1204, the PC drag-and-drop module determines whether it is a cross-PC drag-and-drop operation based on the information in the requested data and the drag-and-drop status.
[0225] In the above method 900, the drag state is dragging to Android device 2, and the PC's drag module can determine that the drag operation is a cross-PC drag operation.
[0226] S1205, the drag module of the PC sends a request for data to the drag module of the Android device 1, and correspondingly, the drag module of the Android device 1 receives the request for data.
[0227] It should be noted that the PC's drag-and-drop module can first send a request for data to the PC's communication module, then the PC's communication module can send the request for data to the Android device 1's communication module, and finally the Android device 1's communication module can send the request for data to the Android device 1's drag-and-drop module.
[0228] S1206, the drag-and-drop module of Android device 1 determines the drag-and-drop data based on the information of the requested data and the URI of the data.
[0229] The dragged data can be a binary string, but the embodiments of this application are not limited to this.
[0230] S1207, the drag-and-drop module of Android device 1 sends drag-and-drop data to the drag-and-drop module of PC, and correspondingly, the drag-and-drop module of PC receives the drag-and-drop data.
[0231] It is understandable that the drag-and-drop module of Android device 1 can first send drag-and-drop data to the communication module of the PC, then the communication module of the PC can send drag-and-drop data to the communication module of Android device 2, and finally the communication module of Android device 2 can send drag-and-drop data to the drag-and-drop module of Android device 2.
[0232] The drag-and-drop module of S1208 and PC is based on drag-and-drop data and saves the drag-and-drop data.
[0233] S1209, the drag-and-drop module of the PC sends drag-and-drop data to the communication module of the Android device 2, and correspondingly, the communication module of the Android device 2 receives the drag-and-drop data.
[0234] Understandably, the PC's drag-and-drop module can first send drag-and-drop data to the PC's communication module, and then the PC's communication module can send drag-and-drop data to the Android device 2's communication module.
[0235] S1210, the communication module of Android device 2 sends a message indicating that data reception was successful to the drag module of Android device 2, and correspondingly, the drag module of Android device 2 receives the message indicating that data reception was successful.
[0236] The message indicating successful data reception is used to indicate that the communication module of Android device 2 has successfully received communication data.
[0237] The message indicating successful data reception may also include dragged data, so that the drag module of Android device 2 can receive the dragged data.
[0238] S1211 and Android device 2's drag module send drag data to the application based on the information that the data has been successfully received. Correspondingly, the application sends drag data.
[0239] The application can also display dragged-and-drop data in the interface.
[0240] Based on the successful data reception information, the drag-and-drop module of S1212 and Android device 2 can also send a successful data reception information to the drag-and-drop module of the PC. Correspondingly, the drag-and-drop module of the PC receives the successful data reception information.
[0241] The execution order of S1211 and S1212 is not limited in the embodiments of this application.
[0242] S1213, the PC's drag-and-drop module clears the dragged data based on the information that the data was successfully received.
[0243] The PC's drag-and-drop module can clear drag-and-drop data based on the information that data has been successfully received, and can also update the drag-and-drop status to "drag-and-drop complete".
[0244] The data acquisition method provided in this application embodiment allows Android device 1 to first transfer the data to PC and then transfer it from PC to Android device 2 when Android device 2 requests to acquire dragged-in data. Using PC as a data transfer intermediary is equivalent to first dragging the data from Android device 1 to PC and then dragging the data from PC to Android device 2. This method can reuse existing data transfer methods with minimal modifications, which is beneficial for application promotion.
[0245] Optionally, if the communication module of Android device 2 fails to receive the dragged data, it can request the data again from the dragged module of the PC. The dragged module of the PC can send the data to the communication module of Android device 2 based on the saved data, which can save the steps of obtaining data and improve the data transmission efficiency.
[0246] It is understandable that if a user drags data from Android device 2 to Android device 1 via PC, the same method 1200 can be used, simply by changing Android device 1 to Android device 2 and vice versa.
[0247] The second method of obtaining data is for Android device 1 to send data directly to Android device 2, meaning the data does not pass through a PC.
[0248] For example, Figure 13 A schematic flowchart of a data acquisition method 1300 is shown. Figure 13 As shown, the method 1300 may include the above-described S1201 to S1205, and may also include the following steps:
[0249] S1301, the drag module of Android device 1 sends an instruction to establish a transmission channel to the communication module of Android device 1 based on the information of the requested data, and correspondingly, the communication module of Android device 1 receives the instruction to establish a transmission channel.
[0250] The instruction information for establishing a transmission channel is used to instruct the communication module of Android device 1 to establish a transmission channel with the communication module of Android device 2.
[0251] S1302, The communication module of Android device 1 establishes a data transmission channel with the communication module of Android device 2 based on the instruction information for establishing a transmission channel.
[0252] S1303 After the data transmission channel is established, the drag module of Android device 1 sends drag data to the communication module of Android device 1, and correspondingly, the communication module of Android device 1 receives the drag data.
[0253] S1304, the communication module of Android device 1 sends drag data to the communication module of Android device 2 through the data transmission channel, and correspondingly, the communication module of Android device 2 receives the drag data.
[0254] S1305, the communication module of Android device 2 sends a message indicating that data reception was successful to the drag module of Android device 2, and correspondingly, the drag module of Android device 2 receives the message indicating that data reception was successful.
[0255] The message indicating successful data reception is used to indicate that the communication module of Android device 2 has successfully received communication data.
[0256] The message indicating successful data reception may also include dragged data, so that the drag module of Android device 2 can receive the dragged data.
[0257] S1306 and Android device 2's drag-and-drop module send drag-and-drop data to the application based on the information that the data has been successfully received. Correspondingly, the application sends drag-and-drop data.
[0258] The application can also display dragged-and-drop data in the interface.
[0259] Based on the successful data reception information, the drag-and-drop module of S1307 and Android device 2 can also send a successful data reception information to the drag-and-drop module of the PC. Correspondingly, the drag-and-drop module of the PC receives the successful data reception information.
[0260] The execution order of S1306 and S1307 is not limited in the embodiments of this application.
[0261] The drag-and-drop module of S1308 and PC updates the drag-and-drop status based on the information that the data has been successfully received.
[0262] The PC's drag-and-drop module updates the drag-and-drop status to "drag complete" based on the information that data has been successfully received.
[0263] S1309, the drag-and-drop module of the PC sends a drag-and-drop completion message to the drag-and-drop module of the Android device 1, and correspondingly, the drag-and-drop module of the Android device 1 receives the drag-and-drop completion message.
[0264] The drag-and-drop complete message indicates that the drag-and-drop is finished.
[0265] S1310, the drag module of Android device 1 sends a channel removal instruction to the communication module of Android device 1 based on the drag completion message. Correspondingly, the communication module of Android device 1 receives the channel removal instruction and removes the data transmission channel based on the channel removal instruction.
[0266] The channel removal instruction is used to instruct the communication module of Android device 1 to remove the channel.
[0267] The data acquisition method provided in this application embodiment allows Android device 1 to transfer data to Android device 2 via the data transmission channel between Android device 1 and Android device 2 when Android device 2 requests to acquire dragged data. This eliminates the need for a PC to relay the data, deliberately reducing the data transmission process and improving data transmission efficiency.
[0268] The sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0269] The above text combines Figures 1 to 13 The method provided in the embodiments of this application is described in detail below. Figure 14 and Figure 15This application provides a detailed description of the device provided in the embodiments.
[0270] Figure 14 A schematic diagram of a terminal device 1400 provided in an embodiment of this application is shown. The terminal device 1400 includes a processing module 1410 and a transceiver module 1420.
[0271] In one possible implementation, the terminal device 1400 can perform the steps executed by the Android device 2 in the above embodiments.
[0272] The processing module 1410 is used to: detect a first operation by the user, wherein the first operation is to move the identifier of the target data from the third device to the second device via the mouse, wherein the third device and the second device support keyboard and mouse crossing, and the second device supports keyboard and mouse crossing; the transceiver module 1420 is used to: respond to the first operation, send a request for target data to the third device via the second device; and receive target data from the third device.
[0273] In another possible implementation, the terminal device 1400 can perform the steps executed by the Android device 1 in the above embodiments.
[0274] The processing module 1410 is used to: detect a first operation by the user, wherein the first operation is to move the identifier of the target data from the second device to the first device via the mouse, and the second device supports keyboard and mouse crossing, and the second device supports keyboard and mouse crossing with the first device; the transceiver module 1420 is used to: in response to the first operation, receive information requesting target data from the first device via the second device; and send the target data to the first device.
[0275] In another possible implementation, the terminal device 1400 can perform the steps executed by the PC in the above embodiments.
[0276] The processing module 1410 is used to: detect a first operation by the user, wherein the first operation is to move the identifier of the target data from the third device to the first device via the mouse, wherein the third device supports keyboard and mouse traversal, and the first device supports keyboard and mouse traversal; the transceiver module 1420 is used to: respond to the first operation, receive information requesting the target data from the first device; and send information requesting the target data to the third device.
[0277] It should be understood that the terminal device 1400 here is embodied in the form of a functional module. The term "module" here can refer to application-specific integrated circuits (ASICs), electronic circuits, processors (e.g., shared processors, proprietary processors, or group processors, etc.) and memory for executing one or more software or firmware programs, integrated logic circuits, and / or other suitable components supporting the described functions. In an alternative example, those skilled in the art will understand that the terminal device 1400 can specifically be Android device 2, PC, or Android device 1 in the above method embodiments; or, the functions of Android device 2, PC, or Android device 1 in the above method embodiments can be integrated into the terminal device 1400. The terminal device 1400 can be used to execute the various processes and / or steps corresponding to Android device 2, PC, or Android device 1 in the above method embodiments. To avoid repetition, these will not be described further here.
[0278] The terminal device 1400 described above has the function of implementing the corresponding steps executed by Android device 2, PC, or Android device 1 in the above method embodiments; the above functions can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
[0279] In the embodiments of this application, Figure 14 The terminal device 1400 can also be a chip or a chip system, such as a system on chip (SoC).
[0280] Figure 15 This is a schematic block diagram of another terminal device 1500 provided in an embodiment of this application. The terminal device 1500 includes a processor 1510, a transceiver 1520, and a memory 1530. The processor 1510, transceiver 1520, and memory 1530 communicate with each other via internal interconnection paths. The memory 1530 is used to store instructions, and the processor 1520 is used to execute the instructions stored in the memory 1530 to control the transceiver 1520 to transmit and / or receive signals.
[0281] It should be understood that the terminal device 1500 may specifically be Android device 2, PC, or Android device 1 in the above method embodiments. Alternatively, the functions of Android device 2, PC, or Android device 1 in the above method embodiments may be integrated into the terminal device 1500. The terminal device 1500 may be used to execute the various steps and / or processes corresponding to Android device 2, PC, or Android device 1 in the above method embodiments. Optionally, the memory 1530 may include read-only memory and random access memory, and provide instructions and data to the processor. A portion of the memory may also include non-volatile random access memory. For example, the memory may also store device type information. The processor 1510 may be used to execute instructions stored in the memory, and when the processor executes the instructions, the processor may execute the various steps and / or processes corresponding to the terminal device in the above method embodiments.
[0282] It should be understood that, in the embodiments of this application, the processor 1510 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0283] In implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software. The steps of the method disclosed in the embodiments of this application can be directly manifested as execution by a hardware processor, or as a combination of hardware and software modules within the processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor executes the instructions in the memory, combining them with its hardware to complete the steps of the above method. To avoid repetition, detailed descriptions are omitted here.
[0284] This application also provides a computer-readable storage medium for storing a computer program for implementing the methods corresponding to Android device 2, PC, or Android device 1 in the above method embodiments.
[0285] This application also provides a chip system for supporting Android device 2, PC or Android device 1 in the above method embodiments to implement the functions shown in the embodiments of this application.
[0286] This application also provides a computer program product, which includes a computer program (also referred to as code or instructions). When the computer program is run on a computer, the computer can execute the methods corresponding to Android device 2, PC or Android device 1 as shown in the above method embodiments.
[0287] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0288] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0289] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.
[0290] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0291] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.
[0292] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0293] The above description is merely a specific embodiment of this application, but the protection scope of the embodiments of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the embodiments of this application should be included within the protection scope of the embodiments of this application. Therefore, the protection scope of the embodiments of this application should be determined by the protection scope of the claims.
Claims
1. A data transmission method, characterized in that, include: The first device receives a first operation from the user, the first operation being used to drag an object of target data from the third device to the first device via the second device using a mouse, the third device and the second device supporting keyboard and mouse crossing, the second device and the first device supporting keyboard and mouse crossing, and the mouse being connected to the second device; In response to the first operation, the first device receives the target data from the third device; The first device displays the object containing the target data.
2. The method according to claim 1, characterized in that, In receiving the target data from the third device, the method further includes: In response to the first operation, the first device sends a request for the target data to the third device via the second device.
3. The method according to claim 1, characterized in that, In response to the first operation, the first device receives the target data from the third device, including: The first device establishes a data transmission channel with the third device; The first device receives the target data from the third device through the data transmission channel.
4. The method according to claim 3, characterized in that, After the first device receives the target data from the third device through the data transmission channel, the method further includes: The first device dismantles the data transmission channel.
5. The method according to claim 1, characterized in that, In response to the first operation, the first device receives the target data from the third device, including: The first device receives the target data from the third device through the second device.
6. The method according to any one of claims 1 to 5, characterized in that, Before the first device receives the target data from the third device in response to the first operation, the method further includes: The first device determines whether the area into which the mouse drags the object containing the target data is a preset area; Receiving the target data from the third device includes: If the area where the target data object is dragged into is the preset area, the target data is received from the third device.
7. The method according to any one of claims 1 to 6, characterized in that, The target data includes at least one of the following: Text data, image data, document data, email data, compressed file data, music data, or video data.
8. The method according to claim 1, characterized in that, Before the first device receives the user's first operation, the method further includes: The first electronic device receives a screenshot operation applied to the first interface; The first electronic device responds to the screenshot operation by displaying a thumbnail of the screenshot image; The first electronic device receiving the user's first operation includes: The first electronic device receives a first operation applied to the screenshot thumbnail, wherein the target data is the screenshot.
9. A data transmission method, characterized in that, include: The third device receives a first operation from the user, which is used to move the target data object from the third device to the first device via the second device using a mouse. The third device and the second device support keyboard and mouse crossing, the second device and the first device support keyboard and mouse crossing, and the mouse is connected to the second device. In response to the first operation, the third device sends the target data to the first device.
10. The method according to claim 9, characterized in that, Before the third device sends the target data to the first device in response to the first operation, the method further includes: The third device receives information from the first device requesting the target data through the second device.
11. The method according to claim 9, characterized in that, The third device sends the target data to the first device, including: The third device establishes a data transmission channel with the first device; The third device sends the target data to the first device through the data transmission channel.
12. The method according to claim 11, characterized in that, After the third device sends the target data to the first device through the data transmission channel, the method further includes: The third device dismantles the data transmission channel.
13. The method according to claim 9, characterized in that, The third device sends the target data to the first device, including: The third device sends the target data to the first device through the second device.
14. The method according to any one of claims 9 to 13, characterized in that, Before the third device responds to the first operation and sends the target data to the first device, the method further includes: In response to the first operation, the third device obtains the generic resource identifier (URI) of the target data. The third device determines the data corresponding to the URI as the target data.
15. The method according to any one of claims 9 to 14, characterized in that, The target data includes at least one of the following: Text data, image data, document data, email data, compressed file data, music data, or video data.
16. A data transmission method, characterized in that, include: The second device displays the first interface; The second device receives a first operation from the user, the first operation being used to move the target data object from the third device to the first device via the second device using a mouse, the third device and the second device supporting keyboard and mouse crossing, the second device and the first device supporting keyboard and mouse crossing, and the mouse being connected to the second device; The second device displays a dynamic effect of the target data object entering from a first side of the first interface and exiting from a second side, wherein the third device is disposed on the first side of the second device and the first device is disposed on the second side of the second device.
17. The method according to claim 16, characterized in that, The method further includes: In response to the first operation, the second device receives information from the first device requesting the target data; The second device sends a request for the target data to the third device.
18. The method according to claim 17, characterized in that, Before the second device sends the information requesting the target data to the third device, the method further includes: In response to the first operation, the second device determines the movement state as moving from the third device to the first device; The second device sends a request for the target data to the third device, including: The second device sends the information requesting the target data to the third device based on the information requesting the target data and the movement status.
19. The method according to any one of claims 16 to 18, characterized in that, The method further includes: The second device receives the target data from the third device; The second device sends the target data to the first device.
20. The method according to any one of claims 16 to 19, characterized in that, The target data includes at least one of the following: Text data, image data, document data, email data, compressed file data, music data, or video data.
21. A terminal device, characterized in that, include: A processor coupled to a memory for storing a computer program, which, when invoked by the processor, causes the terminal device to perform the method as claimed in claims 1 to 8, as claimed in claims 9 to 15, or as claimed in any one of claims 16 to 20.
22. A computer-readable storage medium, characterized in that, Used to store computer programs, the computer programs including instructions for implementing the methods as described in any one of claims 1 to 7, 8 to 14, or 15 to 19.
23. A computer program product, characterized in that, The computer program product includes computer program code that, when run on a computer, causes the computer to implement the method as described in any one of claims 1 to 8, 9 to 15, or 16 to 20.