Data transmission method, terminal device, storage medium and program product
By directly establishing a data transmission channel between terminal devices, the problems of low data transmission efficiency and cumbersome operation in the existing technology are solved, efficient cross-device data transmission is achieved, and the user experience is improved.
Patent Information
- Application Number
- CN202211071845.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-02
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2042-09-02
AI Technical Summary
In the existing technology, users cannot directly transfer data from their mobile phones to tablets and must first transfer data through a computer, resulting in low data transmission efficiency and cumbersome operations, which affects the user experience.
By directly establishing a data transmission channel between the first device and the third device, data is transmitted using the transmission channel, avoiding data transfer in intermediate devices, and achieving data dragging directly from the first device to the third device.
It improves data transmission efficiency, reduces user operation steps, and enhances user experience.
Smart Images

Figure CN117692551B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of terminal, and in particular, to a data transmission method and a terminal device. BACKGROUND
[0002] In order to meet the needs of users in work and study, key-mouse crossing can be supported between multiple terminal devices to realize cross-device collaboration. For example, after a user's computer, mobile phone and tablet are connected, the computer's mouse and keyboard can be shared, that is, the user can control the mobile phone and tablet through the computer's mouse and keyboard. For example, the user can drag the data such as files, texts and pictures of the mobile phone or tablet to the computer through the mouse, or the user can drag the data such as files, texts and pictures of the computer to the mobile phone or tablet through the mouse.
[0003] In this case, if the user transmits the data of the mobile phone to the tablet, the data of the mobile phone can only be dragged to the computer through the mouse first, and then the data can be dragged from the computer to the tablet through the mouse, and the data of the mobile phone cannot be directly transmitted to the tablet, which reduces the data transmission efficiency and is cumbersome to operate, and is not conducive to user experience. SUMMARY
[0004] The present application provides a data transmission method, which can improve data transmission efficiency, reduce user operation and improve user experience.
[0005] In a first aspect, a data transmission method is provided, including: a first device detecting a first operation of a user, the first operation being used to move an identifier of target data from a third device to the first device through a second device by a mouse, the third device and the second device supporting key-mouse crossing, and the second device and the first device supporting key-mouse crossing; the first device sending information requesting the target data to the third device through the second device in response to the first operation; and the first device receiving the target data from the third device.
[0006] The first operation is used to move the identifier of the target data from the third device to the first device through the second device by the mouse, wherein moving to the first device can be understood as dragging to the first device, that is, the user controls the mouse to drag the identifier of the target data to the first device through the second device. The identifier of the target data can be pictures, documents, texts, music and videos, and the like, and embodiments of the present application are not limited in this regard.
[0007] The target data is data dragged by the user, which can be any data supporting dragging, and can also be referred to as dragging data, and embodiments of the present application are not limited in this regard.
[0008] The first device is a device that receives target data and can also be understood as a device that pulls target data in. The second device can be understood as an intermediate device, that is, it neither pulls data out nor pulls data in. The third device is a device that sends target data and can also be understood as a device that pulls target data out.
[0009] Optionally, the first device and the third device may be deployed with an Android system and may be referred to as Android devices, and the second device may be deployed with a Windows system.
[0010] For example, in Figure 2 In the example shown, the first device may be a tablet 103, the second device may be a computer 101, and the third device may be a mobile phone 102. Figure 5 In the example shown, the first device may be a mobile phone 102 , the second device may be a computer 101 , and the third device may be a tablet 103 .
[0011] The first device requests the target data through information requesting the target data. The message may be first sent to the first device and then sent by the second device to the third device.
[0012] The data transmission method provided in this application can support users to drag and drop data from a first device to a third device via a second device, which can improve data transmission efficiency, reduce user operations, and improve user experience.
[0013] In combination with the first aspect, in some implementations of the first aspect, the first device receives target data from a third device, including: the first device establishes a data transmission channel with the third device; and the first device receives the target data from the third device through the data transmission channel.
[0014] In the data transmission method provided by this application, the first device and the third device directly establish a data transmission channel. Using the transmission channel to transmit data does not require the second device to transfer the data, which is more efficient and helps to further improve data transmission efficiency.
[0015] In combination with the first aspect, in some implementations of the first aspect, after the first device receives the target data from the third device through the data transmission channel, the method further includes: the first device dismantling the data transmission channel.
[0016] The data transmission method provided by the present application is such that after data transmission, the first device can dismantle the data transmission channel and re-establish it when data transmission is needed, which is beneficial to saving power consumption of the first device and avoiding waste of resources.
[0017] In combination with the first aspect, in some implementations of the first aspect, 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.
[0018] The first device receives target data from the third device through the second device. That is, 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.
[0019] The data transmission method provided by the present application allows a first device to obtain target data from a second device, and the target data of the second device is sent by a third device. The existing data transmission method can be reused with minimal changes, which is conducive to application promotion.
[0020] In combination with the first aspect, in certain implementations of the first aspect, before sending information requesting target data to the third device through the second device, the method also includes: the first device determines whether the area into which the mouse drags the target data identifier is a preset area; and sending information requesting target data to the third device through the second device includes: when the area into which the target data identifier is dragged is the preset area, the first device sends information requesting target data to the third device through the second device.
[0021] The preset area is an area provided by the first device that allows data to be dragged in. It may vary depending on the application program, and this embodiment of the present application does not limit this.
[0022] If the area where the target data identifier is dragged is 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 area where the target data identifier is dragged is not the preset area, the drag operation fails, and the first device does not need to request the target data.
[0023] The data transmission method provided in the present application requests the target data from the third device through the second device when the area into which the target data is dragged is a preset area, which is conducive to displaying the dragged data in the preset area.
[0024] In combination with the first aspect, in certain implementations of the first aspect, the target data includes at least one of the following: text data, image data, document data, email data, compressed package data, music data, or video data.
[0025] In a second aspect, a data transmission method is provided, including: a third device detects a first operation of a user, the first operation is used to move an identifier of target data from the third device to the first device via a second device through a mouse, 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 third device responds to the first operation, and receives information requesting target data from the first device through the second device; the third device sends the target data to the first device.
[0026] In combination 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 establishes a data transmission channel with the first device; and the third device sends the target data to the first device through the data transmission channel.
[0027] In combination 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.
[0028] In combination with the second aspect, in some implementations of the second aspect, the third device sending the target data to the first device includes: the third device sending the target data to the first device through the second device.
[0029] In combination with the second aspect, in certain implementations of the second aspect, before receiving information requesting target data from the first device through the second device, the method also includes: the third device obtains a universal resource identifier (URI) identified by the target data in response to the first operation; and the third device determines the data corresponding to the URI as the target data.
[0030] When the third device detects the first operation, it may first obtain the URI identified by the target data, so as to determine the target data based on the URI.
[0031] In combination with the second aspect, in certain implementations of the second aspect, the target data includes at least one of the following: text data, image data, document data, email data, compressed package data, music data, or video data.
[0032] According to a third aspect, a data transmission method is provided, including: a second device detects a first operation of a user, the first operation is used to move an identifier of target data from a third device to the first device via the second device through a mouse, 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 second device receives information requesting target data from the first device in response to the first operation; and the second device sends information requesting target data to the third device.
[0033] The data transmission method provided in the present application is that after the second device receives the information requesting the target data, it sends the information requesting the target data to the third device, which is conducive to the first device and the third device completing the communication.
[0034] In combination with the third aspect, in certain implementations of the third aspect, before the second device sends information requesting target data to the third device, the method also includes: the second device determines the movement status as moving from the third device to the first device in response to the first operation; the second device sends information requesting target data to the third device, including: the second device sends information requesting target data to the third device based on the information requesting target data and the movement status.
[0035] The moving state may also be referred to as the dragging state, which is not limited in the present embodiment. The moving state may be dragging completed, dragged to the first device, dragged to the second device, or dragged to the third device, etc.
[0036] If the Move Status is "Drag to First Device," the target data is being moved from the third device to the first device. If the Move Status is "Drag to Third Device," the target data is being moved from the first device to the third device. If the Move Status is "Drag to Second Device," the target data is being moved from the first or third device to the second device. If the Move Status is "Drag Completed," the move operation is complete.
[0037] The second device may send information requesting target data to the third device based on the information requesting target data and the movement status to enable communication between the first device and the third device.
[0038] In combination with the third aspect, in some implementations of the third aspect, the method further includes: the second device receiving the target data from the third device; and the second device sending the target data to the first device.
[0039] In combination with the third aspect, in certain implementations of the third aspect, the target data includes at least one of the following: text data, image data, document data, email data, compressed package data, music data, or video data.
[0040] In a fourth aspect, a terminal device is provided, comprising: a processing module and a transceiver module. The processing module is configured to: detect a first operation by a user, wherein the first operation is to move a target data identifier from a third device via a second device to a third device via a mouse, wherein the third device supports keyboard and mouse traversal with the second device, and the second device supports keyboard and mouse traversal with the third device; and the transceiver module is configured to: in response to the first operation, send a request for the target data to the third device via the second device; and receive the target data from the third device.
[0041] In combination with the fourth aspect, in certain implementations of the fourth aspect, the processing module is further used to: establish a data transmission channel with a third device; and the transceiver module is further used to: receive target data from the third device through the data transmission channel.
[0042] In combination with the fourth aspect, in certain implementations of the fourth aspect, the processing module is further used to: dismantle the data transmission channel.
[0043] In combination with the fourth aspect, in certain implementations of the fourth aspect, the transceiver module is further used to: receive target data from a third device through the second device.
[0044] In combination with the fourth aspect, in certain implementations of the fourth aspect, the above-mentioned processing module is also used to: determine whether the area into which the mouse drags the target data identifier is a preset area; the above-mentioned transceiver module is also used to: when the area into which the target data identifier is dragged is a preset area, send information requesting the target data to the third device through the second device.
[0045] In combination with the fourth aspect, in certain implementations of the fourth aspect, the target data includes at least one of the following: text data, image data, document data, email data, compressed package data, music data, or video data.
[0046] In a fifth aspect, a terminal device is provided, comprising: a processing module and a transceiver module. The processing module is configured to: detect a first user operation, wherein the first operation is to move a target data identifier from a second device to a first device via a mouse, and keyboard and mouse traversal is supported between the second device and the first device; and the transceiver module is configured to: receive, via the second device, a request for target data from the first device in response to the first operation, and transmit the target data to the first device.
[0047] In combination with the fifth aspect, in certain implementations of the fifth aspect, the processing module is further used to: establish a data transmission channel with the first device; and the transceiver module is further used to: send target data to the first device through the data transmission channel.
[0048] In combination with the fifth aspect, in certain implementations of the fifth aspect, the processing module is further used to: dismantle the data transmission channel.
[0049] In combination with the fifth aspect, in some implementations of the fifth aspect, the above-mentioned transceiver module is further used to: send target data to the first device through the second device.
[0050] In combination with the fifth aspect, in certain implementations of the fifth aspect, the processing module is further used to: in response to the first operation, obtain a universal resource identifier URI identified by the target data; and determine the data corresponding to the URI as the target data.
[0051] In combination with the fifth aspect, in certain implementations of the fifth aspect, the target data includes at least one of the following: text data, image data, document data, email data, compressed package data, music data, or video data.
[0052] In a sixth aspect, a terminal device is provided, comprising: a processing module and a transceiver module. The processing module is configured to: detect a first user operation, wherein the first operation is to move a target data identifier from a third device to the first device via a mouse, and the third device supports keyboard and mouse traversal, and the first device supports keyboard and mouse traversal; and the transceiver module is configured to: receive a request for target data from the first device in response to the first operation; and transmit the request for target data to the third device.
[0053] In combination with the sixth aspect, in certain implementations of the sixth aspect, the above-mentioned processing module is also used to: in response to the first operation, determine the movement status as moving from the third device to the first device; the above-mentioned transceiver module is also used to: send information requesting target data to the third device based on the information requesting target data and the movement status.
[0054] In combination with the sixth aspect, in certain implementations of the sixth aspect, the transceiver module is further used to: receive target data from a third device; and send the target data to the first device.
[0055] In combination with the sixth aspect, in certain implementations of the sixth aspect, the target data includes at least one of the following: text data, image data, document data, email data, compressed package data, music data, or video data.
[0056] In a seventh aspect, the present application provides a terminal device, comprising a processor coupled to a memory and configured to execute instructions in the memory to implement the method of any possible implementation of any of the above aspects. Optionally, the device further comprises a memory. Optionally, the device further comprises a transceiver, the processor coupled to the transceiver.
[0057] In an eighth aspect, the present application provides a processor, comprising: an input circuit, an output circuit, and a processing circuit. The processing circuit is configured to receive a signal through the input circuit and transmit a signal through the output circuit, so that the processor executes the method in any possible implementation of any of the above aspects.
[0058] In a specific implementation, the processor may be a chip, the input circuit may be an input pin, the output circuit may be an output pin, and the processing circuit may be a transistor, a gate circuit, a trigger, or various logic circuits. The input signal received by the input circuit may be, for example, but not limited to, received and input by a receiver, and the signal output by the output circuit may be, for example, but not limited to, output to and transmitted by a transmitter. The input circuit and the output circuit may be the same circuit, which functions as an input circuit and an output circuit at different times. This application does not limit the specific implementation of the processor and various circuits.
[0059] In a ninth aspect, the present application provides a processing device comprising a processor and a memory. The processor is configured to read instructions stored in the memory and to 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.
[0060] Optionally, there are one or more processors and one or more memories.
[0061] Optionally, the memory may be integrated with the processor, or the memory may be provided separately from the processor.
[0062] In the specific implementation process, the memory can be a non-transitory memory, such as a read-only memory (ROM), which can be integrated on the same chip as the processor or be set on different chips. This application does not limit the type of memory and the setting method of the memory and the processor.
[0063] It should be understood that related data interaction processes, 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 receiving input capability information from the processor. Specifically, the output data of the processing can be output to the transmitter, and the input data received by the processor can come from the receiver. The transmitter and receiver can be collectively referred to as a transceiver.
[0064] The processing device in the above-mentioned ninth aspect can be a chip. The processor can be implemented by hardware or by software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc.; when implemented by software, the processor can be a general-purpose processor, which is implemented by reading the software code stored in the memory. The memory can be integrated in the processor or can be located outside the processor and exist independently.
[0065] In the tenth aspect, the present application provides a computer-readable storage medium, which stores a computer program (also referred to as code, or instructions) which, when run on a computer, enables the computer to execute a method in any possible implementation of any of the above aspects.
[0066] In the eleventh aspect, the present application provides a computer program product, which includes: a computer program (also referred to as code, or instructions), which, when executed, enables a computer to execute a method in any possible implementation of any of the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 It is a schematic diagram of transferring photos across devices;
[0068] Figure 2 This is a schematic diagram of a cross-device photo transmission method provided by an embodiment of the present application;
[0069] Figure 3 This is a schematic diagram of another method for transferring photos across devices provided by an embodiment of the present application;
[0070] Figure 4 This is another schematic diagram of transferring photos across devices provided by an embodiment of the present application;
[0071] Figure 5 This is a schematic diagram of a cross-device file transfer failure provided by an embodiment of the present application;
[0072] Figure 6 This is a software structure diagram of a PC provided in an embodiment of the present application;
[0073] Figure 7 This is a software structure diagram of an Android device provided in an embodiment of the present application;
[0074] Figure 8 is a schematic flow chart of a keyboard and mouse connection method provided in an embodiment of the present application;
[0075] Figure 9 is a schematic flow chart of a method for detecting mouse crossing provided in an embodiment of the present application;
[0076] Figure 10 This is a schematic diagram of establishing a screen coordinate system provided by an embodiment of the present application;
[0077] Figure 11 is a schematic flow chart of a data transmission method provided in an embodiment of the present application;
[0078] Figure 12 is a schematic flow chart of a method for acquiring data provided in an embodiment of the present application;
[0079] Figure 13 is a schematic flow chart of another method for acquiring data provided in an embodiment of the present application;
[0080] Figure 14 is a schematic diagram of a terminal device provided in an embodiment of the present application;
[0081] Figure 15 This is a schematic diagram of another terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0082] The technical solution in this application will be described below with reference to the accompanying drawings.
[0083] For the purpose of clearly describing the technical solutions of the embodiments of the present application, in the embodiments of the present application, the terms of "first", "second", etc. are used to distinguish the same or similar items with basically the same function and role. The skilled in the art can understand that the terms of "first", "second", etc. do not limit the quantity and execution order, and the terms of "first", "second", etc. also do not necessarily mean different.
[0084] It should be noted that in the present application, the words such as "exemplarily" or "for example" are used to represent as an example, illustration or description. Any embodiment or design scheme described as "exemplarily" or "for example" in the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. In fact, the words such as "exemplarily" or "for example" are intended to present the relevant concept in a specific way.
[0085] In addition, "at least one" means one or more, and "multiple" means two or more. The association relationship of the associated objects is described by "and / or", which means that there can be three kinds of relationships, for example, A and / or B can represent the following three cases: A exists alone, A and B exist together, and B exists alone, wherein A and B can be singular or plural. The character " / " generally represents an "or" relationship between the front and rear associated objects. "At least one of the following" or similar expressions means any combination of these items, including any combination of single item or multiple items. For example, at least one of a, b and c can represent: a, or b, or c, or a and b, or a and c, or b and c, or a, b and c, wherein a, b and c can be single or multiple.
[0086] To meet the needs of users in work and study, key mouse crossing can be supported between multiple terminal devices to realize cross-device collaboration. For example, after the user's computer, mobile phone and tablet are connected, the computer mouse and keyboard can be shared, that is, the user can control the mobile phone and tablet through the computer mouse and keyboard. For example, the user can drag the data such as files, texts and pictures of the mobile phone or tablet to the computer through the mouse, or the user can drag the data such as files, texts and pictures of the computer to the mobile phone or tablet through the mouse.
[0087] Exemplarily, Figure 1 A schematic diagram of cross-device transmission of a photo is shown. As Figure 1As shown in a in FIG, the communication system includes a computer 101, a mobile phone 102, and a tablet 103. Among them, the operating system of the computer 101 is the Windows system, and the operating system of the mobile phone 102 and the tablet 103 is the Android system. Keyboard and mouse can be passed between the computer 101 and the mobile phone 102, and keyboard and mouse can be passed between the computer 101 and the tablet 103. In other words, the computer 101, the mobile phone 102, and the tablet 103 can share a mouse and keyboard. In this case, the computer 101 can be called a source device or a sending end, and the mobile phone 102 and the tablet 103 can be called a peer device or a receiving end, but the embodiments of the present application are not limited to this.
[0088] After the keyboard and mouse of computer 101 are transferred to mobile phone 102 or tablet 103, cross-screen collaboration can be achieved. In other words, the user 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.
[0089] After the keyboard and mouse of the computer 101 are transferred to the mobile phone 102 or tablet 103, files, photos, music and other content can also be transferred across devices. In other words, the user can drag and drop files, photos, music and other content from the mobile phone 102 or tablet 103 to the computer 101, and can also drag and drop files, photos, music and other content from the computer 101 to the mobile phone 102 or tablet 103. It is understood that the embodiments of the present application are not limited to content such as files, photos and music.
[0090] like Figure 1 As shown in a in FIG, when the user takes a screenshot of the main interface of the mobile phone 102, the mobile phone 102 takes a screenshot in response to the user's screenshot operation and displays the picture in the lower left corner of the interface. The user can drag the picture to the desktop of the computer 101 by the mouse. When the computer 101 detects the user dragging the picture to the main interface of the computer 101, it can display the picture in response to the operation. Figure 1 b in. Figure 1 As shown in b, the computer 101 can display the drag icon of the picture, and accordingly, the picture in the lower right corner of the mobile phone 102 interface disappears. When the computer 101 detects that the user cancels the drag operation of the picture, in response to the operation, the picture can be saved to the file manager and the interface of the file manager is displayed, that is, Figure 1 In c. Figure 1 As shown in c, computer 101 saves the picture in the file manager, and names the picture as 20220405_1 by default, displays the picture format as png, displays the picture size as 302.08 kilobytes (kb), and displays the time of saving the picture as "just now".
[0091] In the above communication system, if a user wants to transfer a screenshot of the mobile phone 102 to the tablet 103, he can only first drag the data of the mobile phone 102 to the computer 101 using the mouse, and then drag the data from the computer 101 to the tablet 103 using the mouse. The data of the mobile phone cannot be directly transferred to the tablet, which reduces the data transmission efficiency and is cumbersome to operate, which is not conducive to the user experience.
[0092] In view of this, the embodiments of the present application provide a data transmission method that can improve data transmission efficiency, reduce user operations, and improve user experience. In other words, the user can use the mouse to drag data from the mobile phone 102 directly to the tablet 103 via the computer 101, or directly to the mobile phone 102 via the computer 101, without having to drag the data into the computer 101 first and then drag it to the tablet 103.
[0093] In order to better understand the embodiments of the present application, the scenarios in which the embodiments of the present application are used are first introduced.
[0094] Figure 2 A schematic diagram of transferring photos across devices is shown. Figure 2 As shown, the user drags the picture of the mobile phone 102 to the main interface of the tablet 103. Figure 2 As shown in a in FIG, when the user takes a screenshot of the main interface of the mobile phone 102, the mobile phone 102 takes a screenshot in response to the user's screenshot operation and displays the image in the lower left corner of the interface. The user can drag the image to the main interface of the tablet 103 through the computer 101 by using the mouse. When the computer 101 detects the user dragging the image to the main interface of the computer 101, it can display the image in response to the operation. Figure 2 b in. Figure 2 As shown in b, the computer 101 can display the drag icon A, and accordingly, the picture in the lower right corner of the mobile phone 102 interface disappears. The computer 101 detects the user's drag operation to the tablet 103, and in response to the operation, it can display Figure 2 In c. Figure 2 As shown in c in FIG, the tablet 103 may display a drag icon B. When the tablet 103 detects that the user cancels the drag operation on the picture, in response to the operation, the picture may be saved to the file manager and the interface of the file manager may be displayed, that is, the picture may be saved to the file manager. Figure 2 In d. Figure 2 As shown in d, the tablet 103 saves the picture to the file manager, and names the picture as 20220405_1 by default, displays the picture in a format of png, and displays the picture in a size of 302.08 kilobytes (kb).
[0095] It should be noted that the file manager can support any type of data, so the tablet 103 can be used to save data such as pictures, music, and files dragged to the main interface.
[0096] Figure 3 Another schematic diagram of transferring photos across devices is shown. Figure 3 As shown, the user drags the picture of the mobile phone 102 to the chat interface of the tablet 103. Figure 3 As shown in a in FIG, when the user takes a screenshot of the main interface of the mobile phone 102, the mobile phone 102 takes a screenshot in response to the user's screenshot operation and displays the picture in the lower left corner of the interface. The user can drag the picture to the chat interface of the tablet 103 through the computer 101 by mouse. When the computer 101 detects the operation of the user dragging the picture to the main interface of the computer 101, it can display Figure 3 b in. Figure 3 As shown in b, the computer 101 can display the drag icon A, and accordingly, the picture in the lower right corner of the mobile phone 102 interface disappears. The computer 101 detects the user's drag operation to the tablet 103, and in response to the operation, it can display Figure 3 In c. Figure 3 As shown in c, the tablet 103 can display the drag icon B on the chat interface. When the tablet 103 detects that the user cancels the drag operation on the picture, in response to the operation, the picture can be displayed on the chat interface, that is, displayed Figure 3 In d. Figure 3 As shown in d in FIG. 1 , the tablet 103 is displayed on the chat interface.
[0097] It should be noted that chat applications can support data types such as pictures and files and can allow data transmission.
[0098] Figure 4 FIG2 shows another schematic diagram of transferring photos across devices. Figure 4 As shown, the user drags the picture of the mobile phone 102 to the gallery application of the tablet 103. Figure 4 As shown in a in FIG, when the user takes a screenshot of the main interface of the mobile phone 102, the mobile phone 102 takes a screenshot in response to the user's screenshot operation and displays the image in the lower left corner of the interface. The user can drag the image to the gallery application of the tablet 103 through the computer 101 by mouse. When the computer 101 detects the user's operation of dragging the image to the main interface of the computer 101, it can display Figure 4 b in. Figure 4 As shown in b, the computer 101 can display the drag icon A, and accordingly, the picture in the lower right corner of the mobile phone 102 interface disappears. The computer 101 detects the user's drag operation to the tablet 103, and in response to the operation, it can display Figure 4 In c.Figure 4 As shown in c in FIG, the tablet 103 can display the drag icon B in the gallery application. When the tablet 103 detects that the user cancels the drag operation on the picture, in response to the operation, the picture can be saved to the gallery application, that is, displayed Figure 4 In d. Figure 4 As shown in d in FIG. 1 , the tablet 103 may display the picture in a gallery application.
[0099] It should be noted that the gallery application only supports the transmission of image data and does not allow the transmission of other data.
[0100] If the user drags a file to the Gallery app, but the Gallery app does not support the file format, the Gallery app does not save the dragged data and the dragging fails.
[0101] For example, Figure 5 A schematic diagram showing a failure in transferring files across devices is shown. Figure 5 As shown in a in the figure, the tablet 103 displays the interface of the file manager, which includes 2 documents, one of which is the meeting process and the other is the meeting content. The computer 101 displays the main interface, and the mobile phone 102 displays the interface of the gallery application, which includes 5 pictures. The 5 icons include photo 1, photo 2, photo 3, photo 4 and photo 5. If the user drags the meeting document in the tablet 103 to the gallery application of the mobile phone 102 via the computer 101, the tablet 103 detects that the user drags the document out of the screen and drags it to the computer 101. In response to the operation, it can display Figure 2 b in. Figure 2 As shown in b, the interface displayed by the tablet 103 only includes the meeting process document, and the computer 101 can display the drag icon A. The computer 101 detects the user dragging the document out of the screen and dragging it to the mobile phone 102. In response to this operation, it can display Figure 5 In c. Figure 5 As shown in c, the mobile phone 102 can display the drag icon B in the gallery application. When the mobile phone 102 detects that the user cancels the drag operation on the document, in response to the operation, it determines whether the document is a data type supported by the gallery application. If the document does not meet the data type supported by the gallery application, it can refuse to receive the document and can display Figure 4 In d. Figure 4 As shown in d, the tablet 103, the computer 101 and the mobile phone 102 display the initial interface before the drag operation without any change.
[0102] It should be noted that the drag icon B may vary depending on the data type of the dragged data. The correspondence between the data type and the drag icon B may be preset.
[0103] In order to achieve the above functions, the embodiments of the present application provide a specific implementation method for data transmission.
[0104] The method provided in the embodiment of the present application can be applied to a communication system for keyboard and mouse traversal, and the communication system includes three devices. Among them, the communication system can include a personal computer and an Android device. Among them, the Android device includes an Android device 1 and an Android device 2, such as the above Figure 1 In the communication system 100, the PC is computer 101, the mobile phone 102 can be Android device 1, and the tablet 103 can be Android device 2, but the embodiments of the present application are not limited thereto. A personal computer can be a desktop computer, a laptop (such as 101 above), a small laptop computer, a tablet computer, an ultrabook computer, or the like. The software system of the personal computer 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 computer (such as mobile phone 103 above), and the like.
[0105] In order to better understand the embodiments of the present application, the PC, Android device 1 and the software structure of the Android device 1 according to the embodiments of the present application are introduced below.
[0106] For example, Figure 6 Figure 1 shows a software structure diagram of a PC. Figure 6 As shown, the PC includes a business layer, a capability layer, and a driver layer.
[0107] The business layer includes applications, user interface (UI) interface implementation module, keyboard and mouse service module and drag module. Among them, applications include gallery, chat and file manager applications. The UI interface implementation module is used to provide a visual interface for users. For example, the UI interface implementation module can display the above Figure 1 The main interface shown in the figure is shown in the figure. The keyboard and mouse service module is used to call the keyboard virtualization capability module to realize keyboard and mouse cross-operation. The drag module is used to call the drag framework to monitor the user's drag operation.
[0108] The capability layer includes the drag and drop framework, the communication module (Magic Link), the PC Manager framework, the keyboard virtualization capability module, the audio system, and the storage system. The drag and drop framework supports user drag and drop operations. The communication module communicates with Android devices. The keyboard virtualization capability module receives and transmits keyboard and mouse events. The PC Manager framework manages PC Manager options. The audio system manages high-performance audio playback. The storage system stores data.
[0109] The driver layer includes Bluetooth driver, audio driver, WiFi driver, and human interface device (HID) driver.
[0110] Figure 7 A software structure block diagram of an Android device is shown. As shown, the Android device includes an application layer, an application framework layer, an Android runtime and system library, and a kernel layer. Figure 7
[0111] The application layer includes a keyboard and mouse service module, a UI interface implementation module, a drag module, a keyboard and mouse virtualization capability module, a communication module (magic link), and an application. The UI interface implementation module is configured to provide a visual interface for a user. For example, the UI interface implementation module is configured to display a main interface and an interface of an application, etc. The drag module is configured to call a drag framework to monitor a drag operation of a user. The keyboard and mouse virtualization capability module is configured to provide keyboard and mouse virtualization capability, i.e., to acquire a keyboard and mouse event and transmission of the keyboard and mouse event. The communication module is configured to provide a connection channel between devices and data capability transmission. The application includes a gallery, a chat, a file manager, and the like.
[0112] The application framework layer includes a drag framework, a multi-screen framework, an input management module, and a storage system. The drag framework is configured to provide a drag capability when a keyboard and mouse pass through. The input management module is configured to provide reporting of a keyboard and mouse event. The storage system is configured to store data. The multi-screen framework is configured to provide multi-screen operation of a keyboard and mouse.
[0113] The Android runtime and system library include a core library, a virtual machine, a surface manager, a media library, and a three-dimensional graphics processing library. The Android system runtime is responsible for scheduling and management of the Android system. The core library includes two parts: one part is a function function that needs to be called by Java language, and the other part is a core library of the Android. The application layer and the application framework layer run in the virtual machine. The virtual machine executes Java files of the application layer and the application framework layer into binary files. The virtual machine is configured to perform functions such as management of object life cycle, stack management, thread management, security and exception management, and garbage collection. The system library can include multiple functional modules, such as a surface manager, a media library, and a three-dimensional graphics processing library, etc.
[0114] The surface manager is configured to manage a display subsystem and to provide fusion of two-dimensional layers and three-dimensional layers for multiple applications. The media library supports playback and recording of multiple commonly used audio, video formats, and static image files, etc. The media library can support multiple audio and video encoding formats, such as JPG, PNG, etc. The three-dimensional graphics processing library is configured to implement three-dimensional graphics drawing, image rendering, synthesis, and layer processing, etc.
[0115] The kernel layer is the layer between hardware and software. It drives the hardware, making it work. It includes the Bluetooth driver, audio driver, Wi-Fi driver, virtual input driver (Uinput driver), and HID driver. The virtual input driver is used to inject input events.
[0116] In order to better understand the embodiments of the present application, the embodiments of the present application are combined with the above Figure 5 and Figure 6 The modules involved provide a detailed introduction to the methods provided in the embodiments of this application.
[0117] After the PC and Android device are successfully connected, before transferring data between the PC and Android device, you can first confirm whether the keyboard and mouse are connected successfully. If the connection is successful, data transmission can be performed.
[0118] For example, Figure 8 FIG. 8 is a schematic flow chart of a method 800 for connecting a keyboard and a mouse. Figure 8 As shown, the method 800 can be applied to a communication system including a PC and an Android device, for example, the communication system 100 described above, but the embodiment of the present application is not limited thereto. The software architecture diagram of the PC can be as follows: Figure 6 As shown, the software architecture diagram of the Android device can be as follows Figure 7 As shown, the embodiments of the present application are not limited thereto.
[0119] The method 800 may include the following steps:
[0120] S801. The keyboard and mouse service module of the PC establishes a transmission connection with the keyboard and mouse service module of the Android device.
[0121] After the PC is connected to the Android device, the keyboard and mouse service module of the PC and the keyboard and mouse service module of the Android device can establish a transmission connection. Wherein, the Android device is Android device 1 or Android device 2, which is not limited in this embodiment of the application.
[0122] S802. The keyboard and mouse service module of the PC sends instruction information for starting the keyboard and mouse service to the keyboard and mouse service module of the Android device. Correspondingly, the keyboard and mouse service module of the Android device receives the instruction information for starting the keyboard and mouse service.
[0123] The instruction information for starting the keyboard and mouse service is used to instruct the keyboard and mouse service module of the Android device to start the keyboard and mouse service.
[0124] The keyboard and mouse service is also the keyboard and mouse pass-through option. The instruction information for turning on the keyboard and mouse service is to instruct the keyboard and mouse service module of the Android device to turn on the keyboard and mouse pass-through option.
[0125] S803. The keyboard and mouse service module of the Android device determines whether the keyboard and mouse service is supported based on the instruction information for starting the keyboard and mouse service.
[0126] The key-mouse service is also referred to as a key-mouse crossing option, and the starting and stopping of the key-mouse service is determined by the user. The key-mouse service module of the Android device determines whether the key-mouse service is supported, that is, the key-mouse service module of the Android device determines whether the user has checked, selected, or started the key-mouse crossing option.
[0127] If the user has checked, selected, or started the key-mouse crossing option, the key-mouse service module of the Android device can support the key-mouse service. If the user has not checked, selected, or stopped the key-mouse crossing option, the key-mouse service module of the Android device does not support the key-mouse service and cannot perform key-mouse crossing.
[0128] S804, in the case of supporting the key-mouse service, the key-mouse service module of the Android device sends indication information of starting the key-mouse service to the key-mouse virtualization capability module of the Android device, and correspondingly, the key-mouse virtualization capability module of the Android device receives the indication information of starting the key-mouse service.
[0129] S805, the key-mouse virtualization capability module of the Android device registers a virtual input (Uinput) based on the indication information of starting the key-mouse service.
[0130] The Uinput is used to inject a key-mouse event.
[0131] S806, the key-mouse virtualization capability module of the Android device sends a registration result A to the key-mouse service module of the Android device, and correspondingly, the key-mouse service module of the Android device receives the registration result A.
[0132] The registration result A can be used to indicate whether the registration of the Uinput is successful. The registration result can be success or failure. In an embodiment, success and failure can be represented by binary identifiers. For example, 1 represents success, and 0 represents failure.
[0133] S807, based on the indication information of starting the key-mouse service, the key-mouse virtualization capability module of the Android device sends indication information of registering cursor position listening to the multi-screen framework module of the Android device, and correspondingly, the multi-screen framework module of the Android device receives the indication information of registering cursor position listening and registers cursor position listening.
[0134] After the multi-screen framework module registers the cursor position listening, the position of the cursor can be listened to.
[0135] It should be noted that the order between the registration of the Uinput and the sending of the indication information of registering the cursor position listening by the key-mouse virtualization capability module of the Android device based on the indication information of starting the key-mouse service is not limited, that is, the execution order of S805 and S808 is not limited in the embodiment of the application.
[0136] S808. The keyboard and mouse virtualization capability module of the Android device sends the registration result B to the keyboard and mouse service module of the Android device. Correspondingly, the keyboard and mouse service module of the Android device receives the registration result B.
[0137] The registration result B may be used to indicate whether the registration of the cursor position monitoring is successful. The registration result may be success or failure. In one embodiment, success and failure may be represented by binary identifiers. For example, 1 indicates success and 0 indicates failure.
[0138] S809: When the keyboard and mouse service is supported, the keyboard and mouse service module of the Android device sends an instruction message for registering a drag monitor to the drag management module of the Android device. Correspondingly, the keyboard and mouse virtualization capability module of the Android device receives the instruction message for registering a drag monitor.
[0139] It should be noted that when supporting keyboard and mouse services, there is no restriction on the order in which the keyboard and mouse service module of the Android device sends the indication information for starting the keyboard and mouse service and sends the indication information for registering for drag and drop monitoring. In other words, the embodiment of the present application does not limit the execution order of the above S804 and S809.
[0140] S810. The drag management module of the Android device sends instruction information for registering a drag monitor to the multi-screen framework module of the Android device. Correspondingly, the multi-screen framework module of the Android device receives the instruction information for registering a drag monitor.
[0141] 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 enabled, whether the registration of Uinput is successful, and whether the registration of cursor position monitoring is successful.
[0142] Exemplarily, processing result A may include keyboard and mouse service being enabled, Uinput being successfully registered, and cursor position monitoring being successfully registered.
[0143] S812. The keyboard and mouse service module of the Android device sends processing result A to the keyboard and mouse service module of the PC. Correspondingly, the keyboard and mouse service module of the PC receives processing result A.
[0144] S813: The keyboard and mouse service module of the PC sends instruction information for starting the keyboard and mouse service to the keyboard and mouse virtualization capability module of the PC. Correspondingly, the keyboard and mouse service module of the PC receives the instruction information for starting the keyboard and mouse service.
[0145] The above S802 and S813 are sent in parallel by the keyboard and mouse service module of the PC, so the above S802 to S812 and S813 to S818 are executed in parallel.
[0146] S814. The keyboard and mouse virtualization capability module of the PC registers a keyboard and mouse event monitor based on the instruction information for starting the keyboard and mouse service.
[0147] The PC's keyboard and mouse virtualization module registers a keyboard and mouse event listener to monitor keyboard and mouse events. For example, the PC's keyboard and mouse virtualization module can monitor keyboard presses and mouse movements, clicks, and drags.
[0148] S815. The keyboard and mouse virtualization capability module of the PC sets keyboard and mouse event interception based on the instruction information for starting the keyboard and mouse service.
[0149] When the keyboard and mouse pass through, 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 keyboard and mouse virtualization capability module of the PC sets the keyboard and mouse event interception to facilitate the interception of keyboard and mouse events after the keyboard and mouse pass through.
[0150] The embodiment of the present application does not limit the execution order of the above S814 and S815.
[0151] S816: The keyboard and mouse virtualization capability module of the PC saves the processing result B, where the processing result B includes whether the keyboard and mouse are successfully registered and whether the keyboard and mouse event interception is successfully set.
[0152] Exemplarily, processing result B may include successful registration of the keyboard and mouse components and successful setting of keyboard and mouse event interception.
[0153] S818. The keyboard and mouse virtualization capability module of the PC sends the processing result B to the keyboard and mouse service module of the PC. Correspondingly, the keyboard and mouse service module of the PC receives the processing result B.
[0154] S818. The keyboard and mouse service module of the PC sends processing result B to the keyboard and mouse service module of the Android device. Correspondingly, the keyboard and mouse service module of the Android device receives processing result B.
[0155] S819. The keyboard and mouse service module of the PC and the keyboard and mouse service module of the Android device may compare the processing result A with the processing result B to determine whether the keyboard and mouse are connected successfully.
[0156] If both processing result A and processing result B are successful, the keyboard and mouse service module of the PC and the keyboard and mouse service module of the Android device can determine that the keyboard and mouse connection is successful. If at least one of the results in processing result A and processing result B is a failure, the keyboard and mouse service module of the PC and the keyboard and mouse service module of the Android device can determine that the keyboard and mouse connection is unsuccessful.
[0157] If the keyboard and mouse service module of the PC and the keyboard and mouse service module of the Android device are not successfully connected, both are restored to the initialization state, that is, the above registration process is re-executed.
[0158] The method for connecting the keyboard and the mouse provided in the embodiments of the present application connects the keyboard and the mouse between different devices between data transmissions, so as to prepare for subsequent data transmission, and facilitates smooth data transmission.
[0159] It should be noted that the PC connects the keyboard and the mouse with the two Android devices in the same way, and the process is shown in the method 800.
[0160] After the method 800 is used to determine that the keyboard and the mouse are successfully connected, the PC and the Android device can perform data transmission.
[0161] Before introducing the data transmission, a method for detecting mouse crossing is introduced, and the PC and / or the Android device can listen to the mouse crossing based on the method.
[0162] Exemplarily, Figure 9 A schematic flowchart of a method 900 for detecting mouse crossing is shown. As Figure 9 shown, the method 900 can include the following steps:
[0163] S901, the keyboard virtualization capability module of the PC obtains the mouse position.
[0164] The mouse position is the coordinate of the mouse in the screen. The keyboard virtualization capability module of the PC can create a two-dimensional coordinate system in the screen, and the coordinate of the mouse in the two-dimensional coordinate system is the mouse position. The mouse position can be represented by (XRaw, YRaw), but the embodiments of the present application are not limited thereto.
[0165] Exemplarily, Figure 10 A schematic diagram of establishing a screen coordinate system is shown. As Figure 10 shown, a screen OABC establishes a coordinate system with the point O as the origin, the line OA as the X axis, and the line OC as the Y axis. The screen resolution is 1920*1080, the length of the line segment OA is equal to the length of the line segment CB, which is equal to 1920, and the length of the line segment OC is equal to the length of the line segment AB, which is equal to 1080. Therefore, in the coordinate system, the coordinate of the point O is (0, 0), the coordinate of the point A is (1920, 0), the coordinate of the point B is (1920, 1080), and the coordinate of the point C is (0, 1080). The mouse position is the coordinate of the mouse in the coordinate system, for example, the mouse position can be (1920, 960).
[0166] S902, when the keyboard virtualization capability module of the PC detects that the mouse moves, the mouse displacement is obtained.
[0167] The mouse displacement is the distance of the mouse movement. The mouse displacement can be represented by (Lx, Ly). Lx and Ly can be positive or negative, and the embodiments of the present application are not limited thereto.
[0168] S903, the keyboard virtualization capability module of the PC calculates the position of the mouse after moving based on the mouse position and the mouse displacement.
[0169] The position of the mouse after moving can be represented by (curX, curY). The position of the mouse after moving can be represented by the following formula: curX=XRaw+Lx; curY=YRaw+Ly.
[0170] S904, the keyboard virtualization capability module of the PC determines whether the position of the mouse after moving is out of the screen.
[0171] If curX is less than the minimum value of the screen in the X axis or greater than the maximum value of the screen in the X axis, the keyboard virtualization capability module of the PC can determine that the mouse is out of the screen. If curY is less than the minimum value of the screen in the Y axis or greater than the maximum value of the screen in the Y axis, the keyboard virtualization capability module of the PC can determine that the mouse is out of the screen.
[0172] If the position of the mouse after moving is out of the screen, it can be determined that the mouse is crossing, that is, S905 is executed. If the position of the mouse after moving is not out of the screen, the position of the mouse after moving can be determined as the current position, and the mouse moving is continuously acquired, that is, S902 is executed.
[0173] S905, if the position of the mouse after moving is out of the screen, the keyboard virtualization capability module of the PC can determine that the mouse is crossing.
[0174] The PC can also determine the crossing direction of the mouse, for example, the crossing direction is left crossing, right crossing, up crossing or down crossing.
[0175] Exemplarily, in the above Figure 10 In the example shown in the above
[0176] The detection method of the mouse crossing provided by the embodiment of the application can determine whether the mouse is out of the screen and determine the crossing direction through the mouse position and the mouse displacement, which is beneficial to improve the accuracy of detecting the mouse crossing.
[0177] The data transmission method provided by the embodiment of the application will be introduced below.
[0178] Exemplarily, Figure 111 shows a schematic flow chart of a data transmission method 1100. The method 1100 can be applied to a communication system including a PC and an Android device, wherein the Android device includes an Android device 1 and an Android device 2. For example, in the above communication system 100, the PC is a computer 101, but the embodiment of the present application is not limited thereto. The software architecture diagram of the PC can be as follows: Figure 6 As shown, the software architecture diagram of the Android device can be as follows Figure 7 As shown, the embodiments of the present application are not limited thereto.
[0179] The method 1100 may include the following steps:
[0180] S1101 : An application program on Android device 1 detects a user's operation of dragging out data.
[0181] The application may be at least one of a gallery, a chat, or a file manager, but the embodiments of the present application are not limited to gallery, chat, or file managers. The operation of the user dragging data may be an operation of the user dragging data with a mouse. The data dragged by the user may be pictures, files, text, compressed files, emails, music, videos, etc. It is understandable that the data dragged by the user may be any data that supports dragging and dropping, and the embodiments of the present application are not limited to this.
[0182] The Android device 1 may be the mobile phone 102 or the tablet 103 , which is not limited in this embodiment of the present application.
[0183] For example, in the above Figure 5 In the example shown, the Android device 1 may be a tablet 103 , and the application may be a file manager. The file manager detects an operation of the user dragging out a document.
[0184] S1102 : In response to the user's operation of dragging out data, the application of Android device 1 sends data drag-out information to the drag framework of Android device 1 . Correspondingly, the drag framework of Android device 1 receives the data drag-out information.
[0185] S1103 : The drag framework of Android device 1 sends the data dragged-out information to the drag module of Android device 1 based on the data dragged-out information. Correspondingly, the drag module of Android device 1 receives the data dragged-out information.
[0186] S1104 : The drag module of the Android device 1 obtains a universal resource identifier (URI) of the dragged data based on the information of the dragged data.
[0187] URI is used to represent the data to be operated on.
[0188] S1105 : The application of Android device 1 receives an operation of dragging the device out of the screen by the user.
[0189] The application of the Android device 1 can determine whether the user drags the data out of the screen based on the method 900.
[0190] S1106, the application of the Android device 1 sends a drag-out instruction to the drag module of the PC, and correspondingly, the drag module of the PC receives the drag-out instruction.
[0191] The PC can be the computer 101 described above, but the embodiments of the present application are not limited thereto.
[0192] The drag-out instruction is used to inform the drag module of the PC that the data has been dragged into the PC. The drag-out instruction can be represented by an identification bit, but the embodiments of the present application are not limited thereto. For example, the drag-out instruction can include an identification bit 1 to indicate that the data has been dragged into the PC.
[0193] It should be noted that S1106 is a simplified writing. The application of the Android device 1 cannot directly communicate with the drag module of the PC. The application of the Android device 1 can send the drag-out instruction to the drag framework of the Android device 1, which is transmitted to the drag module of the Android device 1, and then the drag module of the Android device 1 sends the drag-out instruction to the communication module of the Android device 1. After the communication module of the Android device 1 receives the drag-out instruction, it can be transmitted to the communication module of the PC, and finally the communication module of the PC sends the drag-out instruction to the drag module of the PC.
[0194] S1107, the drag module of the PC can record the drag state based on the drag-out instruction.
[0195] The drag state can be any one of the following: the drag is completed, the drag is to the PC, the drag is to the Android device 1, or the drag is to the Android device 2.
[0196] The drag module of the PC can record the drag state as the drag to the PC based on the drag-out instruction. If the drag module of the PC detects the operation of the user dragging in the data, the drag state can be recorded (or updated) as the drag is completed. If the drag module of the PC detects the operation of the user dragging out of the screen, the drag state can be recorded (or updated) as the drag is to the Android device 2.
[0197] S1108, the drag module of the PC detects the operation of the user dragging out of the screen.
[0198] S1109, the drag module of the PC can update the drag state in response to the operation of the user dragging out of the screen.
[0199] The drag module of the PC can update the drag state as the drag to the Android device 2 in response to the operation of the user dragging out of the screen.
[0200] S1110 : The drag module of the PC sends instruction information of dragging out of the screen to the drag module of the Android device 2 . Correspondingly, the drag module of the Android device 2 receives the instruction information of dragging out of the screen.
[0201] It should be noted that S1110 is a simplified writing method. The drag module of the PC cannot communicate directly with the drag module of the Android device 2. The drag module of the PC can first send the instruction information of dragging out of the screen to the communication module of the PC, and then the communication module of the PC sends the instruction information of dragging out of the screen to the communication module of the Android device 2, and finally the communication module of the Android device 2 sends the instruction information of dragging out of the screen to the drag module of the Android device 2.
[0202] In the above Figure 2 、 Figure 3 、 Figure 4 or Figure 5 In 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 the present application are not limited thereto.
[0203] S1111. The drag module of the Android device 2 calls the interface provided by the drag framework of the Android device 2 to initiate the drag based on the instruction information of dragging out of the screen, and draws an icon according to the image (bitmap) corresponding to the dragged data.
[0204] The drag module of the Android device 2 calls the drag framework to support the drag function. The drag module of the Android device 2 can display an icon at the mouse position according to the image (bitmap) corresponding to the dragged data.
[0205] The drag module of the Android device 2 can preset multiple data types and their corresponding bitmaps. For example, the data types may include pictures, files, text, videos, and music.
[0206] The drag module of the Android device 2 can determine the data type of the dragged data based on the indication information of the dragging out screen, and determine the bitmap based on the data type. The drag module of the Android device 2 can display an icon at the mouse position based on the bitmap.
[0207] The icon can be Figure 2 、 Figure 3 、 Figure 4 or Figure 5 , but the embodiments of the present application are not limited to this.
[0208] S1112: The drag framework block of Android device 2 determines whether the device is dragged into the draggable area.
[0209] The droppable area is an area where data can be dragged. If the user drags data into the droppable area, the application can display the dragged data in the droppable area. If the user does not drag data into the droppable area, the application does not allow the data to be dragged, and the user's drag operation fails.
[0210] S1113: If the item is dragged into the draggable area, the drag frame of Android device 2 sends a service callback message to the application of Android device 2. Correspondingly, the application of Android device 2 receives the service callback message. Based on the service callback message, the application of Android device 2 performs a service callback, that is, executes the service after the item is dragged.
[0211] The data transmission method provided in the embodiment of the present application can support users to drag from Android device 1 to Android device 2 via PC, thereby realizing data transmission across multiple devices. There is no need to drag from Android device 1 to PC first, and then from PC to Android device 2, which reduces the transfer of PC, is conducive to improving the efficiency of data transmission, and is conducive to avoiding cumbersome operations and improving user experience.
[0212] If the user drags the data from the Android device 1 to the Android device 2 via the PC, the Android device 2 can obtain the data from the Android device 1. The embodiment of the present application provides two methods for obtaining data.
[0213] In the first method of obtaining data, Android device 1 first sends the data to PC, and PC then sends the data to Android device 2.
[0214] For example, Figure 12 FIG. 1 is a schematic flow chart of a method 1200 for acquiring data. Figure 12 As shown, the method 1200 includes the following steps:
[0215] S1201: An application on Android device 2 detects a user's operation of dragging data.
[0216] The application can be at least one of a gallery, a chat, or a file manager, but the present embodiment is not limited to the gallery, the chat, or the file manager. The application of Android device 1 and the application of Android device 2 can be the same or different, and the present embodiment does not limit this.
[0217] For example, in the above Figure 3 In the example shown, the application of the Android device 2 is a chat application.
[0218] S1202 : In response to the user's operation of dragging data, the application of Android device 2 sends a data request message to the drag module of Android device 2 . Correspondingly, the drag module of Android device 2 receives the data request message.
[0219] The data request information is used to request the drag module of the Android device 2 to drag the data.
[0220] It should be noted that, in response to the user's operation of dragging data, the application of Android device 2 can first send information requesting data to the drag framework of Android device 2, and then the drag framework of Android device 2 sends the information requesting data to the drag module of Android device 2.
[0221] S1203 . The drag module of the Android device 2 sends the information of the requested data to the drag module of the PC based on the information of the requested data. Correspondingly, the drag module of the PC receives the information of the requested data.
[0222] It should be noted that, based on the information of the requested data, the drag module of the Android device 2 can first send the information of the requested data to the communication module of the Android device 2, and then the communication module of the Android device 2 sends the information of the requested data to the communication module of the PC, and finally the communication module of the PC sends the information of the requested data to the drag module of the PC.
[0223] S1204: The drag module of the PC determines whether it is a cross-PC drag operation based on the information of the request data and the drag state.
[0224] In the above method 900 , the dragging state is dragging to the Android device 2 , and the drag module of the PC may determine that the dragging operation is a cross-PC dragging operation.
[0225] S1205 , the drag module of the PC sends a data request message to the drag module of the Android device 1 , and correspondingly, the drag module of the Android device 1 receives the data request message.
[0226] It should be noted that the drag module of the PC can first send information requesting data to the communication module of the PC, and then the communication module of the PC sends information requesting data to the communication module of the Android device 1, and finally the communication module of the Android device 1 sends information requesting data to the drag module of the Android device 1.
[0227] S1206 : The drag module of the Android device 1 determines the drag data according to the URI of the data based on the information of the requested data.
[0228] The drag data may be a binary string, but the embodiment of the present application is not limited thereto.
[0229] S1207 : The drag module of the Android device 1 sends the drag data to the drag module of the PC. Correspondingly, the drag module of the PC receives the drag data.
[0230] It is understandable that the drag module of Android device 1 can first send the drag data to the communication module of the PC, and then the communication module of the PC sends the drag data to the communication module of Android device 2, and finally the communication module of Android device 2 sends the drag data to the drag module of Android device 2.
[0231] S1208. The drag module of the PC saves the drag data based on the drag data.
[0232] S1209 , the drag module of the PC sends the drag data to the communication module of the Android device 2 , and correspondingly, the communication module of the Android device 2 receives the drag data.
[0233] It is understandable that the drag module of the PC may first send the drag data to the communication module of the PC, and then the communication module of the PC may send the drag data to the communication module of the Android device 2 .
[0234] S1210 , the communication module of Android device 2 sends a message indicating successful data reception to the drag module of Android device 2 , and correspondingly, the drag module of Android device 2 receives the message indicating successful data reception.
[0235] The information of successful data reception is used to indicate that the communication module of the Android device 2 has successfully received the communication data.
[0236] The information on successful data reception may further include drag data, so that the drag module of the Android device 2 can obtain the drag data.
[0237] S1211 . The drag module of the Android device 2 sends the drag data to the application based on the information of successful data reception. Correspondingly, the application sends the drag data.
[0238] The application can also display drag data in the interface.
[0239] S1212. Based on the information about successful data reception, the drag module of the Android device 2 may also send information about successful data reception to the drag module of the PC. Correspondingly, the drag module of the PC receives the information about successful data reception.
[0240] The embodiment of the present application does not limit the execution order of S1211 and S1212.
[0241] S1213 : The drag module of the PC clears the drag data based on the information of successful data reception.
[0242] The drag module of the PC clears the drag data based on the information of successful data reception, and may also update the drag status, updating the drag status to drag completion.
[0243] In the method for obtaining data provided by the embodiment of the present application, when the Android device 2 requests to obtain the dragged data, the Android device 1 can first transfer the data to the PC, and then transfer the data from the PC to the Android device 2. Using the PC for data transfer is equivalent to first dragging the data from the Android device 1 to the PC. When dragging the data from the PC to the Android device 2, the existing data transmission method can be reused with minimal changes, which is conducive to application promotion.
[0244] Optionally, if the communication module of Android device 2 fails to successfully receive the drag data, it can request data from the drag module of PC again. The drag module of PC can send data to the communication module of Android device 2 based on the saved data, which can save the step of obtaining data and help improve data transmission efficiency.
[0245] It is understandable that if the user drags data from Android device 2 and drags it into Android device 1 via PC, the above method 1200 can also be used, as long as Android device 1 is changed to Android device 2, and Android device 2 is changed to Android device 1.
[0246] In the second method of obtaining data, the Android device 1 directly sends the data to the Android device 2, that is, the data does not pass through the PC.
[0247] For example, Figure 13 FIG. 1 is a schematic flow chart of a method 1300 for acquiring data. Figure 13 As shown, the method 1300 may include the above-mentioned steps S1201 to S1205, and may further include the following steps:
[0248] S1301. The drag module of the Android device 1 sends instruction information for establishing a transmission channel to the communication module of the Android device 1 based on the information of the requested data. Correspondingly, the communication module of the Android device 1 receives the instruction information for establishing the transmission channel.
[0249] 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.
[0250] 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 the transmission channel.
[0251] S1303: After the data transmission channel is established, the drag module of the Android device 1 sends the drag data to the communication module of the Android device 1. Correspondingly, the communication module of the Android device 1 receives the drag data.
[0252] S1304 : The communication module of Android device 1 sends the drag data to the communication module of Android device 2 through the data transmission channel. Correspondingly, the communication module of Android device 2 receives the drag data.
[0253] S1305 : The communication module of Android device 2 sends a message indicating that data has been successfully received to the drag module of Android device 2 . Correspondingly, the drag module of Android device 2 receives the message indicating that data has been successfully received.
[0254] The information of successful data reception is used to indicate that the communication module of the Android device 2 has successfully received the communication data.
[0255] The information on successful data reception may further include drag data, so that the drag module of the Android device 2 can obtain the drag data.
[0256] S1306 : The drag module of Android device 2 sends the drag data to the application based on the information of successful data reception. Correspondingly, the application sends the drag data.
[0257] The application can also display drag data in the interface.
[0258] S1307 . Based on the information of successful data reception, the drag module of the Android device 2 may also send information of successful data reception to the drag module of the PC. Correspondingly, the drag module of the PC receives the information of successful data reception.
[0259] The embodiment of the present application does not limit the execution order of S1306 and S1307.
[0260] S1308. The drag module of the PC updates the drag status based on the information of successful data reception.
[0261] The drag module of the PC updates the drag state to drag completion based on the information of successful data reception.
[0262] S1309 , the drag module of the PC sends a drag completion message to the drag module of the Android device 1 , and correspondingly, the drag module of the Android device 1 receives the drag completion message.
[0263] The drag completion message is used to indicate that the drag is completed.
[0264] S1310. The drag module of Android device 1 sends an instruction message for dismantling the channel to the communication module of Android device 1 based on the drag completion message. Correspondingly, the communication module of Android device 1 receives the instruction message for dismantling the channel and dismantles the data transmission channel based on the instruction message for dismantling the channel.
[0265] The instruction information for removing the channel is used to instruct the communication module of the Android device 1 to remove the channel.
[0266] The embodiment of the present application provides a method for obtaining data. When the Android device 2 requests to obtain the dragged data, the Android device 1 can transmit the data to the Android device 2 through the data transmission channel between the Android device 1 and the Android device 2, without the need for a PC to transfer the data, deliberately reducing the data transmission process and improving data transmission efficiency.
[0267] The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.
[0268] Combined with the above Figures 1 to 13 , describes the method provided in the embodiment of the present application in detail, and will be combined with Figure 14 and Figure 15 , describe in detail the equipment provided in the embodiments of this application.
[0269] Figure 14 FIG2 is a schematic diagram of a terminal device 1400 provided in an embodiment of the present application. The terminal device 1400 includes a processing module 1410 and a transceiver module 1420 .
[0270] In a possible implementation, the terminal device 1400 may execute the steps executed by the Android device 2 in the above embodiment.
[0271] Among them, the processing module 1410 is used to: detect the user's first operation, the first operation is used to move the identifier of the target data from the third device via the second device to through the mouse, the third device and the second device support keyboard and mouse crossing, and the second device and support keyboard and mouse crossing; the transceiver module 1420 is used to: respond to the first operation, send information requesting target data to the third device through the second device; receive target data from the third device.
[0272] In another possible implementation, the terminal device 1400 may execute the steps executed by the Android device 1 in the above embodiment.
[0273] Among them, the processing module 1410 is used to: detect the user's first operation, the first operation is used to move the identifier of the target data from the second device to the first device through the mouse, and the second device supports keyboard and mouse crossing, and the second device and the first device support keyboard and mouse crossing; the transceiver module 1420 is used to: respond to the first operation, receive information requesting target data from the first device through the second device; and send the target data to the first device.
[0274] In another possible implementation, the terminal device 1400 may execute the steps executed by the PC in the above embodiment.
[0275] Among them, the processing module 1410 is used to: detect the user's first operation, the first operation is used to move the identifier of the target data from the third device to the first device through the mouse, the third device supports keyboard and mouse traversal, and supports keyboard and mouse traversal with the first device; the transceiver module 1420 is used to: respond to the first operation, receive information requesting target data from the first device; send information requesting target data to the third device.
[0276] 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 an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a dedicated processor or a group processor, etc.) and a memory for executing one or more software or firmware programs, a combined logic circuit and / or other suitable components that support the described functions. In an optional example, those skilled in the art will understand that the terminal device 1400 can be specifically the Android device 2, PC or Android device 1 in the above method embodiment, or the functions of the Android device 2, PC or Android device 1 in the above method embodiment can be integrated in the terminal device 1400, and the terminal device 1400 can be used to execute the various processes and / or steps corresponding to the Android device 2, PC or Android device 1 in the above method embodiment. To avoid repetition, they are not described here.
[0277] The terminal device 1400 has the function of implementing the corresponding steps performed by the Android device 2, PC, or Android device 1 in the above method embodiment. 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.
[0278] In the embodiments of the present application, Figure 14 The terminal device 1400 may also be a chip or a chip system, such as a system on chip (SoC).
[0279] Figure 15 1 is a schematic block diagram of another terminal device 1500 provided in an embodiment of the present application. The terminal device 1500 includes a processor 1510, a transceiver 1520, and a memory 1530. The processor 1510, the transceiver 1520, and the memory 1530 communicate with each other via an internal connection path. 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 send and / or receive signals.
[0280] It should be understood that the terminal device 1500 can be specifically the Android device 2, PC or Android device 1 in the above method embodiment, or the functions of the Android device 2, PC or Android device 1 in the above method embodiment can be integrated into the terminal device 1500, and the terminal device 1500 can be used to execute the various steps and / or processes corresponding to the Android device 2, PC or Android device 1 in the above method embodiment. Optionally, the memory 1530 may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store device type information. The processor 1510 can be used to execute instructions stored in the memory, and when the processor executes the instruction, the processor can execute the various steps and / or processes corresponding to the terminal device in the above method embodiment.
[0281] It should be understood that in the embodiment of the present application, the processor 1510 may be a central processing unit (CPU), or 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. A general-purpose processor may be a microprocessor or any conventional processor.
[0282] During implementation, each step of the above method can be completed by an integrated logic circuit of hardware in a processor or by instructions in the form of software. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor. The software module can be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor executes the instructions in the memory, and completes the steps of the above method in conjunction with its hardware. To avoid repetition, it will not be described in detail here.
[0283] The present application also provides a computer-readable storage medium for storing a computer program for implementing the method corresponding to the Android device 2, PC or Android device 1 in the above method embodiment.
[0284] The present application also provides a chip system, which is used to support the Android device 2, PC or Android device 1 in the above method embodiment to implement the functions shown in the embodiment of the present application.
[0285] The present application also provides a computer program product, which includes a computer program (also called code, or instructions). When the computer program runs on a computer, the computer can execute the method corresponding to the Android device 2, PC or Android device 1 shown in the above method embodiment.
[0286] Those skilled in the art will appreciate that the modules and algorithm steps of each example 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 performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel 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.
[0287] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and modules described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0288] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0289] The modules described as separate components may or may not be physically separate, and 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 may be selected to achieve the purpose of the present embodiment according to actual needs.
[0290] In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0291] If the functions are implemented in the form of software function 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 the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0292] The above description is merely a specific embodiment of the present application, but the scope of protection of the embodiments of the present application is not limited thereto. Any person skilled in the art can easily conceive of changes or substitutions within the technical scope disclosed in the embodiments of the present application, and such changes or substitutions should be included in the scope of protection of the embodiments of the present application. Therefore, the scope of protection of the embodiments of the present application should be based on the scope of protection of the claims.
Claims
1. A data transmission method, characterized in that: include: The first device detects a first operation of a user, the first operation being to move an identifier of target data from an interface of a third device via an interface of a second device to an interface of 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 interface of the first device is located on the first device, the interface of the second device is located on the second device, and the interface of the third device is located on the third device; In response to the first operation, the first device sends information requesting the target data to the third device through the second device; The first device receives the target data from the third device.
2. The method according to claim 1, characterized in that The first device receiving the target data from the third device includes: 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.
3. The method according to claim 2, 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 removes the data transmission channel.
4. The method according to claim 1, wherein The first device receiving the target data from the third device includes: The first device receives the target data from the third device through the second device.
5. The method according to claim 1, wherein Before sending, through the second device, information requesting the target data to the third device, the method further includes: The first device determines whether the area where the target data identifier is dragged by the mouse is a preset area; The sending, through the second device, information requesting the target data to the third device includes: In a case where the area into which the target data identifier is dragged is the preset area, the first device sends information requesting the target data to the third device through the second device.
6. The method according to any one of claims 1 to 5, characterized in that The target data includes at least one of the following: Text data, image data, document data, email data, compressed package data, music data, or video data.
7. A data transmission method, characterized in that: include: The third device detects a first operation of the user, the first operation being to move a target data identifier from an interface of the third device via an interface of the second device to an interface of 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 interface of the first device is located on the first device, the interface of the second device is located on the second device, and the interface of the third device is located on the third device; In response to the first operation, the third device receives, through the second device, information requesting the target data from the first device; The third device sends the target data to the first device.
8. The method according to claim 7, characterized in that The third device sending the target data to the first device includes: 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.
9. The method according to claim 8, 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 removes the data transmission channel.
10. The method according to claim 7, characterized in that The third device sending the target data to the first device includes: The third device sends the target data to the first device through the second device.
11. The method according to claim 7, characterized in that Before receiving, through the second device, information requesting the target data from the first device, the method further includes: The third device obtains the universal resource identifier URI of the target data in response to the first operation; The third device determines the data corresponding to the URI as the target data.
12. The method according to any one of claims 7 to 11, characterized in that The target data includes at least one of the following: Text data, image data, document data, email data, compressed package data, music data, or video data.
13. A data transmission method, characterized in that: include: The second device detects a first operation of a user, the first operation being to move a target data identifier from an interface of a third device to an interface of the first device via an interface of the 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 interface of the first device is located on the first device, the interface of the second device is located on the second device, and the interface of the third device is located on the third device; In response to the first operation, the second device receives information requesting the target data from the first device; The second device sends information requesting the target data to the third device.
14. The method according to claim 13, characterized in that Before the second device sends 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 sending information requesting the target data to the third device includes: The second device sends information requesting the target data to the third device based on the information requesting the target data and the movement status.
15. The method according to claim 13, characterized in that The method further comprises: The second device receives the target data from the third device; The second device sends the target data to the first device.
16. The method according to any one of claims 13 to 15, characterized in that The target data includes at least one of the following: Text data, image data, document data, email data, compressed package data, music data, or video data.
17. A terminal device, characterized in that: include: A processor, the processor being coupled to a memory, the memory being used to store a computer program, wherein when the processor calls the computer program, the terminal device executes the method as claimed in any one of claims 1 to 6, claims 7 to 12, or claims 13 to 16.
18. A computer-readable storage medium, characterized in that For storing a computer program comprising instructions for implementing the method of any one of claims 1 to 6, claims 7 to 12 or claims 13 to 16.
19. A computer program product, characterized in that The computer program product includes computer program code, and when the computer program code is run on a computer, the computer is enabled to implement the method according to any one of claims 1 to 6, claims 7 to 12, or claims 13 to 16.
Citation Information
Patent Citations
Data transmission method and equipment
CN114077411A
Cross-device object dragging method and device
CN114089901A
File transmission method and related equipment
CN114356195A
Method and apparatus for providing service by using screen mirroring
US20150061972A1