WO2023005784A1 - Method for cross-system transmission of target object, and device - Google Patents

Method for cross-system transmission of target object, and device Download PDF

Info

Publication number
WO2023005784A1
WO2023005784A1 PCT/CN2022/106970 CN2022106970W WO2023005784A1 WO 2023005784 A1 WO2023005784 A1 WO 2023005784A1 CN 2022106970 W CN2022106970 W CN 2022106970W WO 2023005784 A1 WO2023005784 A1 WO 2023005784A1
Authority
WO
WIPO (PCT)
Prior art keywords
target object
application program
host
operating system
window
Prior art date
Application number
PCT/CN2022/106970
Other languages
French (fr)
Chinese (zh)
Inventor
王晓东
闫靖波
王海山
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023005784A1 publication Critical patent/WO2023005784A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/176Support for shared access to files; File sharing support
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04842Selection of displayed objects or displayed text elements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/0486Drag-and-drop
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiments of the present application relate to the technical field of electronics. Provided are a method for cross-system transmission of a target object, and a device. When an application program of a second operating system is run on a first operating system, the cross-system transmission of the target object can be realized on the basis of a simple operation of a user, and the operation is more adapted to the usage habits of the user based on the first operating system, thereby making the usage experience of the user better. The solution comprises: an electronic device displaying a first interface, wherein the first interface comprises a window of a first application program and a window of a second application program, the window of the first application program comprises a target object, the window of the second application program does not comprise the target object, and at least one of the first application program or the second application program is an application program of a second operating system; and in response to a dragging event in which the target object is dragged from the window of the first application program to the window of the second application program and is then released, the electronic device transmitting the target object to the second application program. The embodiments of the present application are used for the transmission of a target object.

Description

一种跨系统传输目标对象的方法及设备A method and device for transmitting target objects across systems
本申请要求于2021年07月30日提交国家知识产权局、申请号为202110871045.6、申请名称为“一种跨系统传输目标对象的方法及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the State Intellectual Property Office on July 30, 2021, with application number 202110871045.6, and application name "A method and device for transmitting target objects across systems", the entire content of which is incorporated by reference incorporated in this application.
技术领域technical field
本申请实施例涉及电子技术领域,尤其涉及一种跨系统传输目标对象的方法及设备。The embodiments of the present application relate to the field of electronic technology, and in particular to a method and device for transferring target objects across systems.
背景技术Background technique
随着电脑与手机的进一步生态融合,手机上的安卓(Android)应用程序可以通过虚拟化技术运行在Windows操作系统上,使得用户可以便捷地在Windows操作系统上使用Android应用程序。With the further ecological integration of computers and mobile phones, Android (Android) applications on mobile phones can run on Windows operating systems through virtualization technology, so that users can easily use Android applications on Windows operating systems.
在Windows操作系统运行了Android应用程序的情况下,Windows应用程序与Android应用程序之间可能需要频繁地交互文件。其中,由于Windows操作系统与Android操作系统属于完全不同的两种系统,实现逻辑和包括的组件等也都不同,因而两者之间的文件交互过程也比较复杂。In the case that the Windows operating system runs the Android application program, files may need to be frequently exchanged between the Windows application program and the Android application program. Among them, since the Windows operating system and the Android operating system are two completely different systems, the implementation logic and included components are also different, so the file interaction process between the two is also relatively complicated.
在Windows应用程序与Android应用程序之间进行文件交互时,用户需要进行多步、复杂的操作,用户使用体验较差。例如,用户想要将Windows资源管理器中的目标文件传输至Android应用程序时,需要先将Windows资源管理器中的目标文件放置在共享文件夹中,然后再通过在Android应用程序中寻找并选择目标文件,或者通过从Android文件管理中点击分享控件并选择目的Android应用程序,从而实现该目标文件的传输。示例性的,关于文档1的文件传输过程可以参见图1A中的(a)-(f),首先用户将Windows应用程序的窗口01中的文档1拖拽至共享文件夹,然后用户打开Android应用程序的窗口02,而后用户点击添加控件03后,选择共享文件夹,选择共享文件夹中的文档1,从而将文档1添加到Android应用程序的窗口中,用户需要进行一系列的复杂操作。When performing file interaction between Windows applications and Android applications, users need to perform multi-step and complicated operations, and the user experience is poor. For example, when the user wants to transfer the target file in the Windows Explorer to the Android application, he needs to first place the target file in the Windows Explorer in the shared folder, and then find and select the target file in the Android application The target file, or by clicking the share control from the Android file management and selecting the target Android application, so as to realize the transfer of the target file. Exemplarily, the file transfer process of document 1 can be referred to (a)-(f) in FIG. 1A. First, the user drags document 1 in window 01 of the Windows application to the shared folder, and then the user opens the Android application The window 02 of the program, and then the user clicks the add control 03, selects the shared folder, selects the document 1 in the shared folder, and then adds the document 1 to the window of the Android application, and the user needs to perform a series of complicated operations.
发明内容Contents of the invention
本申请实施例提供一种跨系统传输目标对象的方法及设备,能够在第一操作系统上运行了第二操作系统的应用程序的情况下,基于用户的简单操作,实现第一操作系统的应用程序与第二操作系统的应用程序之间的文件或文本交互,以及第二操作系统的不同应用程序之间的文件或文本交互,且该操作更符合用户基于第一操作系统的使用习惯,用户使用体验较好。The embodiment of the present application provides a method and device for transferring target objects across systems, which can realize the application of the first operating system based on the simple operation of the user when the application program of the second operating system is running on the first operating system. The file or text interaction between the program and the application program of the second operating system, and the file or text interaction between different application programs of the second operating system, and this operation is more in line with the user's usage habits based on the first operating system, and the user The experience is better.
为达到上述目的,本申请实施例采用如下技术方案:In order to achieve the above purpose, the embodiment of the present application adopts the following technical solutions:
一方面,本申请实施例提供了一种目标对象的传输方法,应用于电子设备,该电子设备运行有第一操作系统,第一操作系统上运行有第一操作系统的应用程序,且第一操作系统上基于模拟器运行有第二操作系统的应用程序。该方法包括:电子设备显示第一界面,第一界面包括第一应用程序的窗口和第二应用程序的窗口,第一应用程 序的窗口中包括目标对象,第二应用程序的窗口中不包括目标对象。其中,第一应用程序或第二应用程序中的至少一个为第二操作系统的应用程序。电子设备响应于目标对象从第一应用程序的窗口拖拽至第二应用程序的窗口后释放拖拽的拖拽事件,将目标对象传输至第二应用程序。On the one hand, the embodiment of the present application provides a method for transmitting a target object, which is applied to an electronic device, where the electronic device runs a first operating system, an application program of the first operating system runs on the first operating system, and the first An application program of the second operating system runs on the operating system based on the emulator. The method includes: the electronic device displays a first interface, the first interface includes a window of a first application program and a window of a second application program, the window of the first application program includes a target object, and the window of the second application program does not include a target object object. Wherein, at least one of the first application program or the second application program is an application program of the second operating system. The electronic device transmits the target object to the second application program in response to a drag event in which the target object is dragged from the window of the first application program to the window of the second application program and the drag is released.
例如,该拖拽事件可由用户的拖拽操作触发。这样,电子设备能够基于用户简单的拖拽操作,实现第一操作系统的应用程序与第二操作系统的应用程序之间的目标对象的交互,以及第一操作系统上第二操作系统的不同应用程序之间的目标对象的交互。并且,用户的该简单操作更符合用户基于第一操作系统的使用习惯,用户使用体验较好。例如,该目标对象可以包括文件、文本或其他可传输对象。For example, the drag event may be triggered by a user's drag operation. In this way, the electronic device can realize the target object interaction between the application program of the first operating system and the application program of the second operating system based on the simple drag operation of the user, and different applications of the second operating system on the first operating system Interaction of target objects between programs. Moreover, the simple operation of the user is more in line with the user's usage habits based on the first operating system, and the user experience is better. For example, the target object may include a file, text, or other transferable object.
在一种可能的设计中,该方法还包括:电子设备响应于目标对象从第一应用程序的窗口拖拽至第二应用程序的窗口后释放拖拽的拖拽事件,显示第二界面,第二界面包括第一应用程序的窗口和第二应用程序的窗口,第二应用程序的窗口中包括目标对象。In a possible design, the method further includes: the electronic device displays the second interface in response to a drag event in which the target object is dragged from the window of the first application to the window of the second application and the drag is released, and the second interface is displayed. The second interface includes a window of the first application program and a window of the second application program, and the window of the second application program includes the target object.
也就是说,电子设备将目标对象将第一应用程序传输至第二应用程序的后,可以在第二应用程序的窗口中显示该目标对象。That is to say, after the electronic device transfers the target object from the first application program to the second application program, the target object may be displayed in the window of the second application program.
在另一种可能的设计中,第一应用程序或第二应用程序中的一个为第二操作系统的应用程序,目标对象包括一个或多个文件,电子设备包括第一操作系统和第二操作系统的共享文件夹。电子设备将目标对象传输至第二应用程序,包括:电子设备基于共享文件夹,将目标对象传输至第二应用程序。In another possible design, one of the first application program or the second application program is an application program of the second operating system, the target object includes one or more files, and the electronic device includes the first operating system and the second operating system System shared folders. The electronic device transmitting the target object to the second application program includes: the electronic device transmitting the target object to the second application program based on the shared folder.
在该方案中,目标对象为目标文件,第一应用程序中的目标对象可以通过共享文件夹,传输至第二应用程序。In this solution, the target object is a target file, and the target object in the first application program can be transferred to the second application program through a shared folder.
在另一种可能的设计中,第一应用程序为第一操作系统的应用程序,第二应用程序为第二操作系统的应用程序;第一操作系统为模拟器的主机端Host,第二操作系统为模拟器的客户端Guest。电子设备基于共享文件夹,将目标对象传输至第二应用程序,包括:主机端Host将目标对象拷贝至共享文件夹;客户端Guest从共享文件夹获取目标对象;客户端Guest根据目标对象构建第二操作系统侧的拖拽事件,以将目标对象传输至第二应用程序。In another possible design, the first application program is the application program of the first operating system, and the second application program is the application program of the second operating system; the first operating system is the host end Host of the emulator, and the second operating system The system is the client Guest of the emulator. The electronic device transmits the target object to the second application program based on the shared folder, including: the host host Host copies the target object to the shared folder; the client Guest obtains the target object from the shared folder; Two drag events on the operating system side to transfer the target object to the second application program.
在该方案中,基于共享文件夹,第一操作系统应用程序中的目标对象,可以被传输至第二操作系统的应用程序中。In this solution, based on the shared folder, the target object in the application program of the first operating system can be transferred to the application program of the second operating system.
在另一种可能的设计中,在主机端Host将目标对象拷贝至共享文件夹之前,该方法还包括:主机端Host基于管道通信通知客户端Guest发生拖拽事件;主机端Host在拖拽释放后,基于管道通信将拖拽释放位置坐标和拽释放窗口对应的第二操作系统侧窗口标识和传输类型通知给客户端Guest;传输类型用于表示目标对象在第一操作系统的应用程序与第二操作系统的应用程序之间传输。若客户端Guest根据拖拽释放位置坐标和拽释放窗口对应的第二操作系统侧窗口标识确定释放位置允许拖拽,则基于传输类型通过管道通信通知主机端Host传输目标对象。主机端Host将目标对象拷贝至共享文件夹,包括:主机端Host将目标对象拷贝至共享文件夹,并基于管道通信将拷贝完成消息通知给客户端Guest。客户端Guest从共享文件夹获取目标对象,包括:客户端Guest接收到拷贝完成消息后,从共享文件夹获取目标对象。In another possible design, before the host-side Host copies the target object to the shared folder, the method further includes: the host-side Host notifies the client-side Guest of a drag event based on pipeline communication; Finally, based on the pipeline communication, the client Guest is notified of the coordinates of the dragging and releasing position and the identification of the side window of the second operating system corresponding to the dragging and releasing window, and the transmission type; Transfer between applications of two operating systems. If the client Guest determines that dragging is allowed at the release position according to the coordinates of the drag release position and the second operating system side window identifier corresponding to the drag release window, then based on the transfer type, the host host is notified to transfer the target object through pipeline communication. The host-side Host copies the target object to the shared folder, including: the host-side Host copies the target object to the shared folder, and notifies the client-side Guest of the copy completion message based on the pipeline communication. The client Guest acquires the target object from the shared folder, including: the client Guest acquires the target object from the shared folder after receiving the copy completion message.
也就是说,第一操作系统和第二操作系统之间可以基于管道通信进行通信交互,从而将第一操作系统应用程序中的目标对象传输至第二操作系统的应用程序中。That is to say, communication and interaction between the first operating system and the second operating system can be performed based on the pipe communication, so as to transmit the target object in the application program of the first operating system to the application program of the second operating system.
在另一种可能的设计中,主机端Host将目标对象拷贝至共享文件夹,并基于管道通信将拷贝完成消息通知给客户端Guest,包括:主机端Host每将目标对象中的单个文件拷贝至共享文件夹后,基于管道通信将拷贝完成消息通知给客户端Guest。客户端Guest从共享文件夹获取目标对象,包括:客户端Guest每接收到一次拷贝完成消息后,从共享文件夹获取目标对象的一个文件。客户端Guest根据目标对象构建第二操作系统侧的拖拽事件,以将目标对象传输至第二应用程序,包括:客户端Guest根据目标对象中的单个文件分别构建第二操作系统侧的拖拽事件,以将目标对象中的每个文件分别传输至第二应用程序。In another possible design, the host-side Host copies the target object to the shared folder, and notifies the client-side Guest of the copy completion message based on pipeline communication, including: every time the host-side Host copies a single file in the target object to After the folder is shared, the copy completion message is notified to the client Guest based on the pipeline communication. The client Guest acquires the target object from the shared folder, including: each time the client Guest receives a copy completion message, it acquires a file of the target object from the shared folder. The client Guest builds the drag event on the second operating system side according to the target object, so as to transfer the target object to the second application program, including: the client Guest builds the drag event on the second operating system side according to a single file in the target object event to transfer each file in the target object to the second application individually.
在该方案中,当目标对象包括多个文件时,电子设备可以将目标文件中的单个文件分别传输至第二应用程序。In this solution, when the target object includes multiple files, the electronic device may transmit a single file in the target file to the second application program respectively.
在另一种可能的设计中,拷贝完成消息包括拷贝完成的文件的文件名;或者,拷贝完成消息包括拷贝完成的文件的文件名信息和时间戳。In another possible design, the copy completion message includes the file name of the copied file; or, the copy completion message includes file name information and time stamp of the copied file.
这样,客户端Guest可以基于文件的文件名,以及时间戳,获取目标对象。In this way, the client Guest can obtain the target object based on the file name and timestamp of the file.
在另一种可能的设计中,该方法还包括:当拖拽位置进入第三应用程序的窗口后,第三应用程序为第二操作系统的应用程序,且第三应用程序与第二应用程序相同或不同,电子设备根据第三应用程序是否允许拖入目标对象,显示允许拖拽标识或禁止拖拽标识。In another possible design, the method further includes: after the dragging position enters the window of the third application program, the third application program is an application program of the second operating system, and the third application program and the second application program The same or different, the electronic device displays a drag-and-drop permission mark or a drag-and-drop mark according to whether the third application program allows the target object to be dragged in.
这样,电子设备可以通过显示允许拖拽标识或禁止拖拽标识,来实时提示用户当前位置是否允许拖入目标对象。In this way, the electronic device can prompt the user in real time whether dragging of the target object is allowed at the current location by displaying a drag-and-drop permission mark or a drag-and-drop mark.
在另一种可能的设计中,第一应用程序为第二操作系统的应用程序,第二应用程序为第一操作系统的应用程序;第一操作系统为模拟器的主机端Host,第二操作系统为模拟器的客户端Guest。电子设备基于共享文件夹,将目标对象传输至第二应用程序,包括:主机端Host构建第一操作系统侧的拖拽事件;客户端Guest将目标对象拷贝至共享文件夹;主机端Host取消第一操作系统侧的拖拽事件,将目标对象从共享文件夹,剪切至第二应用程序。In another possible design, the first application program is an application program of the second operating system, and the second application program is an application program of the first operating system; the first operating system is the host end Host of the emulator, and the second operating system The system is the client Guest of the emulator. The electronic device transmits the target object to the second application program based on the shared folder, including: the host-side Host builds a drag event on the first operating system side; the client-side Guest copies the target object to the shared folder; the host-side Host cancels the second A drag event on the operating system side cuts the target object from the shared folder to the second application program.
在该方案中,电子设备可以响应于用户的拖拽,并基于共享文件夹,将第二操作系统的应用程序中的目标对象剪切至第二应用程序。In this solution, the electronic device may cut the target object in the application program of the second operating system to the second application program based on the shared folder in response to the user's dragging.
在另一种可能的设计中,若第二应用程序为第一操作系统的资源管理器,则客户端Guest将目标对象拷贝至共享文件夹,包括:客户端Guest以单个文件为粒度,将目标对象中的每个文件分别拷贝至共享文件夹。主机端Host从共享文件夹将目标对象,剪切至第二应用程序,包括:主机端Host分别将目标对象中的每个文件从共享文件夹,剪切至第二应用程序。In another possible design, if the second application program is the resource manager of the first operating system, the client Guest copies the target object to the shared folder, including: the client Guest takes a single file as the granularity and copies the target object Each file in the object is copied to the shared folder individually. The Host at the host end cuts the target object from the shared folder to the second application program, including: the Host at the host end cuts each file in the target object from the shared folder to the second application program.
在该方案中,当目标对象包括多个文件时,电子设备可以响应于用户的拖拽,并基于共享文件夹,将第二操作系统的应用程序中目标对象包括的单个文件分别剪切至第二应用程序。In this solution, when the target object includes multiple files, the electronic device can respond to the user's drag and drop, and based on the shared folder, cut the single file included in the target object in the application program of the second operating system to the first file. Two applications.
在另一种可能的设计中,第一应用程序为第二操作系统的应用程序,第二应用程序为第一操作系统的应用程序;第一操作系统为模拟器的主机端Host,第二操作系统 为模拟器的客户端Guest。电子设备基于共享文件夹,将目标对象传输至第二应用程序,包括:主机端Host构建第一操作系统侧的拖拽事件;客户端Guest将目标对象拷贝至共享文件夹;主机端Host从共享文件夹获取目标对象;主机端Host基于第一操作系统侧的拖拽事件,将目标对象传输至第二应用程序,并结束第一操作系统侧的拖拽事件。In another possible design, the first application program is an application program of the second operating system, and the second application program is an application program of the first operating system; the first operating system is the host end Host of the emulator, and the second operating system The system is the client Guest of the emulator. The electronic device transmits the target object to the second application program based on the shared folder, including: the host-side Host constructs a drag event on the first operating system side; the client-side Guest copies the target object to the shared folder; The folder acquires the target object; the host-side Host transmits the target object to the second application program based on the drag event on the first operating system side, and ends the drag event on the first operating system side.
在该方案中,电子设备基于共享文件夹和构建的拖拽事件,将第二操作系统的应用程序中的目标对象传输至第二应用程序。In this solution, the electronic device transmits the target object in the application program of the second operating system to the second application program based on the shared folder and the constructed drag event.
在另一种可能的设计中,在客户端Guest将目标对象拷贝至共享文件夹之前,该方法还包括:客户端Guest基于管道通信通知主机端Host发生拖拽事件;在拖拽释放后,若拖拽释放窗口为第一操作系统应用程序的窗口,则主机端Host基于管道通信将传输类型通知给客户端Guest;传输类型用于表示目标对象在第一操作系统的应用程序与第二操作系统的应用程序之间传输;客户端Guest接收到传输类型后,基于管道通信通知主机端Guest传输目标对象。在客户端Guest将目标对象拷贝至共享文件夹之后,该方法还包括:客户端Guest将拷贝完成消息通知给主机端Host。In another possible design, before the client-side Guest copies the target object to the shared folder, the method further includes: the client-side Guest notifies the host-side Host of a drag event based on pipeline communication; after the drag-and-drop is released, if Drag and drop the window to be the window of the application program of the first operating system, then the host end Host notifies the client Guest of the transmission type based on the pipeline communication; the transmission type is used to indicate that the target object is between the application program of the first operating system and the second operating system After receiving the transfer type, the client-side Guest notifies the host-side Guest to transfer the target object based on the pipeline communication. After the client Guest copies the target object to the shared folder, the method further includes: the client Guest notifies the host host of a copy completion message.
在该方案中,第一操作系统和第二操作系统之间基于管道通信进行通信交互,从而将第二操作系统应用程序中的目标对象传输至第一操作系统的应用程序中。In this solution, the communication and interaction between the first operating system and the second operating system are performed based on pipeline communication, so that the target object in the application program of the second operating system is transferred to the application program of the first operating system.
在另一种可能的设计中,拷贝完成消息包括拷贝完成的文件的文件名;或者,拷贝完成消息包括拷贝完成的文件的文件名信息和时间戳。In another possible design, the copy completion message includes the file name of the copied file; or, the copy completion message includes file name information and time stamp of the copied file.
这样,主机端可以基于文件的文件名,以及时间戳,获取目标对象。In this way, the host can obtain the target object based on the file name and timestamp of the file.
在另一种可能的设计中,在客户端Guest基于管道通信通知主机端Host发生拖拽事件之后,该方法还包括:客户端Guest基于管道通信将目标对象的文件名信息和拖拽图标通知给主机端Host;主机端Host根据文件名信息构建第一操作系统侧的拖拽事件,并设置拖拽图标。In another possible design, after the client-side Guest notifies the host-side Host of the drag event based on pipeline communication, the method further includes: the client-side Guest notifies the target object's file name information and drag-and-drop icon to The host-side Host; the host-side Host constructs a drag event on the first operating system side according to the file name information, and sets a drag-and-drop icon.
这样,在用户拖拽目标对象的过程中,电子设备可以在界面上实时显示拖拽图标。In this way, during the process of the user dragging the target object, the electronic device can display the dragging icon on the interface in real time.
在另一种可能的设计中,第一应用程序和第二应用程序为第二操作系统的应用程序,目标对象包括一个或多个文件;电子设备将目标对象传输至第二应用程序,包括:电子设备基于管道通信,将目标对象传输至第二应用程序。In another possible design, the first application program and the second application program are applications of the second operating system, and the target object includes one or more files; the electronic device transmits the target object to the second application program, including: The electronic device transmits the target object to the second application program based on the pipe communication.
在该方案中,电子设备可以基于管道通信,将第二操作系统中第一应用程序中的目标对象,传输至第二应用程序。In this solution, the electronic device may transmit the target object in the first application program in the second operating system to the second application program based on pipe communication.
在另一种可能的设计中,电子设备基于管道通信,将目标对象传输至第二应用程序,包括:客户端Guest基于管道通信通知主机端Host发生拖拽事件。主机端Host构建第一操作系统侧的拖拽事件。在拖拽释放后,若主机端Host根据释放位置坐标确定拖拽释放窗口为第二操作系统其他应用程序的窗口,则基于管道通信将拖拽源窗口对应的第二操作系统侧窗口标识、拖拽释放位置、拽释放窗口对应的第二操作系统侧窗口标识和传输类型通知给客户端Guest。传输类型用于表示目标对象在第二操作系统的不同应用程序之间传输。若客户端Guest根据拖拽释放位置和拽释放窗口对应的第二操作系统侧窗口标识确定释放位置允许拖拽,则基于管道通信通知主机端Host传输目标对象。客户端Guest获取目标对象,并根据目标对象构建第二操作系统侧拖拽事件,以将目标对象传输至第二应用程序。In another possible design, the electronic device transmits the target object to the second application program based on the pipeline communication, including: the client Guest informs the host terminal Host of a drag event based on the pipeline communication. The host-side Host constructs a drag event on the first operating system side. After the drag and drop is released, if the host side Host determines that the drag and drop window is the window of other application programs in the second operating system according to the coordinates of the release position, then based on the pipeline communication, the second operating system side window ID corresponding to the drag source window, drag Notify the client Guest of the dragging position, the identifier of the second operating system side window corresponding to the dragging window, and the transmission type. The transfer type is used to indicate that the target object is transferred between different applications in the second operating system. If the client Guest determines that dragging is allowed at the release position according to the drag release position and the second operating system side window identifier corresponding to the drag release window, then the host-side Host is notified to transmit the target object based on the pipeline communication. The client Guest obtains the target object, and constructs a drag event on the second operating system side according to the target object, so as to transfer the target object to the second application program.
在该方案中,电子设备可以基于构建的拖拽事件,在第二操作系统的不同应用程序之间传输目标对象。In this solution, the electronic device can transfer the target object between different application programs of the second operating system based on the constructed drag event.
在另一种可能的设计中,Guest侧存储有目标对象的文件名信息。或者,客户端Guest基于管道通信通知主机端Host发生拖拽事件后,将目标对象的文件名信息通知给主机端Host;在拖拽释放后,主机端Host将文件名信息通知给客户端Guest。客户端Guest获取目标对象,包括:客户端Guest根据文件名信息,获取目标对象。In another possible design, the Guest side stores the file name information of the target object. Or, after the client Guest notifies the host Host of the drag event based on pipeline communication, it notifies the host Host of the file name information of the target object; after the drag and drop is released, the host Host notifies the client Guest of the file name information. The client Guest acquires the target object, including: the client Guest acquires the target object according to the file name information.
也就是说,目标对象的文件名信息可以在第二操作系统和第一操作系统之间进行传递,或者第二操作系统可以预先进行存储,以便在拖拽释放后根据该文件名信息获取目标对象,从而传输至第二应用程序。That is to say, the file name information of the target object can be transferred between the second operating system and the first operating system, or the second operating system can store it in advance, so that the target object can be obtained according to the file name information after dragging and dropping , which is transferred to the second application.
在另一种可能的设计中,该方法还包括:当拖拽位置进入第三应用程序的窗口后,第三应用程序为第二操作系统的应用程序,且第三应用程序与第二应用程序相同或不同,电子设备根据第三应用程序是否允许拖入目标对象,显示允许拖拽标识或禁止拖拽标识。In another possible design, the method further includes: after the dragging position enters the window of the third application program, the third application program is an application program of the second operating system, and the third application program and the second application program The same or different, the electronic device displays a drag-and-drop permission mark or a drag-and-drop mark according to whether the third application program allows the target object to be dragged in.
这样,电子设备可以通过显示允许拖拽标识或禁止拖拽标识,来提示用户当前位置是否允许拖拽。In this way, the electronic device may prompt the user whether dragging is allowed at the current location by displaying a dragging allowed sign or a dragging prohibited sign.
在另一种可能的设计中,在电子设备将将目标对象传输至第二应用程序之后,该方法还包括:电子设备将目标对象保存到第二应用程序的窗口内拖拽释放位置对应的目录下;或者,电子设备将目标对象通过第二应用程序发送给联系对象。In another possible design, after the electronic device transmits the target object to the second application program, the method further includes: the electronic device saves the target object to a directory corresponding to the drag-and-drop position in the window of the second application program or, the electronic device sends the target object to the contact object through the second application program.
也就是说,第二应用程序可以保存传输获得的目标对象,或者将该目标对象发送给联系对象。That is to say, the second application program can save the target object obtained by the transmission, or send the target object to the contact object.
在另一种可能的设计中,拖拽事件为用户使用鼠标进行的拖拽操作触发的事件,或者用户基于触摸屏的拖拽操作触发的事件。In another possible design, the drag event is an event triggered by a user's drag operation using a mouse, or an event triggered by a user's drag operation based on a touch screen.
也就是说,用户可以通过鼠标,或者通过触摸屏的触摸操作,来拖拽传输目标对象。That is to say, the user can drag and drop the transfer target object through a mouse or through a touch operation on a touch screen.
在另一种可能的设计中,目标对象为目标文本,电子设备将目标对象传输至第二应用程序,包括:电子设备基于管道通信,将目标对象传输至第二应用程序。In another possible design, the target object is target text, and the electronic device transmits the target object to the second application program, including: the electronic device transmits the target object to the second application program based on channel communication.
在该方案中,响应于用户的拖拽操作,电子设备可以基于管道通信,将第一应用程序中的目标文件传输至第二应用程序。In this solution, in response to the user's drag operation, the electronic device can transmit the target file in the first application program to the second application program based on pipe communication.
在另一种可能的设计中,第一应用程序为第一操作系统的应用程序,第二应用程序为第二操作系统的应用程序。电子设备基于管道通信,将目标对象传输至第二应用程序,包括:主机端Host基于管道通信通知客户端Guest发生拖拽事件。主机端Host在拖拽释放后,基于管道通信将拖拽释放位置坐标和拽释放窗口对应的第二操作系统侧窗口标识、传输类型和目标对象的文本内容通知给客户端Guest;传输类型用于表示目标对象在第一操作系统的应用程序与第二操作系统的应用程序之间传输。若客户端Guest根据拖拽释放位置坐标和拽释放窗口对应的第二操作系统侧窗口标识确定释放位置允许拖拽,则基于传输类型,根据文本内容构建第二操作系统侧拖拽事件,以将目标对象传输至第二应用程序。In another possible design, the first application program is an application program of the first operating system, and the second application program is an application program of the second operating system. The electronic device transmits the target object to the second application program based on the pipeline communication, including: the host-side Host notifies the client-side Guest of a drag event based on the pipeline communication. After the drag and drop, the host host host notifies the client Guest of the coordinates of the drag and drop position and the second operating system side window ID, transfer type, and text content of the target object corresponding to the drag release window based on pipeline communication; the transfer type is used for Indicates that the target object is transferred between the application program of the first operating system and the application program of the second operating system. If the client Guest determines that dragging is allowed at the release position according to the coordinates of the drag release position and the second operating system side window identifier corresponding to the drag release window, then based on the transmission type, a drag event on the second operating system side is constructed based on the text content, so as to The target object is transferred to the second application.
在该方案中,电子设备可以基于管道通信和构建的第二操作系统侧的拖拽事件,将目标对象传输至第二操作系统的第二应用程序。In this solution, the electronic device can transmit the target object to the second application program of the second operating system based on the pipe communication and the constructed drag event on the second operating system side.
在另一种可能的设计中,第一应用程序为第二操作系统的应用程序,第二应用程序为第一操作系统的应用程序。电子设备基于管道通信,将目标对象传输至第二应用程序,包括:客户端Guest基于管道通信通知主机端Host发生拖拽事件,并将目标对象的文本内容通知给主机端Host;主机端Host构建第一操作系统侧拖拽事件。在拖拽释放后,若主机端Host根据释放位置坐标确定拖拽释放窗口为第一操作系统应用程序的窗口,则基于管道通信将传输类型通知给客户端Guest;传输类型用于表示目标对象在第一操作系统的应用程序与第二操作系统的应用程序之间传输。若拖拽释放窗口为第一操作系统的资源管理器窗口,则主机端Host基于传输类型,取消第一操作系统侧拖拽事件,将目标对象剪切至第二应用程序。若拖拽释放窗口不是第一操作系统的资源管理器窗口,则主机端Host基于传输类型,通过第二操作系统侧拖拽事件将目标对象传输至第二应用程序,并结束第一操作系统侧拖拽事件。In another possible design, the first application program is an application program of the second operating system, and the second application program is an application program of the first operating system. The electronic device transmits the target object to the second application program based on the pipeline communication, including: the client Guest notifies the host-side Host of a drag event based on the pipeline communication, and notifies the host-side Host of the text content of the target object; the host-side Host builds Drag event on the first operating system side. After the drag is released, if the host side Host determines that the drag release window is the window of the first operating system application program according to the coordinates of the release position, then the transfer type is notified to the client Guest based on the pipeline communication; the transfer type is used to indicate that the target object is in The application program of the first operating system is transferred between the application program of the second operating system. If the drag-and-drop window is the resource manager window of the first operating system, the host-side Host cancels the drag event on the first operating system side based on the transmission type, and clips the target object to the second application program. If the drag-and-drop window is not the resource manager window of the first operating system, the host-side Host transfers the target object to the second application program through the drag event on the second operating system side based on the transfer type, and ends the process on the first operating system side. drag event.
在该方案中,电子设备可以基于管道通信和构建的拖拽事件,将第二操作系统应用程序中的目标对象,传输至第一操作系统的应用程序。In this solution, the electronic device can transmit the target object in the application program of the second operating system to the application program of the first operating system based on the pipe communication and the constructed drag event.
在另一种可能的设计中,第一应用程序和第二应用程序为第二操作系统的不同应用程序,电子设备基于管道通信,将目标对象传输至第二应用程序,包括:客户端Guest基于管道通信通知主机端Host发生拖拽事件,并将目标对象的文本内容通知给主机端Host。主机端Host构建第一操作系统侧的拖拽事件。在拖拽释放后,若主机端Host根据释放位置坐标确定拖拽释放窗口为第二操作系统其他应用程序的窗口,则基于管道通信将拖拽源窗口对应的第二操作系统侧窗口标识、拖拽释放位置、拽释放窗口对应的第二操作系统侧窗口标识、传输类型和文本内容通知给客户端Guest;传输类型用于表示目标对象在第二操作系统的不同应用程序之间传输。若客户端Guest根据拖拽释放位置和拽释放窗口对应的第二操作系统侧窗口标识确定释放位置允许拖拽,则基于传输类型获取目标对象,根据目标对象构建第二操作系统侧拖拽事件,以将目标对象传输至第二应用程序。In another possible design, the first application program and the second application program are different application programs of the second operating system, and the electronic device transmits the target object to the second application program based on pipeline communication, including: The pipeline communication notifies the Host of the drag event, and notifies the Host of the text content of the target object. The host-side Host constructs a drag event on the first operating system side. After the drag and drop is released, if the host side Host determines that the drag and drop window is the window of other application programs in the second operating system according to the coordinates of the release position, then based on the pipeline communication, the second operating system side window ID corresponding to the drag source window, drag Notify the client Guest of the location of the drag and drop, the ID of the side window of the second operating system corresponding to the window of the drag and release, the transfer type, and the text content; the transfer type is used to indicate that the target object is transferred between different applications of the second operating system. If the client Guest determines that the release position allows dragging according to the drag release position and the second operating system side window identifier corresponding to the drag release window, then obtains the target object based on the transfer type, and constructs a drag event on the second operating system side according to the target object, to transfer the target object to the second application.
在该方案中,电子设备可以基于管道通信和构建的拖拽事件,在第二操作系统的不同应用程序之间传输目标对象。In this solution, the electronic device can transfer the target object between different application programs of the second operating system based on the pipe communication and the constructed drag event.
在另一种可能的设计中,Guest侧存储有目标对象的文本内容;或者,客户端Guest基于管道通信通知主机端Host发生拖拽事件后,将目标对象的文本内容通知给主机端Host;在拖拽释放后,主机端Host将文本内容通知给客户端Guest;客户端Guest获取目标对象,包括:客户端Guest获取文本内容。In another possible design, the text content of the target object is stored on the Guest side; or, the client Guest notifies the host-side Host of the drag event based on pipeline communication, and then notifies the host-side Host of the text content of the target object; After dragging and releasing, the host-side Host notifies the client-side Guest of the text content; the client-side Guest obtains the target object, including: the client-side Guest obtains the text content.
也就是说,目标对象的文本内容可以在第二操作系统和第一操作系统之间进行传递,或者第二操作系统可以预先进行存储,以便在拖拽释放后将该文本内容传输至第二应用程序。That is to say, the text content of the target object can be transferred between the second operating system and the first operating system, or the second operating system can store it in advance, so that the text content can be transferred to the second application after dragging and dropping program.
另一方面,本申请实施例提供了一种目标对象的传输方法,应用于电子设备,该电子设备运行有第一操作系统,第一操作系统上运行有第一操作系统的应用程序,且第一操作系统上基于模拟器运行有第二操作系统的应用程序。该方法包括:电子设备显示第一界面,第一界面包括第一应用程序的窗口和第二应用程序的窗口,第一应用程序的窗口中包括目标对象,第二应用程序的窗口中不包括目标对象;其中,第一应用程序和第二应用程序为不同操作系统中的应用程序,目标对象包括一个或多个文件。 电子设备响应于针对第一应用程序的窗口中目标对象的目标事件,目标事件包括复制事件或剪切事件,以及第二应用程序的窗口中的粘贴事件,将目标对象传输至第二应用程序。On the other hand, an embodiment of the present application provides a method for transmitting a target object, which is applied to an electronic device, where the electronic device runs a first operating system, an application program of the first operating system runs on the first operating system, and the first operating system runs an application program of the first operating system. An application program of a second operating system runs on an emulator based on an operating system. The method includes: the electronic device displays a first interface, the first interface includes a window of a first application program and a window of a second application program, the window of the first application program includes a target object, and the window of the second application program does not include a target object object; wherein, the first application program and the second application program are application programs in different operating systems, and the target object includes one or more files. The electronic device transmits the target object to the second application in response to a target event, including a copy event or a cut event, for the target object in the window of the first application, and a paste event in the window of the second application.
例如,该复制事件或剪切事件可由用户简单的目标操作而触发,例如该目标操作可以是复制操作或剪切操作等。这样,电子设备能够基于用户简单的目标操作,实现第一操作系统的应用程序与第二操作系统的应用程序之间的目标对象的交互,以及第一操作系统上第二操作系统的不同应用程序之间的目标对象的交互。并且,用户的该简单操作更符合用户基于第一操作系统的使用习惯,用户使用体验较好。例如,该目标对象可以包括文件、文本或其他可传输对象。For example, the copy event or cut event may be triggered by a user's simple target operation, for example, the target operation may be a copy operation or a cut operation. In this way, the electronic device can realize the target object interaction between the application program of the first operating system and the application program of the second operating system based on the simple target operation of the user, and the different application programs of the second operating system on the first operating system interaction between target objects. Moreover, the simple operation of the user is more in line with the user's usage habits based on the first operating system, and the user experience is better. For example, the target object may include a file, text, or other transferable object.
在一种可能的设计中,电子设备包括第一操作系统和第二操作系统的共享剪贴板和共享文件夹。电子设备响应于针对第一应用程序的窗口中目标对象的目标事件,以及第二应用程序的窗口中的粘贴事件,将目标对象传输至第二应用程序,包括:电子设备响应于针对第一应用程序的窗口中目标对象的目标事件,以及第二应用程序的窗口中的粘贴事件,基于共享剪贴板将目标对象传输至第二应用程序。In a possible design, the electronic device includes a shared clipboard and a shared folder of the first operating system and the second operating system. The electronic device transmits the target object to the second application program in response to the target event for the target object in the window of the first application program and the paste event in the window of the second application program, including: the electronic device responds to the target object for the first application program A target event of the target object in the window of the program, and a paste event in the window of the second application program, transfer the target object to the second application program based on the shared clipboard.
在该方案中,电子设备可以基于共享剪贴板,跨系统传输目标对象。In this solution, the electronic device can transfer the target object across systems based on the shared clipboard.
在另一种可能的设计中,第一应用程序为第一操作系统的应用程序,第二应用程序为第二操作系统的程序,第一操作系统为模拟器的主机端Host,第二操作系统为模拟器的客户端Guest;电子设备响应于针对第一应用程序的窗口中目标对象的目标事件,以及第二应用程序的窗口中的粘贴事件,将目标对象传输至第二应用程序,包括:主机端Host响应于针对第一应用程序的窗口中目标对象的目标事件,将目标对象的路径信息存放到第一操作系统的剪贴板。主机端Host将第一操作系统的剪贴板中的路径信息同步到共享剪贴板。客户端Guest响应于第二应用程序的窗口中的粘贴事件,基于管道通信通知主机端Host传输目标对象。主机端Host将共享剪贴板中的路径信息对应的目标对象拷贝到共享文件夹,并将拷贝完成消息通知给客户端Guest。客户端Guest接收到拷贝完成消息后,将目标对象从共享文件夹复制到第二应用程序。In another possible design, the first application program is the application program of the first operating system, the second application program is the program of the second operating system, the first operating system is the host end Host of the emulator, and the second operating system For the client Guest of the emulator; the electronic device responds to the target event for the target object in the window of the first application program, and the paste event in the window of the second application program, and transmits the target object to the second application program, including: The host end Host stores the path information of the target object in the clipboard of the first operating system in response to the target event of the target object in the window of the first application program. The host side Host synchronizes the path information in the clipboard of the first operating system to the shared clipboard. The client Guest, in response to the paste event in the window of the second application program, notifies the host-side Host to transfer the target object based on the pipeline communication. The host-side Host copies the target object corresponding to the path information in the shared clipboard to the shared folder, and notifies the client-side Guest of a copy completion message. After receiving the copy completion message, the client Guest copies the target object from the shared folder to the second application program.
在该方案中,电子设备可以基于共享剪贴板,将目标对象从第一操作系统的应用程序传输至第二操作系统的应用程序。In this solution, the electronic device may transfer the target object from the application program of the first operating system to the application program of the second operating system based on the shared clipboard.
在另一种可能的设计中,客户端Guest基于管道通信通知主机端Host传输目标对象,包括:客户端Guest对第二应用程序对应的待粘贴目的路径,以及共享剪贴板中的路径信息对应的目标对象进行预检查,在预检查通过后基于管道通信通知主机端Host传输目标对象。主机端Host将共享剪贴板中的路径信息对应的目标对象拷贝到共享文件夹,包括:主机端Host确定源目标对象是否存在,若存在则将共享剪贴板中的路径信息对应的目标对象拷贝到共享文件夹。In another possible design, the client-side Guest notifies the host-side Host to transfer the target object based on pipeline communication, including: the target path to be pasted corresponding to the second application program by the client-side Guest, and the path information corresponding to the path information in the shared clipboard. The target object performs a pre-check, and after the pre-check passes, the host-side Host is notified to transmit the target object based on the pipeline communication. The host-side Host copies the target object corresponding to the path information in the shared clipboard to the shared folder, including: the host-side Host determines whether the source target object exists, and if it exists, copies the target object corresponding to the path information in the shared clipboard to Shared folder.
在该方案中,在目标对象的传输过程中,电子设备需要先进行相关的传输检查,在检查通过后,才能成功传输目标对象。In this solution, during the transmission process of the target object, the electronic device needs to perform relevant transmission checks first, and the target object can be successfully transmitted only after the check is passed.
在另一种可能的设计中,第一应用程序为第二操作系统的应用程序,第二应用程序为第一操作系统的程序,第一操作系统为模拟器的主机端Host,第二操作系统为模拟器的客户端Guest。电子设备响应于针对第一应用程序的窗口中目标对象的目标事件,以及第二应用程序的窗口中的粘贴事件,将目标对象传输至第二应用程序,包括:客 户端Guest响应于针对第一应用程序的窗口中目标对象的目标事件,将目标对象的路径信息存放到第二操作系统的剪贴板。客户端Guest将第二操作系统的剪贴板中的路径信息同步到共享剪贴板。主机端Host响应于第二应用程序的窗口中的粘贴操作,基于管道通信通知客户端Guest传输目标对象。客户端Guest将共享剪贴板中的路径信息对应的目标对象拷贝到共享文件夹,并将拷贝完成消息通知给主机端Host。主机端Host接收到拷贝完成消息后,将目标对象从共享文件夹复制到第二应用程序。In another possible design, the first application program is an application program of the second operating system, the second application program is a program of the first operating system, the first operating system is the host end Host of the emulator, and the second operating system It is the client Guest of the emulator. The electronic device transmits the target object to the second application program in response to the target event for the target object in the window of the first application program and the paste event in the window of the second application program, including: the client Guest responds to the target object for the first application program The target event of the target object in the window of the application program stores the path information of the target object into the clipboard of the second operating system. The client Guest synchronizes the path information in the clipboard of the second operating system to the shared clipboard. In response to the paste operation in the window of the second application program, the host-side Host notifies the client-side Guest to transmit the target object based on the pipeline communication. The client-side Guest copies the target object corresponding to the path information in the shared clipboard to the shared folder, and notifies the host-side Host of a copy completion message. After receiving the copy completion message, the Host at the host end copies the target object from the shared folder to the second application program.
在该方案中,电子设备可以基于共享剪贴板,将第二操作系统应用程序中的目标对象,传输至第一操作系统的应用程序。In this solution, the electronic device may transmit the target object in the application program of the second operating system to the application program of the first operating system based on the shared clipboard.
在另一种可能的设计中,主机端Host基于管道通信通知客户端Guest传输目标对象,包括:主机端Host对第二应用程序对应的待粘贴目的路径,以及共享剪贴板中的路径信息对应的目标对象进行预检查,在预检查通过后基于管道通信通知客户端Guest传输目标对象。客户端Guest将共享剪贴板中的路径信息对应的目标对象拷贝到共享文件夹,包括:客户端Guest确定源目标对象是否存在,若存在则将共享剪贴板中的路径信息对应的目标对象拷贝到共享文件夹。In another possible design, the host-side Host notifies the client-side Guest to transfer the target object based on pipeline communication, including: the host-side Host corresponds to the destination path to be pasted to the second application program, and the path information corresponding to the path information in the shared clipboard. The target object is pre-checked, and after the pre-check is passed, the client Guest is notified to transmit the target object based on the pipeline communication. The client Guest copies the target object corresponding to the path information in the shared clipboard to the shared folder, including: the client Guest determines whether the source target object exists, and if it exists, copies the target object corresponding to the path information in the shared clipboard to Shared folder.
在该方案中,在目标对象的传输过程中,电子设备需要先进行相关的传输检查,在检查通过后,才能成功传输目标对象。In this solution, during the transmission process of the target object, the electronic device needs to perform relevant transmission checks first, and the target object can be successfully transmitted only after the check is passed.
在另一种可能的设计中,在电子设备将将目标对象传输至第二应用程序之后,该方法还包括:电子设备将目标对象保存到第二应用程序的窗口内拖拽释放位置对应的目录下;或者,电子设备将目标对象通过第二应用程序发送给联系对象。In another possible design, after the electronic device transmits the target object to the second application program, the method further includes: the electronic device saves the target object to a directory corresponding to the drag-and-drop position in the window of the second application program or, the electronic device sends the target object to the contact object through the second application program.
也就是说,第二应用程序可以保存传输获得的目标对象,或者将该目标对象发送给联系对象。That is to say, the second application program can save the target object obtained by the transmission, or send the target object to the contact object.
在另一种可能的设计中,目标事件为复制事件,复制事件由以下任意操作触发:用户针对目标对象使用键盘快捷键的复制操作,用户针对目标对象使用鼠标右键选择复制的操作,用户针对目标对象长按鼠标左键后选择复制的操作,或用户基于触摸屏长按目标对象后选择复制的操作。粘贴事件由以下任意操作触发:用户针对目标对象使用键盘快捷键的粘贴操作,用户针对目标对象使用鼠标右键选择粘贴的操作,用户针对目标对象长按鼠标左键后选择粘贴的操作,或用户基于触摸屏长按目标对象后选择粘贴的操作。In another possible design, the target event is a copy event, and the copy event is triggered by any of the following operations: the user uses a keyboard shortcut to copy the target object, the user uses the right The object selects the copy operation after long pressing the left mouse button, or the user selects the copy operation after long pressing the target object based on the touch screen. The paste event is triggered by any of the following operations: the user uses a keyboard shortcut to paste the target object, the user uses the right mouse button to select the paste operation on the target object, the user selects the paste operation after long pressing the left mouse button on the target object, or Select the paste operation after long pressing the target object on the touch screen.
也就是说,电子设备可以响应于用户的复制操作和粘贴操作,将第一应用程序中的目标对象传输至第二应用程序,并保留第一应用程序中的目标对象。That is to say, the electronic device can transmit the target object in the first application program to the second application program in response to the user's copy operation and paste operation, and retain the target object in the first application program.
在另一种可能的设计中,目标事件为剪切事件,在电子设备将目标对象传输至第二应用程序之后,该方法还包括:电子设备删除第一应用程序中的目标对象。In another possible design, the target event is a cut event, and after the electronic device transmits the target object to the second application program, the method further includes: the electronic device deletes the target object in the first application program.
也就是说,电子设备可以响应于用户的剪切操作和粘贴操作,将第一应用程序中的目标对象传输至第二应用程序,并删除第一应用程序中的目标对象。That is to say, the electronic device may transmit the target object in the first application program to the second application program and delete the target object in the first application program in response to the user's cut operation and paste operation.
在另一种可能的设计中,共享文件夹为Virtio-9p共享文件夹,管道通信为Qemu Pipe。In another possible design, the shared folder is a Virtio-9p shared folder and the pipe communication is Qemu Pipe.
这样,第一应用程序和第二应用程序之间可以基于Virtio-9p共享文件夹和Qemu Pipe,来传输目标对象。In this way, the target object can be transferred between the first application program and the second application program based on the Virtio-9p shared folder and Qemu Pipe.
在另一种可能的设计中,第一操作系统为Windows操作系统,第二操作系统为安 卓Android操作系统。In another possible design, the first operating system is a Windows operating system, and the second operating system is an Android operating system.
这样,Windows操作系统和Android操作系统的应用程序之间可以跨系统传输目标对象,或者Android操作系统的不同应用程序之间可以传输目标对象。In this way, the target object can be transferred across systems between the applications of the Windows operating system and the Android operating system, or the target object can be transferred between different application programs of the Android operating system.
又一方面,本申请实施例提供了一种目标对象传输装置,该装置包含在电子设备中,该装置具有实现上述方面及可能的设计中任一方法中电子设备行为的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括至少一个与上述功能相对应的模块或单元。例如,显示模块或单元、传输模块或单元和处理模块或单元等。In yet another aspect, an embodiment of the present application provides an apparatus for transmitting a target object, the apparatus is included in an electronic device, and the apparatus has a function of implementing the behavior of the electronic device in any method in the above aspects and possible designs. This function may be implemented by hardware, or may be implemented by executing corresponding software on the hardware. Hardware or software includes at least one module or unit corresponding to the above functions. For example, a display module or unit, a transmission module or unit, a processing module or unit, and the like.
另一方面,本申请实施例提供了一种电子设备,该电子设备可以包括屏幕,用于显示界面;一个或多个处理器;存储器;以及一个或多个计算机程序;其中,一个或多个计算机程序被存储在存储器中,一个或多个计算机程序包括指令;当指令被处理器执行时,使得电子设备执行上述方面任一项可能的设计中的目标对象的传输方法。On the other hand, an embodiment of the present application provides an electronic device, which may include a screen for displaying an interface; one or more processors; memory; and one or more computer programs; wherein, one or more The computer program is stored in the memory, and one or more computer programs include instructions; when the instructions are executed by the processor, the electronic device is made to execute the target object transmission method in any possible design of the above aspects.
又一方面,本申请实施例提供了一种电子设备,该电子设备可以包括一个或多个处理器;存储器;以及一个或多个计算机程序;其中,一个或多个计算机程序被存储在存储器中,一个或多个计算机程序包括指令;当指令被处理器执行时,使得电子设备执行上述方面任一项可能的设计中的目标对象的传输方法。In yet another aspect, an embodiment of the present application provides an electronic device, which may include one or more processors; memory; and one or more computer programs; wherein, one or more computer programs are stored in the memory , one or more computer programs include instructions; when the instructions are executed by the processor, the electronic device is made to execute the target object transmission method in any possible design of the above aspects.
另一方面,本申请实施例提供了一种计算机可读存储介质,包括计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行上述方面任一项可能的设计中的目标对象的传输方法。On the other hand, an embodiment of the present application provides a computer-readable storage medium, including computer instructions. When the computer instructions are run on the electronic device, the electronic device performs the transmission of the target object in any possible design of the above aspects. method.
又一方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行上述方面任一项可能的设计中的目标对象的传输方法。In yet another aspect, an embodiment of the present application provides a computer program product, which, when the computer program product is run on a computer, causes the computer to execute the target object transmission method in any possible design of the above aspect.
本申请其他方面的有益效果可以参见上述方法方面有益效果的相关描述,不予赘述。For the beneficial effects of other aspects of the present application, reference may be made to the relevant description of the beneficial effects of the above methods, and details are not repeated here.
附图说明Description of drawings
图1A为现有技术提供的一种跨系统文件传输过程界面示意图;FIG. 1A is a schematic diagram of a cross-system file transfer process interface provided by the prior art;
图1B为现有技术提供的一种跨系统文件传输过程示意图;FIG. 1B is a schematic diagram of a cross-system file transfer process provided by the prior art;
图2为本申请实施例提供的一种目标对象的传输架构示意图;FIG. 2 is a schematic diagram of a transmission architecture of a target object provided by an embodiment of the present application;
图3为本申请实施例提供的一种电子设备的结构示意图;FIG. 3 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
图4为本申请实施例提供的另一种目标对象的传输架构示意图;FIG. 4 is a schematic diagram of another target object transmission architecture provided by the embodiment of the present application;
图5为本申请实施例提供的一组界面示意图;Fig. 5 is a schematic diagram of a group of interfaces provided by the embodiment of the present application;
图6A为本申请实施例提供的一种目标对象的传输过程示意图;FIG. 6A is a schematic diagram of a transmission process of a target object provided by an embodiment of the present application;
图6B为本申请实施例提供的一种目标对象的传输流程图;FIG. 6B is a flow chart of the transmission of a target object provided by the embodiment of the present application;
图6C为本申请实施例提供的另一种目标对象的传输流程图;FIG. 6C is a flow chart of another target object transmission provided by the embodiment of the present application;
图7A为本申请实施例提供的一组拖拽传输文件的界面示意图;FIG. 7A is a schematic interface diagram of a group of drag-and-drop transfer files provided by the embodiment of the present application;
图7B为本申请实施例提供的另一组拖拽传输文件的界面示意图;FIG. 7B is a schematic interface diagram of another group of drag-and-drop transfer files provided by the embodiment of the present application;
图7C为本申请实施例提供的一组拖拽传输文本的界面示意图;Fig. 7C is a schematic diagram of an interface of a group of drag-and-drop transfer texts provided by the embodiment of the present application;
图8A为本申请实施例提供的一种目标对象的传输过程示意图;FIG. 8A is a schematic diagram of a transmission process of a target object provided by the embodiment of the present application;
图8B为本申请实施例提供的一种目标对象的传输流程图;FIG. 8B is a flow chart of the transmission of a target object provided by the embodiment of the present application;
图8C为本申请实施例提供的另一种目标对象的传输流程图;FIG. 8C is a flow chart of another target object transmission provided by the embodiment of the present application;
图9为本申请实施例提供的一组拖拽传输文件的界面示意图;FIG. 9 is a schematic diagram of an interface of a group of drag-and-drop transfer files provided by the embodiment of the present application;
图10为本申请实施例提供的一组确定目的端为Windows资源管理器的流程图;Fig. 10 is a set of flow charts for determining that the destination is Windows Explorer provided by the embodiment of the present application;
图11A为本申请实施例提供的一种目标对象的传输过程示意图;FIG. 11A is a schematic diagram of a transmission process of a target object provided by an embodiment of the present application;
图11B为本申请实施例提供的一种目标对象的传输流程图;Fig. 11B is a flow chart of the transmission of a target object provided by the embodiment of the present application;
图11C为本申请实施例提供的另一种目标对象的传输流程图;FIG. 11C is a flow chart of another target object transmission provided by the embodiment of the present application;
图12为本申请实施例提供的一组拖拽传输文件的界面示意图;Fig. 12 is a schematic diagram of an interface of a group of drag-and-drop transfer files provided by the embodiment of the present application;
图13A为本申请实施例提供的一种目标对象的传输流程图;FIG. 13A is a flow chart of a target object transmission provided by the embodiment of the present application;
图13B为本申请实施例提供的另一种目标对象的传输流程图;FIG. 13B is a flow chart of another target object transmission provided by the embodiment of the present application;
图14为本申请实施例提供的一组复制文件的界面示意图;Fig. 14 is a schematic interface diagram of a group of copied files provided by the embodiment of the present application;
图15为本申请实施例提供的一组剪切文件的界面示意图;Fig. 15 is a schematic interface diagram of a group of cut files provided by the embodiment of the present application;
图16为本申请实施例提供的一组复制文本的界面示意图;Fig. 16 is a schematic interface diagram of a group of copied texts provided by the embodiment of the present application;
图17为本申请实施例提供的一种目标对象的传输流程图;Fig. 17 is a flow chart of the transmission of a target object provided by the embodiment of the present application;
图18为本申请实施例提供的一组复制文件的界面示意图;Fig. 18 is a schematic interface diagram of a group of copied files provided by the embodiment of the present application;
图19为本申请实施例提供的一种目标对象的传输流程图;Fig. 19 is a flow chart of the transmission of a target object provided by the embodiment of the present application;
图20为本申请实施例提供的一组复制文件的界面示意图。FIG. 20 is a schematic diagram of an interface of a group of copied files provided by the embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,在本申请实施例的描述中,“多个”是指两个或多于两个。The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. Among them, in the description of the embodiments of this application, unless otherwise specified, "/" means or means, for example, A/B can mean A or B; "and/or" in this article is only a description of associated objects The association relationship of indicates that there may be three kinds of relationships, for example, A and/or B may indicate: A exists alone, A and B exist simultaneously, and B exists independently. In addition, in the description of the embodiments of the present application, "plurality" refers to two or more than two.
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。Hereinafter, the terms "first" and "second" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of indicated technical features. Thus, a feature defined as "first" and "second" may explicitly or implicitly include one or more of these features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.
在本申请实施例中,“示例性地”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性地”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性地”或者“例如”等词旨在以具体方式呈现相关概念。In the embodiments of the present application, words such as "exemplarily" or "for example" are used as examples, illustrations or descriptions. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application shall not be interpreted as being more preferred or more advantageous than other embodiments or design solutions. Rather, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a concrete manner.
目前,Android应用程序可以基于Android模拟器等虚拟化技术运行在Windows操作系统上。Windows操作系统与Android应用程序之间交互文件的过程中,需要用户进行多步、复杂的操作,用户使用体验较差。Currently, Android applications can run on Windows operating systems based on virtualization technologies such as Android emulators. In the process of file exchange between the Windows operating system and the Android application program, the user needs to perform multi-step and complicated operations, and the user experience is poor.
并且,如图1B所示,Android侧与Windows侧之间的文件传输,可通过安卓调试桥(android debug bridge,adb)工具来实现。其中,通过adb进行文件传输的本质是基于socket的TCP/IP通信,受带宽、网络延时等因素的限制,文件传输速度较慢;且文件传输依赖adb进程,一旦adb端口被占用或者adb未成功运行,则Android侧与Windows侧之间的通信就会断开,文件无法成功传输。Moreover, as shown in FIG. 1B, the file transfer between the Android side and the Windows side can be realized through an Android debug bridge (android debug bridge, adb) tool. Among them, the essence of file transfer through adb is socket-based TCP/IP communication, limited by bandwidth, network delay and other factors, the file transfer speed is slow; and file transfer depends on the adb process, once the adb port is occupied or adb is not If it runs successfully, the communication between the Android side and the Windows side will be disconnected, and the file cannot be transferred successfully.
本申请实施例提供了一种跨系统传输目标对象的方法,可以应用于电子设备。参见图2所示的传输架构示意图,该电子设备上运行有第一操作系统,第一操作系统上 基于模拟器运行有第二操作系统的应用程序。在该方法中,电子设备能够基于用户的简单操作,实现第一操作系统的应用程序与第二操作系统的应用程序之间的目标对象的交互,以及第一操作系统上第二操作系统的不同应用程序之间的目标对象的交互。其中,该目标对象可以包括文件、文本或其他可传输对象。并且,用户的该简单操作更符合用户基于第一操作系统的使用习惯,用户使用体验较好。例如,用户的简单操作可以为一步拖拽操作,或者用户的简单操作可以为复制/剪切操作和粘贴操作等。The embodiment of the present application provides a method for transmitting a target object across systems, which can be applied to electronic devices. Referring to the schematic diagram of the transmission architecture shown in FIG. 2, the electronic device runs a first operating system, and an application program of a second operating system runs on the first operating system based on a simulator. In this method, the electronic device can realize the target object interaction between the application program of the first operating system and the application program of the second operating system based on the simple operation of the user, and the difference between the second operating system on the first operating system Interaction of target objects between applications. Wherein, the target object may include files, text or other transferable objects. Moreover, the simple operation of the user is more in line with the user's usage habits based on the first operating system, and the user experience is better. For example, the user's simple operation may be a one-step drag operation, or the user's simple operation may be a copy/cut operation, a paste operation, and the like.
此外,本申请实施例提供的方法不依赖adb、socket通信和网络能力等因素,不会受到这些因素的限制,因而文件传输速度快且安全可靠。In addition, the method provided by the embodiment of the present application does not rely on factors such as adb, socket communication, and network capabilities, and is not limited by these factors, so the file transfer speed is fast, safe and reliable.
其中,第一操作系统和第二操作系统为不同的操作系统。例如,第一操作系统可以为Windows操作系统、Linux操作系统、Unix操作系统、DOS操作系统或Mac OS操作系统等;第二操作系统可以为Android操作系统,iOS操作系统,鸿蒙Harmony操作系统,塞班Symbian操作系统,黑莓lackBerry操作系统,windows Mobile操作系统,或palm操作系统等。本申请实施例对第一操作系统和第二操作系统的具体类型不予限定。Wherein, the first operating system and the second operating system are different operating systems. For example, the first operating system can be Windows operating system, Linux operating system, Unix operating system, DOS operating system or Mac OS operating system, etc.; the second operating system can be Android operating system, iOS operating system, Hongmeng Harmony operating system, Cypriot operating system, etc. Class Symbian operating system, BlackBerry lackBerry operating system, windows Mobile operating system, or palm operating system, etc. The embodiment of the present application does not limit specific types of the first operating system and the second operating system.
针对不同的第一操作系统和第二操作系统,用户的操作习惯也可能不同。例如,第一操作系统为Windows操作系统,对于运行有Windows操作系统的电脑等设备,用户通常习惯使用鼠标或快捷键等方式进行文件传输。再例如,第二操作系统为Android操作系统,对于运行有Windows操作系统的手机等设备,用户通常不使用鼠标或快捷键等方式进行文件传输。For different first operating systems and second operating systems, the user's operating habits may also be different. For example, the first operating system is the Windows operating system. For devices such as computers running the Windows operating system, users are usually accustomed to using a mouse or shortcut keys to transfer files. For another example, the second operating system is an Android operating system. For devices such as mobile phones running a Windows operating system, users usually do not use a mouse or shortcut keys to transfer files.
其中,图2所示的电子设备可以是台式电脑、笔记本电脑、桌面型电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)或上网本等设备,本申请实施例对电子设备的具体类型不作任何限制。Wherein, the electronic device shown in FIG. 2 may be a desktop computer, a notebook computer, a desktop computer, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC) or a netbook, etc., and the embodiment of the present application does not make any specific types of electronic devices. any restrictions.
在一些实施例中,该电子设备可以通过图3所示的计算机系统300来实现。计算机系统300包括显示屏30,至少一个处理器301,通信总线302,存储器303以及至少一个通信接口304。In some embodiments, the electronic device can be realized by the computer system 300 shown in FIG. 3 . The computer system 300 includes a display screen 30 , at least one processor 301 , a communication bus 302 , a memory 303 and at least one communication interface 304 .
显示屏30用于显示图像,视频等。显示屏30包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在本申请的实施例中,显示屏30可以用于显示多个窗口,包括第一操作系统的应用程序的窗口,和/或第二操作系统的应用程序的窗口等内容。The display screen 30 is used to display images, videos and the like. The display screen 30 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting diodes (quantum dot light emitting diodes, QLED), etc. In the embodiment of the present application, the display screen 30 may be used to display multiple windows, including windows of application programs of the first operating system, and/or windows of application programs of the second operating system.
处理器301可以是一个通用中央处理器(central processing unit,CPU),微处理器,特定应用集成电路(application specific integrated circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。处理器301可以运行第一操作系统,第一操作系统上可以基于模拟器运行第二操作系统的应用程序。The processor 301 can be a general-purpose central processing unit (central processing unit, CPU), a microprocessor, a specific application integrated circuit (application specific integrated circuit, ASIC), or one or more integrated circuits for controlling the execution of the program program of this application. circuit. The processor 301 may run a first operating system, and an application program of a second operating system may run on the first operating system based on an emulator.
通信总线302可包括一通路,在上述组件之间传送信息。Communication bus 302 may include a path for communicating information between the components described above.
通信接口304,使用任何收发器一类的装置,用于与其他设备或通信网络通信,如以太网,无线接入网(radio access network,RAN),无线局域网(wireless local area  networks,WLAN)等。 Communication interface 304, using any device such as a transceiver, for communicating with other devices or communication networks, such as Ethernet, radio access network (radio access network, RAN), wireless local area networks (wireless local area networks, WLAN), etc. .
存储器303可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,RAM或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过总线与处理器相连接。存储器也可以和处理器集成在一起。The memory 303 can be a read-only memory (read-only memory, ROM) or other types of static storage devices that can store static information and instructions, RAM or other types of dynamic storage devices that can store information and instructions, or can be electronically Erasable programmable read-only memory (electrically erasable programmable read-only memory, EEPROM), read-only disc (compact disc read-only memory, CD-ROM) or other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, Digital Versatile Disc, Blu-ray Disc, etc.), magnetic disk storage medium or other magnetic storage device, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited to this. The memory can exist independently and be connected to the processor through the bus. Memory can also be integrated with the processor.
其中,存储器303用于存储执行本申请方案的应用程序代码,并由处理器301来控制执行。处理器301用于执行存储器303中存储的应用程序代码,以控制计算机系统300实现本申请下述实施例提供的文件交互方法,从而基于一步拖拽操作,或基于复制/剪切和粘贴操作等用户的简单操作,实现第一操作系统的应用程序与第二操作系统的应用程序之间,以及第二操作系统的不同应用程序之间的目标对象的交互。Wherein, the memory 303 is used to store the application program code for executing the solution of the present application, and the execution is controlled by the processor 301 . The processor 301 is used to execute the application program code stored in the memory 303, so as to control the computer system 300 to implement the file interaction method provided by the following embodiments of the present application, so as to be based on one-step drag operation, or based on copy/cut and paste operation, etc. The user's simple operation realizes the interaction between the application program of the first operating system and the application program of the second operating system, and between different application programs of the second operating system.
可选的,本申请实施例中的计算机执行指令也可以称之为应用程序代码,本申请实施例对此不作具体限定。Optionally, the computer-executed instructions in the embodiments of the present application may also be referred to as application program codes, which is not specifically limited in the embodiments of the present application.
在具体实现中,作为一种实施例,处理器301可以包括一个或多个CPU,例如图3中的CPU0和CPU1,每个CPU可以支持多个虚拟CPU,虚拟CPU又称VCPU。In a specific implementation, as an embodiment, the processor 301 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 3 , and each CPU may support multiple virtual CPUs, and a virtual CPU is also called a VCPU.
在具体实现中,作为一种实施例,计算机系统300可以包括多个处理器,例如图3中的处理器301和处理器307。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。In a specific implementation, as an embodiment, the computer system 300 may include multiple processors, such as the processor 301 and the processor 307 in FIG. 3 . Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
在具体实现中,作为一种实施例,计算机系统300还可以包括输出设备305和输入设备306。输出设备305和处理器301通信,可以以多种方式来显示信息。例如,输出设备305可以是液晶显示器(liquid crystal display,LCD),发光二级管(light emitting diode,LED)显示设备,阴极射线管(cathode ray tube,CRT)显示设备,或投影仪(projector)等。输入设备306和处理器301通信,可以以多种方式接受用户的输入。例如,输入设备306可以是鼠标、键盘、触摸屏设备或传感设备等。In a specific implementation, as an example, the computer system 300 may further include an output device 305 and an input device 306 . Output device 305 is in communication with processor 301 and can display information in a variety of ways. For example, the output device 305 may be a liquid crystal display (liquid crystal display, LCD), a light emitting diode (light emitting diode, LED) display device, a cathode ray tube (cathode ray tube, CRT) display device, or a projector (projector) wait. The input device 306 communicates with the processor 301 and can accept user input in various ways. For example, the input device 306 may be a mouse, a keyboard, a touch screen device, or a sensing device, among others.
如前所述,电子设备上运行有第一操作系统,第一操作系统上运行有基于第一操作系统的应用程序(简称第一操作系统的应用程序),第一操作系统上基于模拟器运行有第二操作系统的应用程序。电子设备可以采用多窗口的形式,运行第一操作系统的应用程序。在本申请的实施例中,第一操作系统侧的窗口与第二操作系统侧的窗口之间一一对应。这样,第二操作系统的应用程序也可以通过多窗口的形式运行在电子设备上。并且,基于该窗口间的对应关系,电子设备可以根据第一操作系统侧的窗口标识确定对应的第二操作系统侧的窗口,也可以根据第二操作系统侧的窗口标识确定对应的第一操作系统侧的窗口。As mentioned above, the first operating system runs on the electronic device, the application program based on the first operating system (referred to as the application program of the first operating system) runs on the first operating system, and the first operating system runs based on the emulator. There are applications for the second operating system. The electronic device may adopt a multi-window form and run application programs of the first operating system. In the embodiment of the present application, there is a one-to-one correspondence between the windows on the first operating system side and the windows on the second operating system side. In this way, the application program of the second operating system can also run on the electronic device in the form of multiple windows. Moreover, based on the correspondence between the windows, the electronic device can determine the corresponding window on the second operating system side according to the window identifier on the first operating system side, or determine the corresponding first operation window based on the window identifier on the second operating system side. Windows on the system side.
其中,继续参见图2,模拟器所运行的第一操作系统与第二操作系统之间可以基于管道通信技术进行通信交互,从而可以在第一操作系统的应用程序与第二操作系统的应用程序之间传输目标对象的过程中交互相关的信息,并在第二操作系统的不同应 用程序之间传输目标对象的过程中交互相关的信息。通过如图2所示的共享文件夹技术,可以实现第一操作系统与第二操作系统之间共享目标对象。当第一操作系统的应用程序与第二操作系统的应用程序之间交互目标对象时,基于用户的简单操作,源端操作系统可以将待传输的目标对象自动存入共享文件夹,目的端操作系统可以自动从共享文件夹获取目标对象,并传输至目的应用程序的窗口。这样,结合第一操作系统与第二操作系统之间的管道通信以及共享文件夹技术,本申请实施例可以实现第一操作系统的应用程序与第二操作系统的应用程序之间的目标对象的交互,以及第一操作系统上运行的第二操作系统的不同应用程序之间的目标对象的交互。Wherein, continue to refer to FIG. 2, the communication and interaction between the first operating system run by the emulator and the second operating system can be based on the pipeline communication technology, so that the application program of the first operating system and the application program of the second operating system can The related information is exchanged during the process of transferring the target object between the different application programs of the second operating system, and the related information is exchanged during the process of transferring the target object between different application programs of the second operating system. Through the shared folder technology shown in FIG. 2 , target objects can be shared between the first operating system and the second operating system. When the target object is interacted between the application program of the first operating system and the application program of the second operating system, based on the simple operation of the user, the source operating system can automatically save the target object to be transferred into the shared folder, and the destination operation The system can automatically obtain the target object from the shared folder and transfer it to the window of the target application. In this way, combined with the pipeline communication and shared folder technology between the first operating system and the second operating system, the embodiment of the present application can realize the target object between the application program of the first operating system and the application program of the second operating system. Interaction, and interaction of target objects between different applications of a second operating system running on a first operating system.
其中,该目标对象可以包括文件、文本或其他可传输对象。例如,该文件可以是视频文件、音频文件、文档、图片、快捷方式或压缩文件等;该文本可以是一段文字、一段数字或一段字符串等。也就是说,结合第一操作系统与第二操作系统之间的管道通信以及共享文件夹技术,第一操作系统与第二操作系统之间可以进行信息交互并共享文件、文本或其他可传输对象,从而可以实现第一操作系统的应用程序与第二操作系统的应用程序之间交互文件、文本或其他可传输对象,并实现第一操作系统上运行的第二操作系统的不同应用程序之间交互文件、文本或其他可传输对象。Wherein, the target object may include files, text or other transferable objects. For example, the file may be a video file, an audio file, a document, a picture, a shortcut or a compressed file, etc.; the text may be a piece of text, a number, or a string. That is to say, combined with the pipeline communication and shared folder technology between the first operating system and the second operating system, the first operating system and the second operating system can exchange information and share files, text or other transferable objects , so that the application programs of the first operating system and the application programs of the second operating system can interact with files, texts or other transferable objects, and realize the communication between different application programs of the second operating system running on the first operating system Interactive files, text or other transportable objects.
上述管道通信技术可以有多种,比如Qemu管道通信(Qemu Pipe Communication),或称Qemu Pipe通信。该Qemu Pipe通信通过虚拟设备来实现第二操作系统与模拟器之间的通信,通信速度快且稳定性高。在虚拟化领域中,存在模拟器的客户端(Guest)侧与主机端(Host)侧之间共享文件的用户需求。该共享文件夹技术可以通过多种技术来实现,例如基于virtio-i/o虚拟化框架的计划9共享文件夹(plan 9 folder sharing over Virtio-I/O virtualization framework,Virtio-9p共享文件夹)(简称9p共享文件夹)、虚拟块设备(virtual block device,VBD)、网络文件系统(network file system,NFS)和公共互联网文件系统(common internet file system,CIFS)、或虚拟机共享文件系统(shared file system for virtual machines,Virtio-Fs)技术等,不予限定。其中,Virtio-9p利用现有的9p协议(一种网络文件系统协议)以及Virtio驱动的架构,在Qemu后端实现了一个服务器(Server)端与具体的文件系统对接,真正实现Guest与Host间文件的共享及访问,故称之为Virtio-9p。Virtio-9p能够提供完备的功能支持和良好的性能。与Virtio-9p相比,通过NFS、CIFS在虚拟机与宿主机之间共享文件时,数据的传输需要经过多次拷贝,且增加了一层网络开销,性能上有较大损耗。加上网络文件系统并非专为虚拟化设计,所以其支持的功能也不够完善。There are many kinds of pipeline communication technologies, such as Qemu pipeline communication (Qemu Pipe Communication), or Qemu Pipe communication. The Qemu Pipe communication realizes the communication between the second operating system and the emulator through the virtual device, and the communication speed is fast and the stability is high. In the field of virtualization, there is a user requirement for file sharing between a client (Guest) side and a host (Host) side of an emulator. The shared folder technology can be realized by various technologies, such as plan 9 folder sharing over Virtio-I/O virtualization framework (plan 9 folder sharing over Virtio-I/O virtualization framework, Virtio-9p shared folder) based on the virtio-i/o virtualization framework (referred to as 9p shared folder), virtual block device (virtual block device, VBD), network file system (network file system, NFS) and public Internet file system (common internet file system, CIFS), or virtual machine shared file system ( shared file system for virtual machines, Virtio-Fs) technologies, etc., are not limited. Among them, Virtio-9p uses the existing 9p protocol (a network file system protocol) and the Virtio-driven architecture to implement a server (Server) on the back end of Qemu to connect with a specific file system, and truly realize the connection between the Guest and the Host. File sharing and access, so it is called Virtio-9p. Virtio-9p can provide complete functional support and good performance. Compared with Virtio-9p, when sharing files between the virtual machine and the host through NFS or CIFS, data transmission needs to be copied multiple times, and a layer of network overhead is added, resulting in a large loss in performance. In addition, the network file system is not specially designed for virtualization, so its supported functions are not perfect enough.
共享文件夹是打通安卓和Windows数据的桥梁,模拟器安卓应用在传输文件的时候需要访问Windows数据但无法直接获取,必须先调起安卓侧存储找到文件。此时在安卓侧存储中的第一个文件夹命名为“共享文件夹”,便于用户直接访问。对应的在Windows侧本地创建一个共享文件夹,本质上和安卓侧存储内的文件夹是一个文件夹,需要用户把待传输的文件拖入Windows侧的该文件夹后,安卓应用才能从安卓侧存储中找到该文件。The shared folder is a bridge between Android and Windows data. When transferring files, the emulator Android application needs to access Windows data but cannot directly obtain it. You must first call up the Android side storage to find the file. At this time, the first folder in the storage on the Android side is named "Shared Folder", which is convenient for users to access directly. Correspondingly, create a shared folder locally on the Windows side, which is essentially the same folder as the folder in the storage on the Android side. After the user drags the file to be transferred into the folder on the Windows side, the Android application can be uploaded from the Android side. The file is found in storage.
如图4所示,以下实施例中将以第一操作系统为Windows操作系统,第二操作系统为Android操作系统,电子设备上运行了Windows操作系统,Windows操作系统基于Android模拟器运行有Android应用程序,模拟器的Host侧与Guest侧之间采用Qemu  Pipe通信,共享文件夹技术采用Virtio-9p,且电子设备为电脑为例,对本申请实施例提供的跨系统传输目标对象的方法进行阐述。As shown in Figure 4, in the following embodiments, the first operating system will be the Windows operating system, the second operating system will be the Android operating system, the electronic device runs the Windows operating system, and the Windows operating system runs Android applications based on the Android emulator. Program, Qemu Pipe communication is adopted between the Host side and the Guest side of the emulator, the shared folder technology adopts Virtio-9p, and the electronic device is a computer as an example, the method for the cross-system transmission target object provided by the embodiment of the present application is described.
其中,用于交互目标对象的Android应用程序,可以是Android操作系统的系统应用(例如Android文件管理),也可以是三方应用(例如社交类应用(比如微信、QQ)、图库、新闻类应用、视频类应用(比如抖音、快手等)或游戏类应用)。用于目标对象的Windows应用程序也可以是Windows操作系统的系统应用(比如Windows资源管理器、(文本编辑器)等),或三方应用(比如浏览器应用、视频类应用或游戏类应用等)。本申请实施例对用于交互目标对象的Android应用程序和Windows应用程序的具体类型不予限定。Among them, the Android application program used to interact with the target object can be a system application of the Android operating system (such as Android file management), or a third-party application (such as a social application (such as WeChat, QQ), a gallery, a news application, Video applications (such as Douyin, Kuaishou, etc.) or game applications). The Windows application program used for the target object can also be a system application of the Windows operating system (such as Windows Explorer, (text editor), etc.), or a third-party application (such as a browser application, video application or game application, etc.) . The embodiment of the present application does not limit the specific types of the Android application program and the Windows application program used to interact with the target object.
Windows操作系统侧的窗口与Android操作系统侧的窗口之间一一对应。这样,Android应用程序可以通过多窗口的形式,运行在Windows操作系统之上。基于该窗口对应关系,Windows操作系统可以根据Windows侧的窗口标识(例如为窗口句柄,或者窗口句柄对应的显示标识displayid),确定对应的Android侧的窗口标识(例如为Android侧虚拟显示(VirtualDisplay)窗口的displayid);Android操作系统也可以根据Android侧的窗口标识,确定对应的Windows侧的窗口标识。示例性的,Windows侧的窗口标识为窗口句柄,Android侧的窗口标识为虚拟显示(VirtualDisplay)窗口displayid,该窗口对应关系为Windows侧的窗口句柄与Android侧的窗口displayid之间的一一对应关系。再示例性的,Windows侧的窗口标识为窗口句柄对应的窗口displayid,Android侧的窗口标识为窗口displayid,该窗口对应关系为Windows侧的窗口displayid与Android侧的窗口displayid之间的一一对应关系。There is a one-to-one correspondence between windows on the Windows operating system side and windows on the Android operating system side. In this way, the Android application program can run on the Windows operating system in the form of multiple windows. Based on the window correspondence, the Windows operating system can determine the corresponding window ID on the Android side (for example, the Android side virtual display (VirtualDisplay) displayid of the window); the Android operating system may also determine the corresponding window ID on the Windows side according to the window ID on the Android side. Exemplarily, the window on the Windows side is identified as a window handle, and the window on the Android side is identified as a virtual display (VirtualDisplay) window displayid, and the window correspondence is a one-to-one correspondence between the window handle on the Windows side and the window displayid on the Android side . As another example, the window ID on the Windows side is the window displayid corresponding to the window handle, the window ID on the Android side is the window displayid, and the window correspondence is a one-to-one correspondence between the window displayid on the Windows side and the window displayid on the Android side .
例如,参见图5中的(a),电脑桌面上包括多个Windows应用程序的图标(比如Windows资源管理器的图标51和网络连接图标52等)和Android应用程序的图标(比如Android(安卓)文件管理的图标53、新闻头条的图标54和社交软件的图标55等)。并且,屏幕上显示有Windows资源管理器的窗口501。响应于用户针对Android文件管理的图标502的操作,电脑运行Android文件管理,并如图5中的(b)所示,在屏幕上也显示Android文件管理的窗口503。For example, referring to (a) in Fig. 5, the icon (such as the icon 51 of Windows Explorer and the network connection icon 52 etc.) of multiple Windows application programs and the icon of Android application program (such as Android (Android) icon 53 for file management, icon 54 for news headlines and icon 55 for social software, etc.). Also, a window 501 of Windows Explorer is displayed on the screen. In response to the user's operation on the icon 502 of the Android file management, the computer runs the Android file management, and as shown in (b) in FIG. 5 , a window 503 of the Android file management is also displayed on the screen.
其中,Windows操作系统也可以称为Android模拟器的主机端(Host),Android操作系统也可以称为Android模拟器的客户端(Guest)。由于Android模拟器运行在Windows操作系统之上,因而Android模拟器可以理解为Windows侧的应用程序。Android模拟器与Android应用程序之间的交互,也可以理解为Android模拟器的Host侧与Guest侧之间的交互。Wherein, the Windows operating system may also be referred to as a host (Host) of the Android emulator, and the Android operating system may also be referred to as a client (Guest) of the Android emulator. Since the Android emulator runs on the Windows operating system, the Android emulator can be understood as an application program on the Windows side. The interaction between the Android emulator and the Android application program can also be understood as the interaction between the Host side and the Guest side of the Android emulator.
在本申请的实施例中,Android模拟器与Android操作系统之间(即Android模拟器的Host侧与Guest侧之间)可以基于Qemu Pipe进行通信交互,从而可以在Windows应用程序与Android应用程序之间传输目标对象的过程中交互相关的信息,并在Android不同应用程序之间传输目标对象的过程中交互相关的信息。这里“相关的信息”是指,除目标对象的数据内容以外,Host侧与Guest侧在目标对象的传输过程中交互的消息或信令等信息。通过9p共享文件夹技术可以实现Windows操作系统与Android操作系统之间共享目标对象。当Windows操作系统的应用程序与Android应用程序之间传输目标对象时,基于用户的简单操作,源端操作系统可以将待传输的目标对象自 动存入9p共享文件夹,目的端操作系统可以自动从9p共享文件夹获取目标对象,并传输至目的应用程序的窗口。这样,结合Android模拟器的Host与Guest之间的Qemu Pipe通信以及9p共享文件夹技术,本申请实施例可以实现Windows应用程序与Android应用程序之间的目标对象的交互,以及Windows操作系统上不同Android应用程序之间的目标对象的交互。In the embodiment of the present application, between the Android emulator and the Android operating system (that is, between the Host side and the Guest side of the Android emulator) can communicate and interact based on Qemu Pipe, so that the Windows application program and the Android application program can Interact related information during the process of transferring target objects between different Android applications, and exchange related information during the process of transferring target objects between different Android applications. Here, "related information" refers to information such as messages or signaling exchanged between the Host side and the Guest side during the transmission process of the target object, in addition to the data content of the target object. Through the 9p shared folder technology, the target object can be shared between the Windows operating system and the Android operating system. When the target object is transferred between the application program of the Windows operating system and the Android application program, based on the simple operation of the user, the source operating system can automatically save the target object to be transferred into the 9p shared folder, and the target operating system can automatically save the target object from the 9p The shared folder acquires the target object and transfers it to the window of the target application. In this way, in combination with the Qemu Pipe communication between the Host and the Guest of the Android emulator and the 9p shared folder technology, the embodiment of the present application can realize the interaction of the target object between the Windows application program and the Android application program, and different Interaction of target objects between Android applications.
基于本申请实施例提供的方法,电脑能够基于用户的一步拖拽操作,或者用户的复制/剪切和粘贴操作等简单操作,实现Android应用程序与Windows应用程序之间交互目标对象,以及Android不同应用程序之间交互目标对象。并且,用户触发交互目标对象的简单操作,符合用户基于Windows操作系统的使用习惯,因而用户使用体验较好。Based on the method provided by the embodiment of the present application, the computer can realize the interactive target object between the Android application program and the Windows application program based on the user's one-step drag operation, or the user's simple operations such as copy/cut and paste operations, and different Android applications. Interaction target object between applications. Moreover, the simple operation for the user to trigger the interactive target object conforms to the user's usage habits based on the Windows operating system, so the user experience is better.
以下针对不同交互场景分别进行阐述。The following describes different interaction scenarios respectively.
场景(1)、一步拖拽实现Windows应用程序到Android应用程序的文件传输:Scenario (1), one-step drag and drop to realize file transfer from Windows application to Android application:
在该交互场景中,用户可以通过鼠标或触摸屏等输入设备,将电脑屏幕上显示的Windows应用程序窗口中的目标对象,拖拽至Android应用程序的窗口。电脑响应于用户的拖拽操作,将Windows应用程序中的目标对象传输至Android应用程序,实现Windows应用程序到Android应用程序的目标对象的复制。In this interaction scenario, the user can drag and drop the target object in the Windows application window displayed on the computer screen to the Android application window through an input device such as a mouse or a touch screen. The computer transmits the target object in the Windows application program to the Android application program in response to the user's drag operation, so as to realize the copying of the target object from the Windows application program to the Android application program.
在一些实施例中,在该交互场景中,参见图6A,Android模拟器的Host侧和Guest侧之间基于Qemu Pipe进行通信交互。Host侧产生Windows侧拖拽事件(如对象连接与嵌入拖/放(object linking and embedding Drag/Drop,OLE Drag/Drop)拖拽事件)后,将目标文件从Windows应用程序传输至Windows资源管理器,Windows资源管理器将目标文件拷贝至9p共享文件夹。Guest侧从9p共享文件夹读取该目标文件,获取目标文件的统一资源标识符(Uniform Resource Identifier,URI),实现安卓内部目标文件的传输,从而将目标文件传输至Android应用程序。In some embodiments, in this interaction scenario, referring to FIG. 6A , the communication interaction between the Host side and the Guest side of the Android emulator is based on Qemu Pipe. After the Windows-side drag event (such as object linking and embedding Drag/Drop (OLE Drag/Drop) drag event) is generated on the Host side, the target file is transferred from the Windows application to the Windows Explorer , Windows Explorer copies the target file to the 9p shared folder. The Guest side reads the target file from the 9p shared folder, obtains the uniform resource identifier (Uniform Resource Identifier, URI) of the target file, and realizes the transfer of the target file inside Android, thereby transferring the target file to the Android application.
或者,在该交互场景下,参见图6A,Android模拟器的Host侧和Guest侧之间基于Qemu Pipe进行通信交互,Host侧产生Windows侧拖拽事件(如OLE Drag/Drop拖拽事件)后,基于Qemu Pipe将目标文本通知给Guest侧。Guest侧实现安卓内部目标文本的传输,从而将目标文本传输至Android应用程序。Or, in this interaction scenario, see FIG. 6A, the Host side and the Guest side of the Android emulator communicate and interact based on Qemu Pipe, and after the Host side generates a Windows-side drag event (such as an OLE Drag/Drop drag event), The target text is notified to the Guest side based on Qemu Pipe. The Guest side realizes the transmission of the target text inside the Android, so that the target text is transmitted to the Android application program.
在另一些实施例中,在该交互场景中,参见图6B,本申请提供的跨系统传输目标对象的方法可以包括以下流程:目标对象由Windows资源管理器等Windows应用程序的窗口,拖拽进入安卓应用程序的窗口。循环执行以下步骤直至目标对象移出安卓应用程序的窗口或者目标对象被拖拽释放:安卓模拟器的Host侧基于管道通信Qemu Pipe将拖入事件通知给Guest侧(即安卓系统),包括通知拖拽位置坐标、拖拽位置进入的安卓侧窗口标识和目标对象类型等信息,该目标对象类型用于表示拖拽的目标对象所属的类型,比如该目标对象类型可以为文件或文本等;Guest侧基于Qemu Pipe向Host侧回复是否允许拖入;Host侧根据Guest侧回复的是否允许拖入的信息显示拖拽样式(或称拖拽标识),比如该拖拽样式包括禁止/允许拖拽标识等。在目标对象被释放后,Host侧基于Qemu Pipe将拖拽释放事件通知给Guest侧,包括通知拖拽释放位置对应的安卓侧窗口标识,拖拽释放位置坐标,目标对象类型,目标对象为目标文件时目标文件包括的文件数量和文件总大小,以及目标对象为目标文本时的文本长度 和文本内容等信息。若Guest侧确定拖拽释放位置允许拖拽,则构建空的拖拽开始事件。Guest侧基于Qemu Pipe向Host侧回复是否允许拖入。若Host侧根据Guest侧的回复确定不允许拖入,则Host侧结束拖拽;若确定允许拖入,则执行后续流程。In some other embodiments, in this interaction scenario, referring to FIG. 6B , the method for transferring a target object across systems provided by the present application may include the following process: the target object is dragged into the window of a Windows application program such as Windows Explorer. Window of an Android application. Perform the following steps in a loop until the target object moves out of the window of the Android application or the target object is dragged and released: the Host side of the Android emulator will notify the Guest side (that is, the Android system) of the drag-in event based on the pipeline communication Qemu Pipe, including notification dragging Information such as location coordinates, the ID of the Android side window entered by the dragged location, and the target object type. The target object type is used to indicate the type of the dragged target object. For example, the target object type can be a file or text, etc.; the Guest side is based on Qemu Pipe replies to the Host side whether drag-in is allowed; the Host side displays the drag-and-drop style (or drag-and-drop logo) according to the information of whether the drag-and-drop is allowed or not replied by the Guest side, for example, the drag-and-drop style includes the prohibit/allow drag-and-drop logo, etc. After the target object is released, the Host side notifies the Guest side of the drag release event based on the Qemu Pipe, including the notification of the Android side window ID corresponding to the drag release position, the coordinates of the drag release position, the type of the target object, and the target object as the target file When the target file includes the number of files and the total file size, as well as the text length and text content when the target object is the target text. If the Guest side determines that the dragging release position allows dragging, an empty dragging start event is constructed. The Guest side replies to the Host side based on the Qemu Pipe whether dragging is allowed. If the Host side determines that the drag-in is not allowed according to the reply from the Guest side, the Host side ends the drag-and-drop; if it determines that the drag-in is allowed, the subsequent process is executed.
若目标对象类型为文件,则参见图6B,循环执行以下步骤:Host侧将目标文件中的单个文件依次拷贝至9p共享文件夹,并通知Gue st侧单个文件拷贝完成;Host侧获取单个文件的URI,通过URI读取文件,并构建单个文件的拖拽事件。参见图6B,Host侧在目标文件的所有文件拷贝完成后通知Guest侧;Guest侧通过拖拽事件将目标文件传输至指定的拖拽释放目的安卓应用窗口。若目标对象类型为文本,则参见图6B,Guest侧根据文本内容构建拖拽事件,将目标文本传输至指定的拖拽释放目的安卓应用窗口。而后,继续参见图6B,Guest侧构建空的拖拽结束事件,从而结束目标对象的拖拽传输过程。其中,图6B中的可变(atler,Alt)表示目标对象类型可改变,可以为“文件”,或者为“文本”。If the target object type is a file, then referring to Fig. 6B, the following steps are cyclically executed: the Host side copies the individual files in the target file to the 9p shared folder successively, and notifies the Guest side that the single file copy is completed; the Host side obtains the single file URI, read files through URI, and build a drag event for a single file. Referring to FIG. 6B , the Host side notifies the Guest side after all files of the target file are copied; the Guest side transfers the target file to the specified Android application window for dragging and dropping through a drag event. If the type of the target object is text, see FIG. 6B , the Guest side constructs a drag event according to the text content, and transmits the target text to the specified Android application window for drag and drop. Then, continuing to refer to FIG. 6B , the Guest side constructs an empty drag end event, thereby ending the drag transfer process of the target object. Wherein, variable (atler, Alt) in FIG. 6B indicates that the target object type can be changed, which can be "file" or "text".
在其他一些实施例中,结合图6C所示的流程图及图7A-图7C所示的界面示意图,对本申请提供的跨系统传输目标对象的方法进行详细说明:In some other embodiments, in combination with the flow chart shown in FIG. 6C and the interface diagrams shown in FIGS. 7A-7C , the method for transferring target objects across systems provided by this application is described in detail:
601、Host侧检测到Windows应用程序窗口中的目标对象被触发拖拽。601. The Host side detects that the target object in the Windows application window is triggered to be dragged.
比如,Host侧检测到触发拖拽对应的鼠标事件,该鼠标事件用于表示从Windows应用程序的窗口中开始拖拽目标对象。示例性的,如图7A中的(a)所示,用户通过鼠标选中Windows资源管理器的窗口701中的目标对象(比如该目标对象包括文档1和文档2),并开始拖拽该目标对象,此时Host侧检测到触发拖拽对应的鼠标事件。For example, the Host side detects that a mouse event corresponding to the dragging is triggered, and the mouse event is used to indicate that the target object is started to be dragged from the window of the Windows application program. Exemplarily, as shown in (a) in FIG. 7A , the user selects the target object in the window 701 of the Windows Explorer with the mouse (for example, the target object includes document 1 and document 2), and starts to drag the target object , at this time, the host side detects the mouse event corresponding to the trigger drag.
在拖拽开始后,Host侧可以通过获取拖拽源窗口的窗口标识(比如句柄),然后遍历维护的窗口标识的对应关系,若该对应关系中存在拖拽源窗口的窗口标识对应的窗口标识,则可以判断拖拽源窗口为Android应用程序窗口;否则拖拽源窗口为Windosws应用程序窗口。在步骤601中,拖拽源窗口为Windows应用程序的窗口。After the dragging starts, the Host side can obtain the window ID (such as handle) of the drag source window, and then traverse the corresponding relationship of the maintained window ID, if there is a window ID corresponding to the window ID of the drag source window in the corresponding relationship , it can be judged that the dragging source window is an Android application window; otherwise, the dragging source window is a Windows application window. In step 601, the dragging source window is a window of a Windows application.
在拖拽过程中,Host侧可以显示目标对象对应的拖拽图标,该拖拽图标由拖拽源窗口决定。示例性的,参见图7A中的(a),在拖拽过程中,在鼠标的光标位置实时显示有拖拽图标702。During the dragging process, the host side can display the dragging icon corresponding to the target object, and the dragging icon is determined by the dragging source window. For example, referring to (a) in FIG. 7A , during the dragging process, a dragging icon 702 is displayed in real time at the cursor position of the mouse.
可选地,在拖拽过程中,电脑还可以提示用户当前拖拽位置是否允许拖入目标对象,该方法还可以包括步骤602-604:Optionally, during the dragging process, the computer may also prompt the user whether the current dragging position allows the target object to be dragged in, and the method may also include steps 602-604:
602、若目标对象的拖拽位置进入Android应用程序的窗口,则Host侧基于Qemu Pipe将拖拽信息1通知给Guest侧,该拖拽信息1包括拖拽位置坐标、拖拽位置对应的Android侧窗口标识和目标对象类型。602. If the dragging position of the target object enters the window of the Android application, the Host side notifies the Guest side of the dragging information 1 based on the Qemu Pipe. The dragging information 1 includes the dragging position coordinates and the Android side corresponding to the dragging position Window ID and target object type.
其中,拖拽位置是指目标对象在拖拽过程中所处的位置。具体的,Android应用程序窗口注册为OLE Drag/Drop拖拽窗口,当有OLE Drag/Drop拖拽事件进入Android应用窗口后,会触发IDropTarget::DragEnter()接口,通过该接口可获知目标对象的拖拽位置进入了Android应用程序的窗口。目标对象的拖拽位置进入Android应用程序的窗口后,Host侧通知Guest侧发生拖拽事件(或发生拖入事件)。Wherein, the dragging position refers to the position of the target object during the dragging process. Specifically, the Android application window is registered as an OLE Drag/Drop window. When an OLE Drag/Drop event enters the Android application window, it will trigger the IDropTarget::DragEnter() interface, through which the target object's Drag the location into the window of the Android application. After the dragging position of the target object enters the window of the Android application, the Host side notifies the Guest side that a dragging event (or a dragging event) occurs.
Host侧可以将拖拽信息1通知给Guest侧。例如,Host侧可以将目标对象类型通知给Guest侧,以便Guest侧获知待传输目标对象的类型,并确定拖拽位置或释放位置是否允许拖入该类型的目标对象。该目标对象类型可以包括文件或文本等可传输对 象。比如,目标文本通过Qemu Pipe可以实现跨系统传输,而目标文件需要通过9p共享文件夹进行中转才能实现跨系统传输。The Host side can notify the Guest side of the drag information 1 . For example, the Host side can notify the Guest side of the type of the target object, so that the Guest side can know the type of the target object to be transferred, and determine whether the dragging position or the releasing position allows the dragging of this type of target object. This target object type can include transferable objects such as files or text. For example, the target text can be transmitted across systems through Qemu Pipe, while the target file needs to be transferred through the 9p shared folder to achieve cross-system transmission.
Host侧还可以将拖拽位置对应的Android侧窗口标识通知给Guest侧,以便Guest侧确定拖拽位置对应的Android应用程序是否允许拖入目标对象。The Host side can also notify the Guest side of the Android side window identifier corresponding to the dragging position, so that the Guest side can determine whether the Android application corresponding to the dragging position is allowed to drag in the target object.
Host侧还可以将拖拽位置坐标通知给Guest侧,以便Guest侧的Android应用程序确定当前拖拽位置是否允许拖入目标对象。The Host side can also notify the Guest side of the coordinates of the dragging position, so that the Android application program on the Guest side can determine whether the current dragging position allows dragging in the target object.
此外,拖拽信息1还可以包括本次拖拽的其他相关信息,这里不予限定。In addition, the dragging information 1 may also include other relevant information about the current dragging, which is not limited here.
603、Guest侧根据拖拽信息1判断拖拽位置对应的Android侧窗口和拖拽位置是否允许拖入该目标对象类型对应的目标对象,并基于Qemu Pipe将判断结果通知给Host侧。603. According to the drag information 1, the Guest side judges whether the Android side window corresponding to the drag position and the drag position allow the target object corresponding to the target object type to be dragged in, and notifies the Host side of the judgment result based on the Qemu Pipe.
Guest侧可以根据拖拽位置坐标、拖拽位置对应的Android侧的窗口标识,以及拖拽进入的Android侧窗口对应的Android应用程序自身的处理逻辑,判断该Android侧窗口内的当前拖拽位置是否允许拖入目标对象。The Guest side can judge whether the current drag position in the Android side window is Allows dragging in target objects.
604、Host侧根据Guest侧通知的判断结果,提示用户当前Android侧窗口中的拖拽位置是否允许拖入目标对象。604. According to the judgment result notified by the Guest side, the Host side prompts the user whether the dragging position in the current Android side window is allowed to drag in the target object.
在一些实施例中,Host侧将来自Guest侧的判断结果通知给拖拽源窗口,源窗口通过相应的逻辑改变拖拽图标的状态,从而提示用户当前Android侧窗口中的拖拽位置是否允许拖入目标对象。In some embodiments, the Host side notifies the dragging source window of the judgment result from the Guest side, and the source window changes the state of the dragging icon through corresponding logic, thereby prompting the user whether the dragging position in the current Android side window allows dragging into the target object.
在另一些实施例中,若拖拽位置所在的Android侧窗口不允许拖入目标对象,则电脑可以通过显示禁止拖拽标识来提示用户;若拖拽位置所在的Android侧窗口允许拖入目标对象,则电脑不显示禁止拖拽标识。示例性的,禁止拖拽标识可以参见图7A中的(a)所示的标识703。In some other embodiments, if the Android side window where the dragging position is located does not allow the target object to be dragged in, the computer can prompt the user by displaying a prohibition of dragging; if the Android side window where the dragging position is located allows dragging the target object , the computer will not display the no-drag sign. Exemplarily, the drag-and-drop indication may refer to the indication 703 shown in (a) in FIG. 7A .
在另一些实施例中,若拖拽位置所在的Android侧窗口不允许拖入目标对象,则电脑可以显示禁止拖拽标识来提示用户;若拖拽位置所在的Android侧窗口允许拖入目标对象,则电脑可以显示允许拖拽标识来提示用户。In some other embodiments, if the Android side window where the drag position is located does not allow the target object to be dragged in, then the computer can display a prohibition of dragging and dropping the sign to prompt the user; if the Android side window where the drag position is located allows the target object to be dragged in, Then the computer may display a drag-and-drop permission sign to prompt the user.
这样,基于禁止/允许拖拽标识,用户根据该标识可以直观地获知,是否可以在当前Android侧窗口中的当前拖拽位置释放目标对象。In this way, based on the drag-and-drop prohibition/permission flag, the user can intuitively know whether the target object can be released at the current drag position in the current Android side window according to the flag.
当拖拽位置在Android应用程序的窗口内移动时会触发IDropTarget::DragOver()接口,通过该接口可获知拖拽位置当前正在Android应用程序的窗口内移动。Host侧基于Qemu Pipe将移动后的实时的拖拽位置坐标通知给Guest侧。Guest侧判断当前拖拽位置是否允许拖入目标对象,并基于Qemu Pipe将判断结果通知给Host侧。Host侧根据Guest侧通知的判断结果,提示用户当前拖拽位置是否允许拖入目标对象。When the drag position moves within the window of the Android application, the IDropTarget::DragOver() interface will be triggered, through which it can be learned that the drag position is currently moving within the window of the Android application. The Host side notifies the Guest side of the real-time drag position coordinates after the move based on the Qemu Pipe. The Guest side judges whether the current drag position allows dragging in the target object, and notifies the Host side of the judgment result based on the Qemu Pipe. According to the judgment result notified by the Guest side, the Host side prompts the user whether the current dragging position is allowed to drag the target object.
另外,若拖拽位置离开Android应用程序窗口则会触发IDropTarget::DragLeave()接口,通过该接口可获知拖拽位置已经移出Android应用程序的窗口。In addition, if the drag position leaves the Android application window, the IDropTarget::DragLeave() interface will be triggered, through which it can be known that the drag position has moved out of the Android application window.
此外,若拖拽位置进入其他Windows应用程序的窗口,则Host侧按照Windows操作系统的拖拽流程进行处理。In addition, if the dragging position enters the window of other Windows application programs, the Host side will handle it according to the dragging process of the Windows operating system.
605、在Host侧检测到拖拽的目标对象被释放后,若拖拽释放窗口为Android应用程序的窗口,则Host侧基于Qemu Pipe将拖拽信息2通知给Guest侧,该拖拽信息2包括拖拽释放位置坐标、拖拽释放窗口对应的Android侧窗口标识、目标对象类型和 传输类型。605. After the host side detects that the dragged target object is released, if the dragged release window is a window of an Android application, the host side notifies the guest side of the dragging information 2 based on the Qemu Pipe, and the dragging information 2 includes Drag and drop location coordinates, Android side window ID corresponding to the drag and drop window, target object type, and transmission type.
比如,Host侧检测到释放对应的鼠标事件,该鼠标事件用于表示拖拽的目标对象被释放。示例性的,参见图7A中的(b),用户通过鼠标将目标对象拖入Android文件管理窗口704后,通过鼠标释放拖拽的目标对象,此时Host侧检测到释放对应的鼠标事件。For example, the host side detects a mouse event corresponding to the release, and the mouse event is used to indicate that the dragged target object is released. Exemplarily, referring to (b) in FIG. 7A , after the user drags the target object into the Android file management window 704 through the mouse, the user releases the dragged target object through the mouse, and at this time, the Host side detects a mouse event corresponding to the release.
在用户释放拖拽的目标对象后,Host侧可以基于Qemu Pipe将拖拽释放事件通知给Guest侧。其中,Host侧可以将拖拽信息2通知给Guest侧。该拖拽信息2可以包括拖拽释放位置坐标、拖拽释放窗口对应的Android侧窗口标识、目标对象类型和传输类型。该拖拽信息2还可以包括拖拽相关的其他信息,比如当目标对象为目标文件时还包括文件数量,文件总大小;当目标文件为目标文本时还包括文本内容或文本长度等信息。本申请实施例对拖拽信息2的具体内容不于限定。其中,文本数量可以用于在拖拽传输过程中,提示用户总共拖拽几个文件,当前正在传输第几个文件等信息。文件总大小可以用于在拖拽传输过程中提示用户当前的传输进度。文本长度可以用于目的端将该文本长度与传输获取的文本内容的实际长度进行对比,以确认是否正确接收到拖拽传输的文本内容。After the user releases the dragged target object, the Host side can notify the Guest side of the drag release event based on the Qemu Pipe. Wherein, the Host side may notify the Guest side of the drag information 2 . The drag information 2 may include the coordinates of the drag release location, the Android side window identifier corresponding to the drag release window, the type of the target object, and the transmission type. The dragging information 2 may also include other information related to dragging, such as the number of files and the total file size when the target object is a target file; and information such as text content or text length when the target file is a target text. The embodiment of the present application does not limit the specific content of the drag information 2 . Among them, the number of texts can be used to prompt the user how many files to drag in total, which file is currently being transferred, and other information during the drag-and-drop transfer process. The total file size can be used to prompt the user of the current transfer progress during the drag-and-drop transfer process. The text length can be used by the destination end to compare the text length with the actual length of the text content acquired by the transmission, so as to confirm whether the text content transmitted by the drag and drop is correctly received.
需要说明的是,当目标对象为目标文本时,Host侧可以在拖拽进入安卓应用程序窗口后,将目标文本(即文本内容)传输给Guest侧;也可以在获知Guest侧允许拖入后,将目标文本传输给Guest侧;也可以在拖拽释放在安卓应用程序窗口后,将目标文本传输给Guest侧;或者,Host侧也可以在其他时机将目标文本传输给Guest侧,不予限定。It should be noted that when the target object is the target text, the Host side can transfer the target text (i.e. text content) to the Guest side after dragging and dragging into the Android application window; The target text is transmitted to the Guest side; the target text can also be transmitted to the Guest side after dragging and dropping on the Android application window; or, the Host side can also transmit the target text to the Guest side at other timings, which is not limited.
其中,传输类型包括Windows应用程序与Android应用程序之间的传输,或者Android应用程序之间的传输等。Guest侧可以根据具体的传输类型,对目标对象进行相应的传输处理。Wherein, the transmission type includes a transmission between a Windows application program and an Android application program, or a transmission between Android application programs, and the like. The Guest side can perform corresponding transmission processing on the target object according to the specific transmission type.
当拖拽位置在Android应用程序的窗口中释放时会触发IDropTarget::Drop()接口,通过该接口可获知所拖拽的目标对象在Android应用程序的窗口内释放。When the drag position is released in the window of the Android application, the IDropTarget::Drop() interface will be triggered, through which it can be learned that the dragged target object is released in the window of the Android application.
在步骤605中,若拖拽释放窗口为Android应用程序的窗口,则由于拖拽源窗口为Windows应用程序的窗口,因而该传输类型为Windows应用程序与Android应用程序之间的传输。In step 605, if the drag-and-drop window is an Android application window, since the drag source window is a Windows application window, the transfer type is a transfer between a Windows application and an Android application.
其中,当目标对象类型为文件时,目标对象为目标文件,用户释放拖拽的目标文件后,Host侧还可以基于Qemu Pipe将目标文件的文件名、目标文件的总大小和目标文件包括的文件数量等信息通知给Guest侧,以便Guest侧的拖拽目的端获知待传输目标文件的其他相关信息。当目标对象类型为文本时,目标对象为目标文本,Host侧还可以基于Qemu Pipe将目标文本的长度等信息通知给Guest侧。Among them, when the target object type is a file, the target object is the target file. After the user releases the dragged target file, the Host side can also transfer the file name of the target file, the total size of the target file, and the files included in the target file based on Qemu Pipe. The quantity and other information are notified to the Guest side, so that the drag destination on the Guest side can know other relevant information of the target file to be transferred. When the target object type is text, the target object is the target text, and the Host side can also notify the Guest side of information such as the length of the target text based on the Qemu Pipe.
在其他一些实施例中,目标文件的文件名、目标文件的总大小和目标文件包括的文件数量,或文本长度等信息,也可以在拖拽释放前,在拖拽位置刚进入Android应用程序的窗口后,由Host侧通知给Guest侧;或者,还可以在其他时机由Host侧通知给Guest侧,不予限定。In some other embodiments, the file name of the target file, the total size of the target file and the number of files included in the target file, or information such as text length, can also be entered into the Android application at the drag position before the drag is released. After the window, the host side notifies the guest side; or, the host side notifies the guest side at other timings, which is not limited.
而后,若目标对象类型为文件,则执行步骤606-609;若目标对象类型为文本,则执行步骤610-611。Then, if the target object type is a file, execute steps 606-609; if the target object type is text, execute steps 610-611.
606、Guest侧根据拖拽信息2判断拖拽释放窗口及释放位置是否允许拖入目标对象,若允许拖入则构建空的拖拽开始事件。606. The Guest side determines whether the drag release window and the release position allow dragging of the target object according to the drag information 2, and constructs an empty drag start event if drag entry is allowed.
Guest侧可以根据拖拽释放窗口对应的Android侧窗口标识,确定拖拽释放的Android应用程序的窗口是否允许拖入目标对象类型对应的目标对象。Guest侧可以根据拖拽释放位置坐标,确定释放位置是否允许拖入目标对象类型对应的目标对象。The Guest side can determine whether the drag-and-drop Android application window allows to drag in the target object corresponding to the target object type according to the Android side window identifier corresponding to the drag-and-drop window. The Guest side can determine whether the release position allows dragging in the target object corresponding to the target object type according to the coordinates of the drag release position.
若允许拖入,则Guest侧构建空的拖拽开始事件。构建空的拖拽开始事件是为了获取拖拽起始坐标所在的窗口。拖拽过程中,如果窗口变化了,会把拖拽开始保存的窗口赋值给拖拽事件,拖拽事件响应的还是拖拽开始的窗口,更加符合用户的预期。If drag-in is allowed, an empty drag-and-drop start event is constructed on the Guest side. The purpose of constructing an empty drag start event is to obtain the window where the drag start coordinates are located. During the dragging process, if the window changes, the window saved at the beginning of the dragging will be assigned to the dragging event, and the dragging event will respond to the window at the beginning of the dragging, which is more in line with user expectations.
Guest侧还可以根据拖拽信息2确定传输类型为Windows应用程序与Android应用程序之间的传输,从而执行相应的传输流程。The Guest side can also determine the transfer type as the transfer between the Windows application program and the Android application program according to the drag information 2, so as to execute the corresponding transfer process.
此外,当目标对象类型为文件时,Guest侧还可以根据目标文件的总大小,判断Android系统所剩磁盘空间是否大于目标文件的总大小,进行容量等检查。In addition, when the target object type is a file, the Guest side can also judge whether the remaining disk space of the Android system is greater than the total size of the target file according to the total size of the target file, and perform capacity checks.
607、若Guest侧确定允许拖入目标对象,且目标对象为目标文件,则Guest侧基于Qemu Pipe通知Host侧允许拖入并通知Host侧传输目标文件。607. If the Guest side determines that the drag-in of the target object is allowed, and the target object is a target file, the Guest side notifies the Host side based on the Qemu Pipe to allow drag-in and notifies the Host side to transmit the target file.
若Guest侧确定拖拽释放的Android应用程序的窗口及释放位置允许拖入目标对象,目标对象为目标文件,且Android系统所剩磁盘空间大于或者等于目标文件的文件总大小,则Guest侧构建空的拖拽开始事件,用于标志此次拖拽事件的开始。并且,Guest侧通知Host侧开始传输目标文件。需要说明的是,在本申请实施例中,在目标对象的传输过程中,Host侧与Guest侧之间的通信交互通过Qemu Pipe来实现,不予一一说明。If the Guest side determines that the drag-and-drop Android application window and release location allow dragging in the target object, the target object is the target file, and the remaining disk space of the Android system is greater than or equal to the total file size of the target file, then the guest side builds an empty file. The drag start event of is used to mark the start of the drag event. And, the Guest side notifies the Host side to start transferring the target file. It should be noted that, in the embodiment of the present application, during the transmission process of the target object, the communication interaction between the Host side and the Guest side is realized through Qemu Pipe, which will not be explained one by one.
若Guest侧确定拖拽释放的Android应用程序的窗口或释放位置不允许拖入目标对象,则Host侧通知源窗口结束本次拖拽。If the Guest side determines that the drag-and-drop Android application window or release location does not allow the target object to be dragged in, the Host side notifies the source window to end the drag-and-drop.
608、Host侧将目标文件拷贝至9p共享文件夹,基于Qemu Pipe将目标文件的文件名信息通知给Guest侧,并在目标文件拷贝完成后通知Guest侧。608. The Host side copies the target file to the 9p shared folder, notifies the Guest side of the file name information of the target file based on the Qemu Pipe, and notifies the Guest side after the copying of the target file is completed.
609、Guest侧根据目标文件的文件名信息,从9p共享文件夹中获取目标文件,并根据目标文件构建Android侧拖拽事件,实现目标文件到目的端Android应用程序的传输。609. The Guest side obtains the target file from the 9p shared folder according to the file name information of the target file, and constructs an Android-side drag event according to the target file, so as to realize the transmission of the target file to the target Android application program.
Guest侧从9p共享文件夹中读取目标文件后,根据目标文件的数据构建Android侧的拖拽事件。其中,Android系统的媒体库是一个数据库文件,当系统启动完成或者收到相关广播消息时,Android系统会扫描文件系统中的数据,将新增和删除的文件信息更新到媒体库中。应用程序可以通过URI从媒体库中读取文件系统中的文件信息。Host侧将目标文件拷贝至9p共享文件夹中后,会通知Guest侧目标文件的文件名,Guest侧根据文件名和9p共享文件夹的路径可读取到该目标文件。在一些方案中,Guest侧将该目标文件添加至媒体库,获取该目标文件对应的URI,之后就可以通过URI去媒体库中快速读取该目标文件,并根据该目标文件构建拖拽事件。After the Guest side reads the target file from the 9p shared folder, it constructs a drag event on the Android side according to the data of the target file. Wherein, the media library of the Android system is a database file. When the system starts up or receives relevant broadcast messages, the Android system will scan the data in the file system, and update the newly added and deleted file information into the media library. The application can read the file information in the file system from the media library through the URI. After the host side copies the target file to the 9p shared folder, it will notify the guest side of the file name of the target file, and the guest side can read the target file according to the file name and the path of the 9p shared folder. In some solutions, the Guest side adds the target file to the media library, obtains the URI corresponding to the target file, and then quickly reads the target file from the media library through the URI, and constructs a drag event based on the target file.
Guest侧将拖拽事件下发给目的端Android应用程序和释放位置,这样可以模拟Android操作系统的拖拽传输,实现目标文件到目的Android应用程序及释放位置的传输,从而实现目标文件从Windows应用程序到Android应用程序的传输。The Guest side sends the drag event to the target Android application and the release location, which can simulate the drag and drop transfer of the Android operating system, and realize the transfer of the target file to the target Android application and the release location, thereby realizing the transfer of the target file from the Windows application Program to Android application transfer.
在一些实施例中,在上述步骤608中,Host侧可以将文件名信息和时间戳信息通 知给Guest侧。该时间戳信息用于标记不同时间对应的不同次拖拽的文件。这样,即便多次拖拽的目标文件有相同的文件名,目的端也可以基于该时间戳信息准确地获取到每次拖拽分别对应的文件内容,而不会出现本次拖拽的文件被上一次拖拽的重名文件所覆盖的情况。In some embodiments, in the above step 608, the Host side may notify the Guest side of the file name information and time stamp information. The timestamp information is used to mark files dragged and dropped at different times corresponding to different times. In this way, even if the target file dragged multiple times has the same file name, the destination can accurately obtain the corresponding file content for each drag and drop based on the timestamp information, and the dragged file will not be deleted. The case where the file with the same name that was dragged last time was overwritten.
其中,在步骤608-609的一种技术方案中,当一次拖拽的目标文件包括多个文件时,Host侧拷贝完目标文件中的全部文件至9p共享文件夹后,通知Guest侧拷贝完成。Guest侧从9p共享文件夹中读取拷贝完成的目标文件,并构建Android侧拖拽事件,实现9P共享文件夹至Android应用程序的目标文件的传输。Wherein, in a technical solution of steps 608-609, when the target file dragged at one time includes multiple files, after the Host side copies all the files in the target file to the 9p shared folder, it notifies the Guest side that the copying is complete. The guest side reads the copied target file from the 9p shared folder, and builds a drag event on the Android side to realize the transfer of the target file from the 9p shared folder to the Android application.
在步骤608-609的另一种技术方案中,当一次拖拽的目标文件包括多个文件时,Host侧每拷贝完一个文件至9p共享文件夹,就通知Guest侧该单个文件拷贝完成。Guest侧从9p共享文件夹中读取拷贝完成的该文件,并构建Android侧拖拽事件,实现9P共享文件夹至Android应用程序的目标文件的传输。In another technical solution of steps 608-609, when the target file to be dragged once includes multiple files, the Host side will notify the Guest side that the copying of the single file is completed every time a file is copied to the 9p shared folder. The Guest side reads the copied file from the 9P shared folder, and builds a drag event on the Android side to realize the transfer of the 9P shared folder to the target file of the Android application.
在该方案中,Host侧每拷贝完一个文件都将该单个文件的文件名信息通知Guest侧,Guest侧根据文件名和9p共享文件夹的路径可读取到该单个文件,然后将该单个文件添加至媒体库,获取该文件对应的URI,之后就可以通过URI去媒体库中快速读取该单个文件,并构建单个文件的拖拽事件。Guest侧将该拖拽事件下发给目的端应用程序及释放位置,从而将单个文件传输至目的应用程序的拖拽释放位置。Host侧待一次拖拽所有目标文件拷贝完成后,通知Guest侧。In this scheme, every time the Host side copies a file, it will notify the Guest side of the file name information of the single file, and the Guest side can read the single file according to the file name and the path of the 9p shared folder, and then add the single file to Go to the media library, get the URI corresponding to the file, and then quickly read the single file in the media library through the URI, and build a drag event for a single file. The Guest side sends the dragging event to the destination application program and the release location, so as to transfer a single file to the destination application program's drag release location. The Host side notifies the Guest side after one drag and drop of all target files is copied.
基于该方案,Host侧每拷贝完一个文件,Guest侧就可以及时获取到该文件并构建Android侧拖拽事件,而不用等到目标文件中的全部文件都拷贝完成后再获取文件并传输,可以减少等待时延,提高文件传输效率。Based on this scheme, every time a file is copied on the Host side, the Guest side can obtain the file in time and build an Android-side drag event, instead of waiting for all the files in the target file to be copied before obtaining the file and transferring it, which can reduce the Wait for time delay, improve file transfer efficiency.
其中,Guest侧构建的拖拽事件(比如单个文件的拖拽事件)可以包括如下四个事件:拖拽开始事件DragEvent.ACTION_DRAG_STARTED,拖拽在目标窗口中的位置事件DragEvent.ACTION_DRAG_LOCATION,拖拽释放事件DragEvent.ACTION_DROP,以及拖拽结束事件DragEvent.ACTION_DRAG_ENDED。上述四个事件一次性地通知给目的窗口的释放位置,即可模拟一次完整的拖拽事件。Among them, the drag event built on the Guest side (such as a single file drag event) can include the following four events: drag start event DragEvent.ACTION_DRAG_STARTED, drag event DragEvent.ACTION_DRAG_LOCATION in the target window, drag release event DragEvent.ACTION_DROP, and drag end event DragEvent.ACTION_DRAG_ENDED. The above four events are notified to the release position of the target window at one time, which can simulate a complete drag event.
值得说明的是,原生Android系统本身不会产生拖拽事件,需要应用程序进行处理,当鼠标点中或触摸文件一定时间后,Android系统会回调onLongClick消息,通过调用接口startDrag()可以激活拖拽。在本申请实施例中,拖拽效果是通过Windows侧的拖拽事件实现的,Android侧不需要调用startDrag()方法,只需要Host侧将DragEvent拖拽事件通知给目的窗口的相应位置即可。It is worth noting that the native Android system itself does not generate drag events, which need to be processed by the application. When the mouse is clicked or the file is touched for a certain period of time, the Android system will call back the onLongClick message, and the drag can be activated by calling the interface startDrag() . In the embodiment of the present application, the drag effect is realized through the drag event on the Windows side, and the Android side does not need to call the startDrag() method, and only needs to notify the DragEvent drag event to the corresponding position of the target window on the Host side.
若目标对象类型为文本,则在用户释放拖拽的目标对象之后,该方法还包括:If the target object type is text, after the user releases the dragged target object, this method also includes:
610、在Host侧检测到拖拽的目标对象被释放后,若目标对象为目标文本,则Host侧基于Qemu Pipe将目标文本通知给Guest侧。610. After the Host side detects that the dragged target object is released, if the target object is the target text, the Host side notifies the Guest side of the target text based on the Qemu Pipe.
由于目标文本的数据量相对于文件来说通常较小,因而在拖拽的目标文本被释放后,Host侧可以基于Qemu Pipe将目标文本的文本内容通知给Guest侧,而不用通过9p文件夹进行中转,因而传输速度更快。Since the data volume of the target text is usually small compared to the file, after the dragged target text is released, the Host side can notify the Guest side of the text content of the target text based on the Qemu Pipe instead of going through the 9p folder. Transit, so the transmission speed is faster.
如前所述,目标文本也可以在通知拖入事件时通知给Guest侧,在获知Guest侧允许拖入后通知给Guest侧,或者在其他时机通知给Guest侧。As mentioned above, the target text can also be notified to the Guest side when the drag-in event is notified, notified to the Guest side after being informed that the Guest side allows the drag-in, or notified to the Guest side at other timings.
在步骤605之后,该方法还包括:After step 605, the method also includes:
611、若Guest侧根据拖拽信息2判断拖拽释放窗口及释放位置允许拖入目标对象,则构建空的拖拽开始事件,并根据目标文本构建Android侧拖拽事件,实现目标文本到目的端Android应用程序的传输。611. If the Guest side judges according to the drag information 2 that the drag-and-drop release window and the release position allow the target object to be dragged in, then construct an empty drag-and-drop start event, and construct an Android-side drag-and-drop event according to the target text, so as to realize the target text to the destination Transfer of Android applications.
其中,该拖拽开始事件的数据为空;Guest侧根据目标文本构建的Android侧拖拽事件是根据数据“目标文本”构建的,数据不为空。Wherein, the data of the drag start event is empty; the drag event on the Android side constructed on the Guest side based on the target text is constructed based on the data "target text", and the data is not empty.
在另一些实施例中,若目标对象类型为文本,则作为步骤610-611的一种替换方案,在步骤605之后,该方法还包括:In other embodiments, if the target object type is text, as an alternative to steps 610-611, after step 605, the method further includes:
若Guest侧确定允许拖入目标对象,且目标对象为目标文本,则Guest侧构建空的拖拽开始事件,并基于Qemu Pipe通知Host侧允许拖入并请求传输目标文本。Host侧基于Qemu Pipe将目标文本传输给Guest侧。Guest侧根据目标文本构建Android侧拖拽事件,实现目标文本到目的端Android应用程序的传输。If the Guest side determines that the target object is allowed to be dragged in, and the target object is the target text, the Guest side constructs an empty drag start event, and notifies the Host side based on the Qemu Pipe to allow dragging in and request the transmission of the target text. The Host side transmits the target text to the Guest side based on Qemu Pipe. The Guest side constructs the Android side drag event according to the target text, and realizes the transmission of the target text to the target Android application program.
如图6C所示,在步骤609或步骤611之后,该方法还可以包括:As shown in FIG. 6C, after step 609 or step 611, the method may further include:
612、Guest侧构建空的拖拽结束事件,目的端Android应用程序根据目标对象和释放位置进行相应处理。612. The Guest side constructs an empty drag-and-drop end event, and the destination Android application performs corresponding processing according to the target object and the release position.
Guest侧可以构建空的拖拽结束事件,表示本次目标对象的拖拽传输过程结束。并且,当目标对象传输至Guest侧目的端Android应用程序后,目的端Android应用程序可以基于Android操作系统的拖拽流程以及具体的释放位置,对目标对象进行相应的处理。比如,目标对象为目标文件,释放位置位于Android文件管理的窗口,Android文件管理将目标文件放在释放位置对应的目录下;再比如,释放位置位于Android文件管理的窗口中某个文件夹所在的位置,则Android文件管理将目标文件放在该文件夹对应的目录下;再比如,释放位置位于Android社交应用窗口的信息编辑窗口内,Android社交应用(例如微信
Figure PCTCN2022106970-appb-000001
Figure PCTCN2022106970-appb-000002
等)将目标文件发送给联系对象(比如其他联系人或其他设备)。比如,目标对象为目标文本,释放位置位于Android社交应用窗口的信息编辑窗口内,Android社交应用将目标文本发送给联系人;再比如,目标对象为目标文本,释放位置位于Android文本编辑器的窗口内,Android文本编辑器将目标文本插入到窗口内的拖拽释放位置。
On the Guest side, an empty drag-and-drop event can be constructed to indicate the end of the drag-and-drop transfer process of the target object. Moreover, after the target object is transferred to the guest-side Android application program, the target-end Android application program can perform corresponding processing on the target object based on the drag-and-drop process of the Android operating system and the specific release location. For example, the target object is the target file, and the release location is located in the window of the Android file management, and the Android file management places the target file under the directory corresponding to the release location; location, then the Android file management will place the target file in the directory corresponding to the folder; for another example, the release location is located in the information editing window of the Android social application window, and the Android social application (such as WeChat
Figure PCTCN2022106970-appb-000001
or
Figure PCTCN2022106970-appb-000002
etc.) to send the target file to the contact object (such as other contacts or other devices). For example, the target object is the target text, and the release position is located in the information editing window of the Android social application window, and the Android social application sends the target text to the contact person; for another example, the target object is the target text, and the release position is located in the window of the Android text editor , the Android text editor inserts the target text at the drag-and-drop location within the window.
示例性的,基于图7A中的(a)-(b)所示的用户将目标文件从Windows资源管理器窗口到Android文件管理窗口的拖拽操作,参见图7A中的(c),Android文件管理窗口704中添加了目标文件,即添加了文档1和文档2,实现了目标文件从Windows资源管理器到Android文件管理的复制。Exemplary, based on the user shown in (a)-(b) in Figure 7A, the user drags and drops the target file from the Windows Explorer window to the Android file management window, referring to (c) in Figure 7A, the Android file The target file is added in the management window 704, that is, document 1 and document 2 are added, and the copying of the target file from the Windows Explorer to the Android file management is realized.
在一些实施例中,当目标对象为目标文件时,在目标文件的传输过程中,Host侧还可以显示传输进度条。例如,该传输进度条为复制进度条,Guest侧通知Host侧开始传输目标文件后,复制进度条开始显示。在Guest侧将目标文件传输到Android应用程序后,复制进度条显示完成。示例性的,复制进度条可以参见图7A中的(d)所示的控件705。此外,在拖拽传输过程中,进度条还可以根据文件数量提示用户总共拖拽几个文件,当前正在传输第几个文件等信息。进度条还可以根据文件总大小,提示用户当前的传输进度。In some embodiments, when the target object is a target file, during the transmission process of the target file, the Host side may also display a transmission progress bar. For example, the transfer progress bar is a copy progress bar, and after the Guest side notifies the Host side to start transferring the target file, the copy progress bar starts to be displayed. After the target file is transferred to the Android application on the Guest side, the copy progress bar shows completion. Exemplarily, the copying progress bar may refer to the control 705 shown in (d) in FIG. 7A. In addition, during the drag-and-drop transfer process, the progress bar can also prompt the user according to the number of files to drag and drop a total of several files, which file is currently being transferred, and other information. The progress bar can also prompt the user for the current transmission progress according to the total file size.
需要说明的是,图7A是以Windows应用程序为Windows资源管理器,Android 应用程序为Android文件管理为例进行说明的,当Windows应用程序和Android应用程序为其他应用程序时,仍可以采用以上实施例提供的方法,实现从Windows应用程序到Android应用程序的文件传输,此处不再一一举例。其中,当Windows应用程序为Windows资源管理器以外的其他Windows应用程序时,该其他Windows应用程序本身支持拖拽至其他应用程序,且可以通过调用OLE Drag/Drop接口实现拖拽。It should be noted that, Figure 7A uses the Windows application program as Windows Explorer and the Android application program as Android file management as an example. When the Windows application program and the Android application program are other application programs, the above implementation can still be used. The method provided by the example implements the file transfer from the Windows application program to the Android application program, and no more examples are given here. Wherein, when the Windows application program is other Windows application programs other than Windows Explorer, the other Windows application programs themselves support dragging to other application programs, and drag and drop can be realized by calling the OLE Drag/Drop interface.
示例性的,目标对象为目标文件,Windows应用程序为Windows资源管理器,Android应用程序为Android社交应用,参见图7B中的(a)-(b),用户将目标文件从Windows资源管理器窗口拖拽到Android社交应用窗口中的信息编辑窗口后,Android社交应用窗口中添加了目标文件,且目标文件发送给了Android社交应用的聊天界面中的联系人,实现了目标文件从Windows资源管理器到Android社交应用的复制。Exemplary, the target object is the target file, the Windows application is the Windows Explorer, and the Android application is the Android social application. Referring to (a)-(b) in Figure 7B, the user selects the target file from the Windows Explorer window After dragging to the information editing window in the Android social application window, the target file is added to the Android social application window, and the target file is sent to the contact in the chat interface of the Android social application, realizing that the target file can be downloaded from the Windows Explorer Copy to Android social apps.
再示例性的,目标对象为目标文本,参见图7C中的(a),用户从Windows应用程序1的窗口710中开始拖拽目标文本“鸿蒙操作系统是一款基于微内核的面向全场景的分布式操作系统”。用户将目标文本拖拽至Android应用程序(如安卓社交应用)窗口720的信息编辑窗口后,释放拖拽的目标文本。基于图7C中的(a)所示的用户将目标文本从Windows应用程序(如Windows应用程序1)的窗口710到Android应用程序(如Android社交应用)的窗口720中信息编辑窗口的拖拽操作,参见图7C中的(b),Android应用程序的窗口中添加了目标文本,且目标文本发送给了聊天界面对应的联系人,实现了目标文本从Windows应用程序到Android应用程序的复制。可选地,如图7C中的(a)所示,在拖拽过程中还可以显示拖拽图标730。Another example, the target object is the target text, see (a) in Figure 7C, the user starts to drag the target text from the window 710 of the Windows application 1 "Hongmeng OS is a microkernel-based full-scenario-oriented Distributed Operating System". After the user drags and drops the target text to the information editing window of the Android application program (such as Android social application) window 720, releases the dragged target text. Based on the user shown in (a) in Figure 7C, the drag operation of the target text from the window 710 of the Windows application program (such as Windows application program 1) to the window 720 of the Android application program (such as Android social application) , referring to (b) in FIG. 7C , the target text is added to the window of the Android application, and the target text is sent to the contact corresponding to the chat interface, realizing the copying of the target text from the Windows application to the Android application. Optionally, as shown in (a) of FIG. 7C , a dragging icon 730 may also be displayed during the dragging process.
需要说明的是,在场景(1)中,以上多个实施例中的部分或全部步骤(例如图6C所示流程中的部分步骤),在不冲突的情况下,可以重新组合,从而构成新的实施例。本申请实施例对此不再具体说明。It should be noted that in scenario (1), some or all of the steps in the above multiple embodiments (such as some steps in the process shown in Figure 6C) can be recombined to form a new the embodiment. This embodiment of the present application will not specifically describe this.
可见,针对上述场景(1),本申请实施例通过Qemu Pipe通信可以实现Android模拟器Host侧与Guest侧之间进行通信交互,基于Windows侧窗口标识与Android侧窗口标识的一一对应关系,可以根据拖拽释放位置所在的Windows侧窗口确定目的端Android应用程序的窗口,并且通过Virtio-9p实现Windows侧与Android侧的文件共享,通过Qemu Pipe实现Windows侧与Android侧的文本共享,从而实现Android应用程序与Windows应用程序之间拖拽传输文件或文本。It can be seen that for the above scenario (1), the embodiment of the present application can realize communication interaction between the Android emulator Host side and the Guest side through Qemu Pipe communication, and based on the one-to-one correspondence between the Windows side window ID and the Android side window ID, it can Determine the window of the target Android application according to the window on the Windows side where the drag and drop position is located, and realize file sharing between the Windows side and the Android side through Virtio-9p, and realize text sharing between the Windows side and the Android side through Qemu Pipe, thereby realizing Android Drag and drop to transfer files or text between applications and Windows applications.
在图6A-图7C描述的方案中,基于用户将目标对象从源端Windows应用程序的窗口,拖拽至目的端Android应用程序的窗口的简单的一步拖拽操作,即可实现Windows应用程序到Android应用程序的目标对象的传输,而不用像现有技术那样需要用户进行多步、复杂的操作。并且,用户通过鼠标等输入设备在窗口间的拖拽操作,更符合用户基于Windows操作系统和电脑的操作使用习惯,因而用户使用体验较好,能够增加产品的竞争力。而且,该方案不需要像现有技术那样依赖adb、socket通信和网络能力等因素,不会受到这些因素的限制,因而文件传输速度快且安全可靠。In the solution described in Fig. 6A-Fig. 7C, based on the simple one-step drag operation of the user dragging the target object from the window of the source Windows application to the window of the target Android application, the Windows application can be implemented to The transmission of the target object of the Android application program does not require the user to perform multi-step and complicated operations as in the prior art. Moreover, the user's dragging operation between windows through the mouse and other input devices is more in line with the user's operating habits based on the Windows operating system and computers, so the user experience is better and the competitiveness of the product can be increased. Moreover, the solution does not need to rely on factors such as adb, socket communication, and network capabilities like the prior art, and will not be limited by these factors, so the file transfer speed is fast and safe and reliable.
场景(2)、一步拖拽实现Android应用程序到Windows应用程序的文件传输:Scenario (2), one-step drag and drop to realize file transfer from Android application to Windows application:
在该交互场景中,用户可以通过鼠标或触摸屏等输入设备,将电脑屏幕上显示的Android应用程序窗口中的目标对象,拖拽至Windows应用程序的窗口中。电脑响应 于用户的拖拽操作,将Android应用程序中的目标对象传输至Windows应用程序,实现Android应用程序到Windows应用程序的目标对象的复制。In this interaction scenario, the user can drag and drop the target object in the Android application window displayed on the computer screen to the Windows application window through an input device such as a mouse or a touch screen. The computer transmits the target object in the Android application program to the Windows application program in response to the user's drag operation, so as to realize the copying of the target object from the Android application program to the Windows application program.
在一些实施例中,在该交互场景下,参见图8A,拖拽源Android应用程序触发拖拽目标文件,Android模拟器的Guest侧(即安卓系统)将目标文件拷贝至9p共享文件夹,然后通过Qemu Pipe通信通知Host侧。Host侧从9p共享文件夹中将目标文件剪切至拖拽释放的Windows资源管理器。或者,Host侧从9p共享文件夹读取该目标文件,并根据目标文件构建Windows侧拖拽事件(如OLE Drag/Drop拖拽事件),将目标文件传输至Windows资源管理器以外的其他Windows应用程序。In some embodiments, in this interaction scenario, referring to FIG. 8A, the drag source Android application triggers the drag target file, and the Guest side of the Android emulator (i.e., the Android system) copies the target file to the 9p shared folder, and then Notify the Host side through Qemu Pipe communication. On the Host side, cut the target file from the 9p shared folder to the Windows Explorer that is dragged and released. Or, the Host side reads the target file from the 9p shared folder, and constructs a Windows-side drag event (such as OLE Drag/Drop drag event) based on the target file, and transfers the target file to other Windows applications other than Windows Explorer program.
或者,在该交互场景下,参见图8A,拖拽源Android应用程序触发拖拽目标文本,Guest侧基于Qemu Pipe将目标文本(即文本内容)通知给Host侧。Host侧构建Windows侧拖拽事件(如OLE Drag/Drop拖拽事件),将目标文本传输至Windows应用程序。Or, in this interaction scenario, referring to FIG. 8A, the drag source Android application triggers the drag target text, and the Guest side notifies the Host side of the target text (ie text content) based on Qemu Pipe. Host side builds Windows side drag events (such as OLE Drag/Drop drag events), and transfers the target text to Windows applications.
在另一些实施例中,在该交互场景下,参见图8B,本申请提供的跨系统传输目标对象的方法可以包括以下流程:拖拽源Android应用程序触发拖拽,安卓模拟器Guest侧(即Android系统)基于管道通信Qemu Pipe向Host侧通知拖拽事件,包括通知拖拽位置对应的安卓侧窗口标识,目标对象类型,当目标对象为目标文件时的文件名信息(比如文件名拼接)、文件总大小和文件数量,以及目标对象为目标文本时的文本长度和文本内容等信息。若目标对象类型为文件,则Host侧构建Windows侧拖拽事件(如OLE Drag/Drop拖拽事件)。若拖拽释放的目的窗口为Windows应用程序的窗口,则Host侧还可以进行权限或容量等检查。Host侧基于Qemu Pipe通知Guest侧开始传输文件。Guest侧将目标文件拷贝至9p共享文件夹。In some other embodiments, in this interaction scenario, referring to FIG. 8B , the method for transferring a target object across systems provided by the present application may include the following process: the dragging source Android application triggers dragging, and the Android emulator Guest side (i.e. Android system) based on the pipeline communication Qemu Pipe to notify the host side of the drag event, including the Android side window ID corresponding to the notification drag position, the target object type, the file name information (such as file name splicing) when the target object is the target file, The total file size and number of files, as well as the text length and text content when the target object is the target text. If the target object type is a file, the Host side builds a Windows side drag event (such as OLE Drag/Drop drag event). If the target window to be dragged and dropped is a window of a Windows application, then the Host side can also perform permission or capacity checks. The Host side notifies the Guest side to start transferring files based on the Qemu Pipe. Copy the target file to the 9p shared folder on the Guest side.
而后,继续参见图8B,若拖拽释放的目的端为Windows资源管理器,则Guest侧基于Qemu Pipe依次将目标文件中单个文件的文件名称,以及文件索引(比如可以表示当前文件为目标文件中的第几个文件等)或文件大小等信息通知给Host侧。Host侧取消OLE Drag/Drop拖拽事件,将目标文件中的单个文件依次剪切至Windows资源管理器。或者,若拖拽释放的目的端为Windows资源管理器以外的其他Windows应用程序,则待所有文件传输至9p共享文件夹后,Guest侧通知Host侧所有文件拷贝完成,Host侧结束Windows侧拖拽事件,IDropSource::QueryContinueDrag()接口返回DRAGDROP_S_DROP状态,标志当前拖拽结束。Host侧响应于该拖拽结束事件,将目标文件传输至目的Windows应用程序。Then, continue to refer to Fig. 8B, if the destination end of dragging and releasing is Windows Explorer, then the Guest side sequentially transfers the file name and file index of a single file in the target file based on the Qemu Pipe (for example, it can indicate that the current file is the target file in the target file). The number of the file, etc.) or the file size and other information are notified to the Host side. The host side cancels the OLE Drag/Drop drag event, and cuts the individual files in the target file to the Windows Explorer in turn. Or, if the destination of dragging and dropping is a Windows application other than Windows Explorer, after all files are transferred to the 9p shared folder, the Guest side notifies the Host side that all files have been copied, and the Host side ends the Windows side dragging event, the IDropSource::QueryContinueDrag() interface returns the DRAGDROP_S_DROP state, marking the end of the current drag. The Host side transmits the target file to the target Windows application program in response to the drag end event.
参见图8B,若目标对象类型为文本,则在Guest侧通知Host侧拖拽事件后,Host侧构建Windows侧拖拽事件。若拖拽释放的目的端为Windows资源管理器,则Host侧取消Windows侧拖拽事件,并将目标文本剪切至Windows资源管理器。若拖拽释放的目的端为Windows资源管理器以外的其他Windows应用程序,则Host侧结束Windows侧拖拽事件,Host侧响应于该拖拽结束事件,将目标文本传输至目的Windows应用程序。Host侧通知Guest侧结束拖拽。Referring to FIG. 8B , if the target object type is text, after the Guest side notifies the Host side of the drag event, the Host side constructs a Windows side drag event. If the destination of dragging and dropping is Windows Explorer, the Host side cancels the dragging event on the Windows side, and cuts the target text to Windows Explorer. If the destination of dragging and releasing is a Windows application program other than Windows Explorer, the Host side ends the Windows side dragging event, and the Host side transmits the target text to the destination Windows application program in response to the dragging end event. The Host notifies the Guest to end the dragging.
在其他一些实施例中,结合图8C所示的流程图及图9所示的界面示意图,对本申请提供的跨系统传输目标对象的方法进行详细说明:In some other embodiments, with reference to the flow chart shown in FIG. 8C and the schematic interface shown in FIG. 9 , the method for transferring target objects across systems provided by this application is described in detail:
800、Guest侧检测到Android应用程序的窗口中的目标对象被触发拖拽,拖拽源Android应用程序触发拖拽事件。800. The Guest side detects that the target object in the window of the Android application program is dragged, and the drag source Android application program triggers a drag event.
比如,Guest侧检测到触发拖拽对应的鼠标事件,该鼠标事件用于表示从Android应用程序的窗口中开始拖拽目标对象。示例性的,参见图9中的(a),用户通过鼠标选中Android文件管理的窗口901中的目标对象,即图片b,并开始拖拽该目标对象,此时Guest侧检测到触发拖拽对应的该鼠标事件。For example, the Guest side detects that a mouse event corresponding to the dragging is triggered, and the mouse event is used to indicate that the target object is started to be dragged from the window of the Android application program. Exemplarily, referring to (a) in FIG. 9 , the user selects the target object in the window 901 of Android file management by the mouse, that is, picture b, and starts to drag the target object. At this time, the Guest side detects that the drag corresponding of the mouse event.
在开始拖拽后,Host侧可以通过获取拖拽源窗口的窗口标识(比如句柄),然后遍历维护的窗口标识的对应关系,若该对应关系中不存在拖拽源窗口的窗口标识对应的窗口标识,则可以判断拖拽源窗口为Windows应用程序窗口;否则拖拽源窗口为Android应用程序窗口。在步骤800中,拖拽源窗口为Windows应用程序的窗口。After starting the drag, the host side can obtain the window ID (such as handle) of the drag source window, and then traverse the corresponding relationship of the maintained window ID, if there is no window corresponding to the window ID of the drag source window in the corresponding relationship ID, it can be determined that the dragging source window is a Windows application window; otherwise, the dragging source window is an Android application window. In step 800, the dragging source window is a window of a Windows application.
801、Guest侧将拖拽信息3通知给Host侧,该拖拽信息3包括拖拽源窗口对应的Android侧窗口标识和目标对象类型。801. The Guest side notifies the Host side of the dragging information 3, where the dragging information 3 includes the Android side window identifier and the target object type corresponding to the dragging source window.
拖拽源Android应用触发拖拽事件后,Guest侧可以将该拖拽事件通知给Host侧。Guest侧可以将拖拽信息3通知给Host侧,该拖拽信息3可以包括拖拽源窗口对应的Android侧窗口标识和目标对象类型,以便Host侧获知拖拽源端和待传输的目标对象的具体类型。其中,该目标对象类型可以为文件或文本等。After the drag source Android application triggers the drag event, the Guest side can notify the Host side of the drag event. The Guest side can notify the Host side of the dragging information 3, and the dragging information 3 can include the Android side window identification and the target object type corresponding to the dragging source window, so that the Host side can know the dragging source and the target object to be transmitted. specific type. Wherein, the target object type may be a file or a text.
此外,如果目标对象为目标文件,则该拖拽信息3还可以包括目标文件的总大小和目标文件包括的文件数量等信息。如果目标对象为目标文本,则该拖拽信息3还可以包括目标文本的长度或目标文本的内容等信息。In addition, if the target object is a target file, the drag information 3 may also include information such as the total size of the target file and the number of files included in the target file. If the target object is target text, the drag information 3 may also include information such as the length of the target text or the content of the target text.
若目标对象为目标文本,则执行步骤804。可选地,如果目标对象为目标文件,则在步骤804之前还执行步骤802-803。If the target object is the target text, go to step 804 . Optionally, if the target object is a target file, steps 802-803 are also performed before step 804.
802、若目标对象为目标文件,则Guest侧还将目标对象的文件名信息和拖拽图标通知给Host侧。802. If the target object is a target file, the Guest side also notifies the Host side of the file name information and the drag icon of the target object.
该文件名信息用于表示待传输目标文件的文件名。当目标文件包括多个文件时,该文件名信息可以为文件名拼接信息,例如为1.txt|2.txt|3.txt。The file name information is used to indicate the file name of the target file to be transferred. When the target file includes multiple files, the file name information may be file name concatenation information, for example, 1.txt|2.txt|3.txt.
803、Host侧根据文件名信息构建Windows侧拖拽事件,并设置拖拽图标。803. The Host side constructs a Windows side drag event according to the file name information, and sets a drag icon.
例如,Host侧可以根据文件名拼接信息构建Windows侧的OLE Drag/Drop拖拽事件。该拖拽事件可以指定拖拽图标。Host侧可以在拖拽过程中跟随拖拽位置(例如拖拽过程中鼠标的光标所在位置)实时显示拖拽图标。该拖拽图标可以使得用户直观地获知当前正在拖拽文件以及当前的拖拽位置。For example, the Host side can construct the OLE Drag/Drop event on the Windows side according to the splicing information of the file name. The drag event can specify a drag icon. The host side can follow the dragging position during the dragging process (for example, the position of the cursor of the mouse during the dragging process) and display the dragging icon in real time. The dragging icon can let the user intuitively know that the file is currently being dragged and the current dragging position.
在一些实施例中,该拖拽图标可以用于表示目标文件的类型、目标文件包括的数量、目标文件的总大小、目标文件源端应用程序对应的图标或源端应用程序对应的操作系统等信息中的一种或多种。比如,该拖拽图标可以为目标文件包括的文件的缩略图。示例性的,参见图9中的(a),在拖拽过程中,鼠标的光标位置实时显示有拖拽图标902,该拖拽图标902的右上角显示有数字2,表示拖拽的目标文件中包括2个文件。In some embodiments, the drag icon can be used to represent the type of the target file, the quantity included in the target file, the total size of the target file, the icon corresponding to the source application of the target file or the operating system corresponding to the source application, etc. one or more of the information. For example, the drag icon may be a thumbnail of a file included in the target file. Exemplarily, referring to (a) in FIG. 9 , during the dragging process, a dragging icon 902 is displayed in real time at the cursor position of the mouse, and a number 2 is displayed in the upper right corner of the dragging icon 902, indicating the dragged target file Include 2 files.
如果目标对象的拖拽位置在Android应用程序源窗口中移动,则显示禁止拖拽符号;如果拖拽在源窗口中释放,则结束本次拖拽事件。如果拖拽在Windows应用程序的窗口中释放,则执行图8C所示的后续步骤。如果拖拽在Android应用程序非源窗口中释放,则可以执行图11C所示的步骤1104及其后续流程。If the dragging position of the target object moves in the source window of the Android application, the dragging prohibition symbol is displayed; if the dragging is released in the source window, the dragging event ends. If the drag is released in the window of the Windows application, the subsequent steps shown in Figure 8C are performed. If the drag is released in the non-source window of the Android application, step 1104 and its subsequent processes shown in FIG. 11C can be executed.
804、在Host侧检测到拖拽的目标对象被释放后,若拖拽释放窗口为Windows应 用程序的窗口,则Host侧基于Qemu Pipe将拖拽信息4通知给Guest侧,该拖拽信息4包括传输类型。804. After the Host side detects that the dragged target object is released, if the dragged release window is a window of a Windows application, the Host side notifies the Guest side of the dragging information 4 based on the Qemu Pipe, and the dragging information 4 includes transport type.
比如,Host侧检测到释放对应的鼠标事件,该鼠标事件用于表示拖拽的目标对象被释放。示例性的,参见图9中的(a),用户通过鼠标将目标文件拖入Windows资源管理器的窗口903后,通过鼠标释放拖拽的目标文件,此时Host侧检测到释放对应的鼠标事件。For example, the host side detects a mouse event corresponding to the release, and the mouse event is used to indicate that the dragged target object is released. Exemplarily, referring to (a) in FIG. 9 , after the user drags the target file into the window 903 of the Windows Explorer through the mouse, the user releases the dragged target file through the mouse, and at this time, the Host side detects a mouse event corresponding to the release .
Host侧可以通过WindowFromPoint()函数获取拖拽释放位置对应的窗口标识(比如句柄),然后遍历维护的对应关系,若该对应关系中存在拖拽源窗口的窗口标识对应的窗口标识,则可以判断拖拽释放窗口为Android应用程序窗口;否则拖拽释放窗口为Windosws应用程序窗口。此处,拖拽释放窗口为Windows应用程序的窗口。The host side can use the WindowFromPoint() function to obtain the window ID (such as a handle) corresponding to the drag and drop position, and then traverse the corresponding relationship maintained. If there is a window ID corresponding to the window ID of the drag source window in the corresponding relationship, it can be judged The drag-and-drop window is an Android application window; otherwise, the drag-and-drop window is a Windows application window. Here, the drag-and-drop window is a window of a Windows application.
若拖拽释放窗口为Windows应用程序的窗口,则Host侧还可以通过该Windows应用程序进行权限、容量等检查,以确定是否能够正常拖入目标对象。If the drag-and-drop window is a window of a Windows application, the Host side can also check the authority and capacity of the Windows application to determine whether the target object can be dragged in normally.
由于拖拽源窗口为Android应用程序的窗口,拖拽释放窗口为Windows应用程序的窗口,因而该传输类型为Android应用程序与Windows应用程序之间的传输。Host侧将拖拽信息4通知给Guest侧,该拖拽信息4包括传输类型,以便Guest侧根据该传输类型进行相应的传输处理。此外,拖拽信息4还可以包括拖拽相关的其他信息,不予限定。Since the dragging source window is the window of the Android application program, and the dragging and dropping window is the window of the Windows application program, the transfer type is the transfer between the Android application program and the Windows application program. The Host side notifies the Guest side of the dragging information 4, where the dragging information 4 includes the transmission type, so that the Guest side performs corresponding transmission processing according to the transmission type. In addition, the drag information 4 may also include other drag-related information, which is not limited.
此外,若拖拽释放窗口为Windows应用程序的窗口,则Host侧还可以进行拖拽权限或容量等检查。比如,有些文件需要管理员权限才可以拖拽。In addition, if the drag-and-drop window is a window of a Windows application, the Host side can also check the drag permission or capacity. For example, some files require administrator privileges to drag and drop.
如果目标对象为目标文件,则执行步骤805;如果目标对象为目标文本,则执行步骤811。If the target object is a target file, execute step 805; if the target object is target text, execute step 811.
805、若目标对象为目标文件,则Host侧基于Qemu Pipe通知Guest侧传输目标文件。805. If the target object is a target file, the Host side notifies the Guest side to transmit the target file based on the Qemu Pipe.
806、Guest侧将目标文件拷贝至9p共享文件夹,基于Qemu Pipe将目标文件的文件名信息通知给Host侧,并在目标文件拷贝完成后通知Host侧。而后,执行步骤807或步骤810。806. The Guest side copies the target file to the 9p shared folder, notifies the Host side of the file name information of the target file based on the Qemu Pipe, and notifies the Host side after the copying of the target file is completed. Then, step 807 or step 810 is performed.
其中,Guest侧可以每拷贝完目标文件中的一个文件至9p共享文件夹后,就通知Host侧单个文件拷贝完成;Guest侧可以将单个文件的文件名信息,以及文件索引和文件大小等信息通知给Host侧。或者,Guest侧可以在整个目标文件都拷贝至9p共享文件夹后,再通知Host侧拷贝完成,不予限定。Guest侧可以将拷贝至9p共享文件夹中的文件的路径,通知给Host侧。Among them, the Guest side can notify the Host side that a single file copy is completed after each copy of a file in the target file to the 9p shared folder; the Guest side can notify the file name information of a single file, as well as information such as file index and file size To the Host side. Alternatively, the Guest side may notify the Host side that the copying is complete after the entire target file is copied to the 9p shared folder, which is not limited. The Guest side can notify the Host side of the path of the file copied to the 9p shared folder.
807、若目的端Windows应用程序为Windows资源管理器,且目标对象为目标文件,则Host侧取消构建的Windows侧拖拽事件。807. If the target Windows application program is Windows Explorer, and the target object is the target file, the host side cancels the constructed Windows side drag event.
808、Host侧根据目标文件的文件名信息,将9p共享文件夹中的目标文件剪切至拖拽释放位置对应的Windows资源管理器路径下。808. According to the file name information of the target file, the Host side cuts the target file in the 9p shared folder to the Windows Explorer path corresponding to the drag-and-drop position.
其中,Host侧可以在每个文件拷贝完成后,将单个文件依次剪切指目的路径;也可以在目标文件拷贝完成后,将目标文件剪切至目的路径。Wherein, the Host side can cut the single file to the specified path sequentially after each file is copied; it can also cut the target file to the target path after the target file is copied.
例如,拖拽释放位置对应的Windows资源管理器路径可以为桌面、收藏夹或D:\资料等。Host侧可以根据释放位置的全局坐标,确定拖拽释放窗口为Windows资源 管理器,并确定具体的拖拽释放路径。其中,全局坐标是相对于整个屏幕的坐标,释放位置的全局坐标是指通过鼠标进行拖拽释放时,释放位置相对于屏幕的坐标。For example, the Windows Explorer path corresponding to the drag-and-drop location may be the desktop, favorites, or D:\data. The Host side can determine that the dragging and releasing window is Windows Explorer according to the global coordinates of the releasing position, and determine the specific dragging and releasing path. Wherein, the global coordinates are coordinates relative to the entire screen, and the global coordinates of the release position refer to the coordinates of the release position relative to the screen when the mouse is dragged and released.
比如,Windows侧的窗口标识为句柄。参见图10,Host侧可以根据获取的释放位置的全局坐标,获取释放位置所在的Windows窗口的句柄。然后,Host侧获取释放位置所在的Windows窗口的父窗口句柄与类名,获取已打开的Windows资源管理器信息。而后,Host侧判断父窗口类名是否为SHELLDLL_DefView。若不是SHELLDLL_DefView,则拖拽释放窗口不是Windows资源管理器;若是SHELLDLL_DefView,则继续判断父窗口的父窗口类名是否为Worker或是Progman。如果是Worker或是Progman,则说明拖拽释放路径为Windows资源管理器中的桌面,则通过SHGetSpecialFolderPath函数获取桌面路径。如果不是Worker或是Progman,则枚举拖拽窗口父窗口句柄与所有打开的Windows资源管理器比较,确定拖拽释放位置对应的Windows资源管理器路径。For example, a window on the Windows side is identified as a handle. Referring to FIG. 10 , the host side can obtain the handle of the Windows window where the release location is located according to the acquired global coordinates of the release location. Then, the host side obtains the parent window handle and class name of the Windows window where the release location is located, and obtains the opened Windows Explorer information. Then, the Host side judges whether the class name of the parent window is SHELLDLL_DefView. If it is not SHELLDLL_DefView, the drag-and-drop window is not Windows Explorer; if it is SHELLDLL_DefView, continue to judge whether the parent window class name of the parent window is Worker or Progman. If it is Worker or Progman, it means that the dragging and dropping path is the desktop in Windows Explorer, and the path of the desktop is obtained through the SHGetSpecialFolderPath function. If it is not Worker or Progman, enumerate the parent window handle of the dragged window and compare it with all open Windows Explorers to determine the Windows Explorer path corresponding to the dragged and dropped position.
其中,若Guest侧在步骤807中每拷贝完目标文件中的一个文件至9p共享文件夹后,就通知Host侧拷贝完成,则Host侧可以在步骤808中及时将拷贝完成的该文件剪切至拖拽释放位置对应的Windows资源管理器路径下,而不用等到目标文件中的各文件都拷贝完成后再剪切,可以提高文件传输的速率。Wherein, if in step 807, after every file in the target file has been copied to the 9p shared folder, the Guest side will notify the host side that the copying is complete, then the host side can in time cut the file that has been copied to the 9p shared folder in step 808. Drag and drop to the Windows Explorer path corresponding to the drop position, instead of waiting for all files in the target file to be copied before cutting, which can improve the file transfer rate.
在一些实施例中,如果目的端Windows应用程序为Windows资源管理器,则也可以通过构建Windows侧拖拽事件来传输目标文件。其中,相较于Windows拖拽事件,通过调用剪切文件的接口实现9p共享文件夹到Windows资源管理器的文件传输速度更快。In some embodiments, if the target Windows application program is Windows Explorer, the target file can also be transferred by constructing a Windows-side drag event. Among them, compared with the Windows drag and drop event, the transfer speed of the file from the 9p shared folder to the Windows Explorer is faster by calling the interface of cutting the file.
在步骤804之后,若目的端为Windows资源管理器以外的其他Windows应用程序,则该方法还包括:After step 804, if the destination is other Windows applications other than Windows Explorer, the method also includes:
809、若目的端为Windows资源管理器以外的其他Windows应用程序,则Guest侧基于Qemu Pipe将目标文件的文件名信息通知给Host侧,并在目标文件拷贝完成后通知Host侧所有拖拽文件拷贝完成。809. If the destination is a Windows application program other than Windows Explorer, the Guest side notifies the Host side of the file name information of the target file based on the Qemu Pipe, and notifies the Host side of all dragged file copies after the target file copy is completed Finish.
810、Host侧根据目标文件的文件名信息,从将9p共享文件夹中读取目标文件,根据目标文件构建Windows侧拖拽事件(如OLE Drag/Drop拖拽事件),实现目标文件到Windows应用程序的传输,并结束该Windows侧拖拽事件。810. The host side reads the target file from the 9p shared folder according to the file name information of the target file, constructs a Windows side drag event (such as an OLE Drag/Drop drag event) according to the target file, and implements the target file to the Windows application Program transfer and end the Windows side drag event.
在一些实施例中,与步骤608中类似,在步骤806和步骤809中,Guest侧可以基于Qemu Pipe将目标文件的文件名信息和时间戳信息通知给Host侧。In some embodiments, similar to step 608, in steps 806 and 809, the Guest side may notify the Host side of the file name information and time stamp information of the target file based on the Qemu Pipe.
在一些实施例中,在目标文件的传输过程中,Host侧还可以显示传输进度条。In some embodiments, during the transmission process of the target file, the Host side may also display a transmission progress bar.
如果目标对象为目标文本,则在步骤800中Guest侧触发拖拽事件之后,该方法还包括以下步骤:If the target object is the target text, after the drag event is triggered on the Guest side in step 800, the method further includes the following steps:
811、Guest侧触发拖拽事件后,将目标文本通知给Host侧。811. After triggering the dragging event, the Guest side notifies the Host side of the target text.
812、Host侧根据目标文本构建Windows侧拖拽事件。而后,执行步骤813或步骤814。812. The Host side constructs a Windows side drag event according to the target text. Then, step 813 or step 814 is executed.
在步骤804之后,该方法还可以包括:After step 804, the method may also include:
813、若目的端为Windows资源管理器,则Host侧结束Windows侧拖拽事件,将目标文本剪切至拖拽释放位置对应的Windows资源管理器路径下,并通知Guest侧结 束拖拽。813. If the destination is Windows Explorer, the Host side ends the drag event on the Windows side, cuts the target text to the path of the Windows Explorer corresponding to the drag release position, and notifies the Guest side to end the dragging.
814、若目的端为Windows资源管理器以外的其他Windows应用程序,则Host侧通过构建Windows侧拖拽事件,实现目标文本到Windows应用程序的传输,而后结束Windows侧拖拽事件。814. If the destination is a Windows application other than the Windows explorer, the Host implements the transfer of the target text to the Windows application by constructing a Windows-side drag event, and then ends the Windows-side drag event.
参见图8C,在步骤808、步骤810或步骤814之后,该方法还可以包括:Referring to FIG. 8C, after step 808, step 810 or step 814, the method may further include:
815、Host侧Windows应用程序根据目标对象和释放位置进行相应处理。815. The Windows application program on the host side performs corresponding processing according to the target object and the release location.
关于该步骤的说明可以参见上述步骤612中的相关描述。For the description of this step, refer to the relevant description in the above step 612 .
示例性的,基于图9中的(a)所示的用户将目标文件从Android文件管理窗口到Windows资源管理器窗口的拖拽操作,参见图9中的(b),Windows资源管理器窗口中添加了目标文件,即添加了图标b,实现了目标文件从Android文件管理到Windows资源管理器的复制。Exemplary, based on the user shown in (a) in Figure 9, the user drags and drops the target file from the Android file management window to the Windows Explorer window, see (b) in Figure 9, in the Windows Explorer window The target file is added, that is, the icon b is added, and the copying of the target file from the Android file management to the Windows Explorer is realized.
需要说明的是,在场景(2)中,以上多个实施例中的部分或全部步骤(例如图8C所示流程中的部分步骤),在不冲突的情况下,可以重新组合,从而构成新的实施例。本申请实施例对此不再具体说明。It should be noted that in scenario (2), some or all of the steps in the above multiple embodiments (such as some steps in the process shown in Figure 8C) can be recombined to form a new the embodiment. This embodiment of the present application will not specifically describe this.
可见,针对上述场景(2),本申请实施例通过Qemu Pipe通信可以实现Android模拟器Host侧与Guest侧之间进行通信交互,基于Windows侧窗口标识(比如句柄)与Android侧窗口标识(比如VirtualDisplay窗口的DisplayId)的一一对应关系,可以根据拖拽源位置所在的Windows侧窗口确定源端Android应用程序,并且通过Virtio-9p可以实现Android侧与Windows侧的文件共享,通过Qemu Pipe可以实现Android侧与Windows侧的文本共享,进而实现Windows应用程序与Android应用程序之间拖拽传输文件或文本。It can be seen that for the above-mentioned scenario (2), the embodiment of the present application can realize communication interaction between the Android emulator Host side and the Guest side through Qemu Pipe communication, based on the Windows side window identification (such as handle) and the Android side window identification (such as VirtualDisplay The one-to-one correspondence between the DisplayId of the window can determine the source Android application program according to the Windows side window where the drag source is located, and the file sharing between the Android side and the Windows side can be realized through Virtio-9p, and the Android side can be realized through Qemu Pipe. Text sharing between the Windows side and the Windows side, so as to realize the drag-and-drop transfer of files or texts between Windows applications and Android applications.
在图8A-图10描述的方案中,基于用户将目标对象从源端Android应用程序的窗口,拖拽至目的端Windows应用程序的窗口的简单的一步拖拽操作,即可实现Android应用程序到Windows应用程序的目标对象的传输,而不用像现有技术那样需要用户进行多步、复杂的操作。并且,用户通过鼠标等输入设备在窗口间的拖拽操作,更符合用户基于Windows操作系统和电脑的操作使用习惯,因而用户使用体验较好,能够增加产品的竞争力。而且,该方案不需要像现有技术那样依赖adb、socket通信和网络能力等因素,不会受到这些因素的限制,因而文件传输速度快且安全可靠。In the solution described in Fig. 8A-Fig. 10, based on the simple one-step drag operation of the user dragging the target object from the window of the source Android application to the window of the destination Windows application, the Android application can be implemented to The transmission of the target object of the Windows application program does not require the user to perform multi-step and complicated operations as in the prior art. Moreover, the user's dragging operation between windows through the mouse and other input devices is more in line with the user's operating habits based on the Windows operating system and computers, so the user experience is better and the competitiveness of the product can be increased. Moreover, the solution does not need to rely on factors such as adb, socket communication, and network capabilities like the prior art, and will not be limited by these factors, so the file transfer speed is fast and safe and reliable.
场景(3)、一步拖拽实现Android应用程序间的文件传输:Scenario (3), one-step drag and drop to realize file transfer between Android applications:
在该交互场景中,用户可以通过鼠标或触摸屏等输入设备,将Windows操作系统上运行的一个Android应用程序窗口中的目标对象,拖拽至另一个Android应用程序的窗口中。电脑响应于用户的拖拽操作,将Windows操作系统上一个Android应用程序中的目标对象传输到另一个Android应用程序中,实现Windows操作系统上不同Android应用程序间的目标对象的复制。In this interaction scenario, the user can drag and drop the target object in the window of an Android application program running on the Windows operating system to the window of another Android application program through an input device such as a mouse or a touch screen. In response to the user's drag operation, the computer transfers the target object in one Android application program on the Windows operating system to another Android application program, so as to realize the duplication of the target object between different Android application programs on the Windows operating system.
在该交互场景中,参见图11A,Host侧检测Android应用程序窗口是否发生拖拽文件操作。若Android应用程序窗口发生拖拽文件操作,则检测拖拽释放位置是否处于其他Android应用程序窗口。若拖拽释放位置处于其他Android应用程序窗口,则基于管道通信通知Guest侧拖拽释放的安卓侧窗口标识以及拖拽文件的文件名信息等,Guest侧通过拖拽的目标对象URI构建传输的数据,模拟源Android应用程序向目的 Android应用程序的拖拽传输目标对象。In this interaction scenario, referring to FIG. 11A , the Host side detects whether a file drag operation occurs in the Android application window. If a file dragging operation occurs in the Android application window, it is detected whether the dragging and dropping position is in another Android application window. If the drag-and-drop location is in another Android application window, the Guest side is notified based on the pipeline communication of the Android-side window ID and the file name information of the drag-and-drop file, etc., and the Guest side constructs the transmitted data through the URI of the drag-and-drop target object , simulating the drag-and-drop transfer of the target object from the source Android application to the destination Android application.
在另一些实施例中,在该交互场景下,参见图11B,本申请提供的传输目标对象的方法可以包括以下流程:拖拽源Android应用程序触发拖拽,Guest侧(即Android系统)基于管道通信Qemu Pipe向Host侧通知拖拽事件,包括通知拖拽位置对应的安卓侧窗口标识,目标对象类型,当目标对象为目标文件时的文件名信息(比如文件名拼接)、文件总大小和文件数量,以及目标对象为目标文本时的文本长度和文本内容等信息。Host侧构建Windows侧拖拽事件(如OLE Drag/Drop拖拽事件)。若拖拽在安卓应用程序的窗口内移动,则循环执行以下步骤直至目标对象移出安卓应用程序的窗口或者目标对象被拖拽释放:安卓模拟器的Host侧基于管道通信Qemu Pipe将拖入事件通知给Guest侧,包括通知拖拽位置坐标、拖拽位置进入的安卓侧窗口标识和目标对象类型等信息;Guest侧基于Qemu Pipe向Host侧回复是否允许拖入;Host侧根据Guest侧是否允许拖入的回复显示拖拽样式,比如禁止/允许拖拽标识。In some other embodiments, in this interaction scenario, referring to FIG. 11B , the method for transferring a target object provided by the present application may include the following process: the dragging source Android application triggers the dragging, and the Guest side (ie, the Android system) is based on the pipeline Communication Qemu Pipe notifies the host side of the drag event, including notification of the Android side window ID corresponding to the drag position, target object type, file name information (such as file name concatenation) when the target object is a target file, total file size and file size Quantity, and information such as text length and text content when the target object is the target text. The host side builds Windows side drag events (such as OLE Drag/Drop drag events). If the drag is moving in the window of the Android application, the following steps are executed in a loop until the target object moves out of the window of the Android application or the target object is dragged and released: The Host side of the Android emulator will notify the drag event based on the pipeline communication Qemu Pipe To the Guest side, including information such as the coordinates of the drag position, the Android side window ID and the target object type entered by the drag position; the Guest side replies to the Host side based on the Qemu Pipe whether to allow dragging; the Host side determines whether dragging is allowed based on the Guest side The reply shows the dragging style, such as the forbidden/allowed dragging logo.
而后,继续参见图11B,若拖拽释放的目的窗口为安卓应用程序窗口,则Host侧取消Windows侧的拖拽事件,通知Guest侧传输类型为Android应用程序间的传输,并将拖拽源/目的窗口对应的安卓侧窗口标识,拖拽释放位置坐标和目标对象类型等信息通知给Guest侧。具体的,Host侧可以获取拖拽释放全局坐标,并判断拖拽释放坐标是否位于Android应用程序窗口,以及通过窗口句柄获取拖拽释放Android应用程序虚拟显示(VirtualDisplay)窗口的DisplayId。然后,Host侧将转换后的Android应用程序内部坐标、Android应用程序Display窗口的DisplayId,目标对象类型以及传输类型通过Qemu Pipe通信传递给Guest侧。Guest侧构建空的拖拽开始事件。Guest侧根据目标文件的URI/文本内容构建拖拽事件,以将目标对象传输至指定的拖拽释放目的安卓应用窗口。Guest侧构建空的拖拽结束事件,以结束本次针对目标对象的拖拽传输。Then, continue referring to Fig. 11B, if the destination window for dragging and releasing is an Android application window, then the Host side cancels the dragging event on the Windows side, notifies the Guest side that the transmission type is the transmission between Android applications, and drags the source/ The Android side window ID corresponding to the target window, information such as drag and drop position coordinates and target object type are notified to the Guest side. Specifically, the Host side can obtain the global coordinates of the drag and drop, and determine whether the coordinates of the drag and drop are located in the Android application window, and obtain the DisplayId of the virtual display (VirtualDisplay) window of the Android application through the window handle. Then, the Host side transmits the converted Android application internal coordinates, the DisplayId of the Android application Display window, the target object type, and the transmission type to the Guest side through Qemu Pipe communication. Create an empty drag start event on the Guest side. The Guest side constructs a drag event according to the URI/text content of the target file, so as to transfer the target object to the specified Android application window for drag and drop. The guest side constructs an empty drag end event to end the drag transfer for the target object.
在其他一些实施例中,结合图11C所示的流程图及图12所示的界面示意图,对本申请提供的传输目标对象的方法进行详细说明:In some other embodiments, the method for transmitting the target object provided by this application is described in detail in combination with the flowchart shown in FIG. 11C and the schematic interface shown in FIG. 12 :
1100、Guest侧检测到Android应用程序1窗口中的目标对象被触发拖拽,拖拽源Android应用触发拖拽事件。1100. The Guest side detects that the target object in the Android application 1 window is dragged, and the drag source Android application triggers a drag event.
比如,Guest侧检测到触发拖拽对应的鼠标事件,该鼠标事件用于表示从Android应用程序1的窗口中开始拖拽目标对象。示例性的,如图12中的(a)所示,用户通过触摸屏选中Android应用程序1(如Android文件管理)的窗口1201中的目标对象,并通过手指触摸拖拽该目标对象,此时Guest侧检测到触发拖拽对应的鼠标事件。For example, the Guest side detects that a mouse event corresponding to the dragging is triggered, and the mouse event is used to indicate that the target object is started to be dragged from the window of the Android application program 1 . Exemplarily, as shown in (a) in Figure 12, the user selects the target object in the window 1201 of the Android application program 1 (such as Android file management) through the touch screen, and touches and drags the target object by finger touch, at this time Guest The side detects the mouse event corresponding to the trigger drag.
1101、Guest侧将拖拽信息5通知给Host侧,该拖拽信息5包括拖拽源窗口对应的Android侧窗口标识和目标对象类型。1101. The Guest side notifies the Host side of the dragging information 5, where the dragging information 5 includes the Android side window identifier and the target object type corresponding to the dragging source window.
拖拽源Android应用触发拖拽事件后,Guest侧可以将该拖拽事件通知给Host侧。Guest侧可以将拖拽信息5通知给Host侧。例如,该拖拽信息5可以包括拖拽源窗口对应的Android侧窗口标识和目标对象类型,以便Host侧获知拖拽源端和待传输的目标对象的具体类型。其中,该目标对象类型可以为文件或文本等。此外,该拖拽信息5还可以包括拖拽相关的其他信息,比如目标对象为目标文件时还包括目标文件的文件名信息(如文件名拼接信息)和文件总大小等,目标对象为目标文本时还包括文本 内容等信息,本申请实施例对拖拽信息5的具体内容不予限定。After the drag source Android application triggers the drag event, the Guest side can notify the Host side of the drag event. The Guest side can notify the Host side of the drag information 5 . For example, the dragging information 5 may include the Android side window ID and target object type corresponding to the dragging source window, so that the Host side can know the specific type of the dragging source and the target object to be transmitted. Wherein, the target object type may be a file or a text. In addition, the dragging information 5 can also include other information related to dragging, such as when the target object is a target file, it also includes file name information (such as file name splicing information) and total file size of the target file, and the target object is the target text. It also includes information such as text content, and the embodiment of the present application does not limit the specific content of the drag information 5 .
若目标对象为目标文本,则执行步骤1104;如果目标对象为目标文件,则在步骤1104之前还执行步骤1102-1103。If the target object is the target text, execute step 1104; if the target object is the target file, execute steps 1102-1103 before step 1104.
1102、若目标对象为目标文件,则Guest侧将目标对象的文件名信息和拖拽图标通知给Host侧。1102. If the target object is a target file, the Guest side notifies the Host side of the file name information and the drag icon of the target object.
其中,若拖拽信息5中包括文件名信息,则步骤1102中也可以不包括文件名信息。Wherein, if the dragging information 5 includes the file name information, the file name information may not be included in step 1102 .
1103、Host侧根据文件名信息构建Windows侧的拖拽事件,并设置拖拽图标。1103. The host side constructs a drag event on the Windows side according to the file name information, and sets a drag icon.
关于步骤1102-1103的描述可以参见上述步骤802-803中的说明,不予赘述。其中,Host侧设置拖拽图标为可选操作。For descriptions of steps 1102-1103, reference may be made to the descriptions of steps 802-803 above, and details are not repeated here. Among them, setting the drag icon on the Host side is an optional operation.
如果目标对象的拖拽位置在Android应用程序源窗口中移动,则显示禁止拖拽符号。如果拖拽在源窗口中释放,则结束本次拖拽事件。如果拖拽在Windows应用程序的窗口中释放,则执行图8C所示的步骤804及其后续步骤。如果目标对象的拖拽位置在Android应用程序非源窗口中移动,则Host侧向Guest侧通知通入事件,包括拖拽位置坐标、拖拽位置所在Android侧窗口标识和目标类型等信息。Guest侧向Host侧回复当前拖拽进入的窗口和拖拽位置是否允许拖入。Host侧根据该回复显示允许/禁止拖拽标识。如果拖拽在Android应用程序非源窗口中释放,则执行图11C所示的后续步骤。If the drag position of the target object is moved in the source window of the Android application, a no-drag symbol is displayed. If the dragging is released in the source window, the dragging event ends. If the dragging is released in the window of the Windows application, step 804 and subsequent steps shown in FIG. 8C are executed. If the dragging position of the target object moves in the non-source window of the Android application, the Host side notifies the Guest side of the access event, including information such as the coordinates of the dragging position, the ID of the Android side window where the dragging position is located, and the target type. The Guest side replies to the Host side whether the current dragged-in window and the dragged position are allowed to be dragged in. The Host side displays a drag-and-drop permission/prohibition mark according to the reply. If the drag is released in the Android application non-source window, the subsequent steps shown in FIG. 11C are performed.
1104、在Host侧检测到拖拽的目标对象被释放后,若Host侧根据释放位置坐标确定拖拽释放窗口为Android应用程序2的窗口,则取消Windows侧拖拽事件,并基于Qemu Pipe将拖拽信息6通知给Guest侧,该拖拽信息6包括拖拽源窗口对应的Android侧窗口标识、拖拽释放窗口对应的Android侧窗口标识、释放位置坐标、目标对象类型和传输类型。1104. After the host side detects that the dragged target object is released, if the host side determines that the dragged release window is the window of the Android application 2 according to the coordinates of the release position, cancel the drag event on the Windows side, and transfer the dragged event based on the Qemu Pipe The drag information 6 is notified to the Guest side, the drag information 6 includes the Android side window ID corresponding to the drag source window, the Android side window ID corresponding to the drag release window, release position coordinates, target object type and transmission type.
比如,Host侧检测到释放对应的鼠标事件,该鼠标事件用于表示拖拽的目标对象被释放。示例性的,参见图12中的(a),用户通过鼠标在Android应用程序2(如Android社交应用)的窗口1202内释放拖拽的目标文件,此时Host侧检测到释放对应的鼠标事件。For example, the host side detects a mouse event corresponding to the release, and the mouse event is used to indicate that the dragged target object is released. Exemplarily, referring to (a) in FIG. 12 , the user releases the dragged target file in the window 1202 of the Android application program 2 (such as the Android social application) through the mouse, and at this time, the Host side detects a mouse event corresponding to the release.
其中,Host侧根据释放位置的坐标确定拖拽释放窗口为Android应用程序2的窗口,并根据拖拽源窗口和拖拽释放窗口确定传输类型为Android应用程序之间的传输。Host侧将传输类型通知给Guest侧,以便Guest侧根据传输类型进行相应的传输处理。Wherein, the Host side determines that the drag and drop window is the window of the Android application 2 according to the coordinates of the release position, and determines that the transfer type is the transfer between Android applications according to the drag source window and the drag and drop window. The Host side notifies the Guest side of the transmission type, so that the Guest side performs corresponding transmission processing according to the transmission type.
Host侧将拖拽释放窗口对应的Android侧窗口标识、释放位置坐标、目标对象类型通知给Guest侧,以便Guest侧确定拖拽释放窗口对应的Android侧窗口及释放位置是否允许拖入目标文件。The Host side notifies the Guest side of the Android side window identification, release position coordinates, and target object type corresponding to the dragging release window, so that the Guest side determines whether the Android side window corresponding to the dragging release window and the release position allow dragging of the target file.
此外,如果目标对象为目标文件,则拖拽信息6还可以包括目标文件的总大小和目标文件包括的文件数量等信息。如果目标对象为目标文本,则拖拽信息6还可以包括目标文本的长度等信息。或者,Guest侧也可以在触发拖拽事件后,将这些信息通知给Host侧。In addition, if the target object is a target file, the drag information 6 may also include information such as the total size of the target file and the number of files included in the target file. If the target object is the target text, the dragging information 6 may also include information such as the length of the target text. Alternatively, the Guest side may also notify the Host side of the information after the drag event is triggered.
1105、Guest侧判断拖拽释放窗口及释放位置是否允许拖入目标对象,并基于Qemu Pipe将判断结果通知给Host侧。1105. The Guest side judges whether the drag-and-drop release window and the release position allow the target object to be dragged in, and notifies the Host side of the judgment result based on the Qemu Pipe.
若目标对象为目标文件,则执行步骤1106-1107;若目标对象为目标文本,则执行 步骤1108-1111。If the target object is a target file, then execute steps 1106-1107; if the target object is a target text, then execute steps 1108-1111.
1106、若Host侧根据来自Guest侧的判断结果确定允许拖入,则基于Qemu Pipe将目标文件的文件名信息通知给Guest侧。1106. If the Host side determines that the drag-in is allowed according to the judgment result from the Guest side, then notify the Guest side of the file name information of the target file based on the Qemu Pipe.
可选地,Host侧还可以根据来自Guest侧的判断结果,显示允许/禁止拖拽标识。Optionally, the Host side may also display a dragging permission/prohibition mark according to the judgment result from the Guest side.
可选地,在步骤1106中,与上述步骤608中类似,Host侧还可以将时间戳信息通知给Guest侧。Optionally, in step 1106, similar to the above step 608, the Host side may also notify the Guest side of the time stamp information.
1107、Guest侧首先构建空的拖拽开始事件,而后根据文件名信息获取目标文件,并根据目标文件构建Android侧拖拽事件,实现目标文件到Android应用程序2的传输,并构建空的拖拽结束事件。1107. The Guest side first constructs an empty drag start event, then obtains the target file according to the file name information, and constructs an Android side drag event according to the target file, realizes the transmission of the target file to the Android application 2, and constructs an empty drag event End event.
其中,Guest侧根据文件名信息获取目标文件后,可以将目标文件文件添加至媒体库,获取目标文件对应的URI。而后,Guest侧可以通过URI去媒体库中快速读取该目标文件,根据目标文件构建Android侧拖拽事件。Wherein, after obtaining the target file according to the file name information, the Guest side may add the target file to the media library, and obtain the URI corresponding to the target file. Then, the Guest side can go to the media library to quickly read the target file through the URI, and build the drag event on the Android side according to the target file.
或者,Guest侧与Host侧之间也可以不传递文件名信息,而传递目标文件的URI,从而根据URI获取目标文件,并根据目标文件构建Android侧拖拽事件。Alternatively, the URI of the target file may be passed instead of the file name information between the Guest side and the Host side, so as to obtain the target file according to the URI, and construct an Android-side drag event according to the target file.
在一些实施例中,在目标文件的传输过程中,电脑还可以显示传输进度条。In some embodiments, during the transfer of the target file, the computer can also display a transfer progress bar.
在上述实施例中,Guest侧和Host侧通过传递目标文件的文件名信息来通知拖拽的目标文件。在其他一些实施例中,Guest侧和Host侧之间也可以不用传递目标文件的文件名信息,在Android应用程序1触发拖拽后,Guest侧可以保存拖拽的目标文件的标识信息;在拖拽释放到Android应用程序2的窗口后,Guest侧可以根据保存的目标文件的标识信息,获取目标文件,从而根据目标文件构建Android侧拖拽事件。也就是说,在该场景中,Host侧可以通知Guest侧拖拽释放窗口为Android应用程序窗口。至于目标文件的文件名或路径信息,可以Guset侧触发拖拽的时候存储,也可以由Host侧中转,将Guest侧通知的文件名等拖拽信息在释放时再次传给Android应用程序。In the above embodiments, the Guest side and the Host side notify the dragged target file by passing the file name information of the target file. In some other embodiments, the file name information of the target file may not be transferred between the Guest side and the Host side. After the Android application 1 triggers the drag, the Guest side can save the identification information of the dragged target file; After dragging and releasing to the window of the Android application 2, the Guest side can acquire the target file according to the saved identification information of the target file, so as to construct the Android side drag event according to the target file. That is to say, in this scenario, the Host side can notify the Guest side to drag and drop the window to be an Android application window. As for the file name or path information of the target file, it can be stored when the drag is triggered on the Guset side, or it can be transferred by the Host side, and the drag information such as the file name notified by the Guest side is sent to the Android application again when it is released.
如果目标对象为目标文本,则在Guest侧触发拖拽事件后,该方法还可以包括:If the target object is the target text, after the drag event is triggered on the Guest side, this method can also include:
1108、Guest侧触发拖拽事件后,若目标对象为目标文本,则将目标文本通知给Host侧。1108. After the drag event is triggered on the Guest side, if the target object is the target text, the Host side is notified of the target text.
1109、Host侧根据目标文本构建Windows侧拖拽事件。1109. The Host side constructs a Windows side drag event according to the target text.
1110、在Host侧检测到拖拽的目标对象被释放后,目标对象为目标文本,Host侧将目标文本通知给Guest侧。1110. After the host side detects that the dragged target object is released, the target object is the target text, and the host side notifies the guest side of the target text.
在步骤1104之后,该方法还可以包括:After step 1104, the method may also include:
1111、若Guest侧判断拖拽释放窗口及释放位置允许拖入目标对象,目标对象为目标文本,则首先构建空的拖拽开始事件,而后根据目标文本构建Android侧拖拽事件,实现目标文本到Android应用程序2的传输,并构建空的拖拽结束事件。1111. If the Guest side judges that the drag-and-drop release window and the release position allow to drag in the target object, and the target object is the target text, then firstly construct an empty drag-and-drop start event, and then construct an Android-side drag-and-drop event according to the target text to realize the target text to Transfer of Android application 2, and build an empty drag end event.
在上述实施例中,Guest侧和Host侧通过传递目标文本的文件内容来通知拖拽的目标文件。在其他一些实施例中,Guest侧和Host侧之间也可以不用传递目标文本的文本内容,在Android应用程序1触发拖拽后,Guest侧可以保存拖拽的目标文本;在拖拽释放到Android应用程序2的窗口后,Guest侧可以根据保存的目标文本构建Android侧拖拽事件。In the above embodiments, the Guest side and the Host side notify the dragged target file by passing the file content of the target text. In some other embodiments, the text content of the target text may not be transferred between the Guest side and the Host side. After the Android application 1 triggers dragging, the Guest side can save the dragging target text; After the application 2 window, the Guest side can construct the Android side drag event according to the saved target text.
参见图11C,在步骤1107或步骤1111之后,该方法还可以包括:Referring to FIG. 11C, after step 1107 or step 1111, the method may further include:
1112、Guest侧Android应用程序2根据目标对象和释放位置进行处理。1112. The Android application program 2 on the Guest side performs processing according to the target object and release location.
关于该步骤的说明可以参见上述步骤612中的相关描述,不予赘述。For the description of this step, reference may be made to the relevant description in the above step 612, and details are not repeated here.
示例性的,目标对象为目标文件,基于图12中的(a)所示的用户将目标文件(即图片b)从Android应用程序1(如Android文件管理)的窗口1201到Android应用程序2(如Android社交应用)的窗口1202中信息编辑窗口的拖拽操作,参见图12中的(b),Android应用程序2的窗口中添加了目标文件,且目标文件发送给了聊天界面对应的联系人,实现了目标文件从Android应用程序1到Android应用程序2的复制。Exemplary, the target object is the target file, based on the user shown in (a) in Figure 12 the target file (ie picture b) from the window 1201 of the Android application program 1 (such as Android file management) to the Android application program 2 ( Such as the drag operation of the information editing window in the window 1202 of the Android social application), see (b) in Figure 12, the target file is added in the window of the Android application program 2, and the target file is sent to the corresponding contact person in the chat interface , realizing the copying of target files from Android application 1 to Android application 2.
需要说明的是,不限于图12举例所采用的应用程序,当Android应用程序为其他应用程序时,仍可以采用以上实施例提供的方法,实现Android应用程序间传输目标对象,此处不再一一举例。It should be noted that it is not limited to the application program used in the example shown in Figure 12. When the Android application program is another application program, the method provided in the above embodiments can still be used to realize the transfer of target objects between Android application programs, which will not be repeated here. An example.
还需要说明的是,在场景(3)中,以上多个实施例中的部分或全部步骤(例如图11C所示流程中的部分步骤),在不冲突的情况下,可以重新组合,从而构成新的实施例。本申请实施例对此不再具体说明。It should also be noted that in scenario (3), some or all of the steps in the above multiple embodiments (such as some steps in the process shown in Figure 11C) can be recombined in the absence of conflicts to form new embodiment. This embodiment of the present application will not specifically describe this.
可见,针对上述场景(3),本申请实施例通过Qemu Pipe通信可以实现Android模拟器Host侧与Guest侧之间进行通信交互,通过确定拖拽源窗口与目的窗口均为Android应用程序窗口,模拟在Android操作系统内部进行拖拽传输,实现Windows操作系统上不同Android应用程序之间拖拽传输目标对象。It can be seen that for the above scenario (3), the embodiment of the present application can realize the communication interaction between the Android emulator Host side and the Guest side through Qemu Pipe communication, by determining that the dragging source window and the destination window are both Android application windows, the simulated Drag-and-drop transfer is performed inside the Android operating system to realize drag-and-drop transfer target objects between different Android applications on the Windows operating system.
在图11A-图12描述的方案中,基于用户将目标对象从源端Android应用程序的窗口,拖拽至目的端Android应用程序的窗口的简单的一步拖拽操作,即可实现Windows操作系统上不同Android应用程序之间的目标对象的传输,而不需要用户进行多步、复杂的操作。并且,用户通过鼠标等输入设备在窗口间的拖拽操作,更符合用户基于Windows操作系统和电脑的操作使用习惯,因而用户使用体验较好,能够增加产品的竞争力。而且,该方案不需要通过共享文件夹或Windows侧来中转目标文件,因而传输速度快。此外,该方案不需要依赖adb、socket通信和网络能力等因素,不会受到这些因素的限制,文件传输速度快且安全可靠。In the scheme described in Figure 11A-Figure 12, based on the simple one-step drag operation of the user dragging the target object from the window of the source Android application program to the window of the target Android application program, the Windows operating system can implement The transfer of target objects between different Android applications does not require the user to perform multi-step and complicated operations. Moreover, the user's dragging operation between windows through the mouse and other input devices is more in line with the user's operating habits based on the Windows operating system and computers, so the user experience is better and the competitiveness of the product can be increased. Moreover, this solution does not need to transfer the target file through the shared folder or the Windows side, so the transfer speed is fast. In addition, this solution does not need to rely on factors such as adb, socket communication, and network capabilities, and will not be limited by these factors. The file transfer speed is fast, safe and reliable.
需要说明的是,场景(1)-(3)描述的方案为基于用户的一步拖拽操作来复制目标对象。在其他一些实施例中,电脑可以基于用户的一步拖拽操作来剪切目标对象(例如目标文件或目标文本等),即将目标对象从源端应用程序传输到目的端应用程序,并删除源端应用程序中的该目标文件。比如,基于用户针对目标对象从Windows应用程序到Android应用程序的一步拖拽操作,可以将Windows应用程序中的目标对象剪切至Android应用程序;基于用户针对目标对象从Android应用程序到Windows应用程序的一步拖拽操作,可以将Android应用程序中的目标对象剪切至Windows应用程序;基于用户针对目标对象从Android应用程序1到Android应用程序2的一步拖拽操作,可以将Android应用程序1中的目标对象剪切至Android应用程序2。It should be noted that the solutions described in scenarios (1)-(3) are to copy the target object based on the user's one-step drag operation. In some other embodiments, the computer can cut the target object (such as the target file or target text) based on the user's one-step drag operation, that is, transfer the target object from the source application to the destination application, and delete the source object. This object file in the application. For example, based on the user's one-step drag operation from the Windows application to the Android application for the target object, the target object in the Windows application can be cut to the Android application; based on the user's target object from the Android application to the Windows application One-step drag operation, the target object in the Android application can be cut to the Windows application; based on the user's one-step drag operation from the Android application 1 to the Android application 2, the Android application 1 can be The target object clipped to the Android application 2.
在本申请的一些实施例中,在上述场景(1)-(3)中,可传输的目标对象也可以为文件夹,且文件夹的传输方式与文件的传输方式相同。也可以理解为,目标对象类型中的文件包括文件夹。In some embodiments of the present application, in the above scenarios (1)-(3), the transferable target object may also be a folder, and the transfer method of the folder is the same as that of the file. It can also be understood that the files in the target object type include folders.
在本申请的另一些实施例中,在上述场景(1)-(3)中,可传输的目标对象不能 为文件夹,若拖拽的目标对象为文件夹,则Host侧直接通知源窗口不允许拖拽,拖拽文件夹在Android应用程序窗口释放时,Host侧可以提示用户(例如通过弹窗等方式来提示用户)不允许拖拽文件夹;从Android侧窗口中拖拽文件夹时,Guest侧也不会将拖拽信息通知给Host侧。In other embodiments of the present application, in the above-mentioned scenarios (1)-(3), the transferable target object cannot be a folder, if the dragged target object is a folder, then the Host side directly notifies the source window not to Allow drag and drop, when the drag and drop folder is released in the Android application window, the Host side can prompt the user (for example, prompting the user through a pop-up window) that the drag and drop folder is not allowed; when dragging and dropping the folder from the Android side window, The Guest side will not notify the Host side of the drag information.
场景(4)、复制和粘贴操作实现Windows应用程序到Android应用程序的文件传输:Scenario (4), copy and paste operations to achieve file transfer from Windows applications to Android applications:
在该交互场景中,用户可以通过鼠标、触摸屏或键盘快捷键,基于Windows应用程序窗口中的目标对象执行复制操作(例如点击鼠标右键后选择复制选项,或者按下键盘上的Ctrl+C快捷键等),并在Android应用程序的窗口中执行粘贴操作(例如点击粘贴选项,按下键盘上的Ctrl+V快捷键,或者点击鼠标右键后选择粘贴选项等)。电脑根据用户的复制和粘贴操作,将Windows应用程序中的目标文件复制到Android应用程序,实现Windows应用程序到Android应用程序的文件传输。In this interactive scenario, the user can perform a copy operation based on the target object in the Windows application window through the mouse, touch screen or keyboard shortcuts (for example, click the right mouse button and select the copy option, or press the Ctrl+C shortcut key on the keyboard etc.), and perform the paste operation in the window of the Android application (for example, click the paste option, press the Ctrl+V shortcut key on the keyboard, or select the paste option after clicking the right mouse button, etc.). The computer copies the target file in the Windows application program to the Android application program according to the user's copy and paste operation, so as to realize the file transfer from the Windows application program to the Android application program.
针对该场景(4),参见图13A,本申请实施例提供了一种文件传输方法,包括:首先,Android模拟器Host侧执行复制文件操作,将复制文件路径放共享剪贴板。通过Windows IsClipboardFormatAvailable(),可以区分共享剪贴板中的数据类型是文本、文件或其他。其次,当Android模拟器Guest侧(即Android系统)应用程序中进行粘贴文件操作时,对粘贴目的路径,粘贴文件等进行文件权限、容量等权限检查。检查通过之后,Guest侧通过Host侧发起文件复制操作。Host侧收到文件复制操作请求后,检查源文件是否存在。检查通过之后,显示复制进度条;同时开始将源文件复制到共享文件夹中(在模拟器启动时mount的目录);复制完成之后,Host侧通知Guest侧复制完成。Guest侧收到文件复制完成消息后,再将文件从共享文件夹复制到Android目的目录中,然后将共享文件夹中的文件删除;最后通知Host侧文件复制成功(若未复制成功则回复复制失败)。在Host侧收到文件复制成功消息后,复制进度条显示完成。For this scenario (4), referring to FIG. 13A , an embodiment of the present application provides a file transfer method, including: first, the Android emulator Host side executes a file copy operation, and puts the copied file path on the shared clipboard. Through Windows IsClipboardFormatAvailable(), you can distinguish whether the data type in the shared clipboard is text, file or others. Secondly, when the paste file operation is performed in the application program on the Guest side of the Android emulator (that is, the Android system), the file permission, capacity, and other permission checks are performed on the paste destination path, the paste file, and the like. After the check is passed, the Guest side initiates a file copy operation through the Host side. After the host side receives the file copy operation request, it checks whether the source file exists. After the check is passed, the copy progress bar is displayed; at the same time, the source file starts to be copied to the shared folder (the directory that is mounted when the emulator starts); after the copy is completed, the Host side notifies the Guest side that the copy is complete. After receiving the message that the file copy is complete, the Guest side copies the file from the shared folder to the Android destination directory, then deletes the file in the shared folder; finally notifies the Host side that the file copy is successful (if the copy is not successful, it will reply that the copy failed ). After the host side receives the file copy success message, the copy progress bar shows that the copy is complete.
在其他一些实施例中,结合图13B所示的流程图及图14-图16所示的界面示意图,对本申请提供的跨系统传输目标对象的方法进行详细说明:In some other embodiments, in combination with the flow chart shown in FIG. 13B and the interface schematic diagrams shown in FIGS. 14-16 , the method for transferring target objects across systems provided by this application is described in detail:
1300、Host侧检测到Windows应用程序的窗口中针对目标对象的复制操作。1300. The Host side detects a copy operation on a target object in a window of a Windows application program.
示例性的,参见图14中的(a),目标对象为Windows资源管理器的窗口1401中的文档1和文档2,用户针对目标文件按下键盘上的Ctrl+C快捷键,以指示复制该目标对象,此时Host侧检测到针对目标对象的复制操作。Exemplarily, referring to (a) in FIG. 14 , the target objects are document 1 and document 2 in the window 1401 of the Windows Explorer, and the user presses the shortcut key Ctrl+C on the keyboard for the target file to instruct to copy the The target object. At this time, the host side detects a copy operation on the target object.
若目标对象为目标文件,则执行步骤1301-1311;若目标对象为目标文本,则执行步骤1312-1317。If the target object is a target file, execute steps 1301-1311; if the target object is target text, execute steps 1312-1317.
1301、若目标对象为目标文件,则Host侧响应于用户的复制操作,将目标文件的路径信息存放到Host侧剪贴板中。1301. If the target object is a target file, the Host side stores the path information of the target file in the clipboard of the Host side in response to the user's copy operation.
1302、Host侧监控Host侧剪贴板的变化,将Host侧剪贴板中目标文件的路径信息存放到共享剪贴板中。1302. The Host side monitors the changes of the Host side clipboard, and stores the path information of the target file in the Host side clipboard into the shared clipboard.
其中,Host侧可以基于Qemu Pipe,将Host侧剪贴板中目标文件的路径信息存放到共享剪贴板中。Among them, the host side can store the path information of the target file in the host side clipboard into the shared clipboard based on Qemu Pipe.
1303、Guest侧检测到Android应用程序的窗口中的粘贴操作,该粘贴操作用于指 示在该窗口中粘贴目标文件。1303. The Guest side detects a paste operation in the window of the Android application, and the paste operation is used to instruct to paste the target file in the window.
示例性的,参见图14中的(b),用户在Android文件管理的窗口1402中按下键盘上的快捷键Ctrl+V执行粘贴操作(或者,用户也可以点击粘贴选项1403的粘贴操作),此时Guest侧检测到该粘贴操作。Exemplarily, referring to (b) in FIG. 14, the user presses the shortcut key Ctrl+V on the keyboard in the Android file management window 1402 to execute the paste operation (or, the user can also click the paste operation of the paste option 1403), At this time, the Paste operation is detected on the Guest side.
电脑检测到用户执行的粘贴操作后,通过以下步骤将共享剪贴板中的路径信息对应的目标文件,粘贴至目的端Android文件管理窗口。After the computer detects the paste operation performed by the user, the target file corresponding to the path information in the shared clipboard is pasted to the target Android file management window through the following steps.
1304、Guest侧对Android应用程序对应的待粘贴目的路径,以及共享剪贴板中的路径信息对应的目标文件进行预检查,并在预检查通过后,基于Qemu Pipe向Host侧发起目标文件复制请求。1304. The Guest side performs a pre-check on the target path to be pasted corresponding to the Android application and the target file corresponding to the path information in the shared clipboard, and after passing the pre-check, initiates a target file copy request to the Host side based on the Qemu Pipe.
例如,该预检查包括检查待粘贴目的路径是否存在、是否合法,对目标文件进行权限和容量检查等。其中,该预检查操作可以为可选操作。For example, the pre-check includes checking whether the destination path to be pasted exists and is legal, checking the authority and capacity of the target file, and the like. Wherein, the pre-check operation may be an optional operation.
1305、Host侧接收到复制请求后,确定源目标文件是否存在。1305. After receiving the copy request, the Host side determines whether the source target file exists.
1306、若Host侧确定源目标文件存在,则将共享剪贴板中的路径信息对应的目标文件拷贝到9p共享文件夹,在拷贝完成后基于Qemu Pipe通知Guest侧。1306. If the Host side determines that the source target file exists, then copy the target file corresponding to the path information in the shared clipboard to the 9p shared folder, and notify the Guest side based on the Qemu Pipe after the copy is completed.
其中,当目标文件包括多个文件时,Host侧可以每拷贝完目标文件中的一个文件后,就通知Guest侧;也可以在目标文件的全部文件都拷贝完后再通知Guest侧。Wherein, when the target file includes multiple files, the Host side can notify the Guest side after every file in the target file has been copied; it can also notify the Guest side after all the files of the target file have been copied.
1307、Guest侧接收到拷贝完成通知后,将目标文件从9p共享文件夹复制到Android应用程序。1307. After receiving the copy completion notification, the Guest side copies the target file from the 9p shared folder to the Android application program.
1308、Guest侧的Android应用程序根据粘贴位置进行相应处理。1308. The Android application program on the Guest side performs corresponding processing according to the paste position.
关于该步骤的说明可以参见上述步骤612中的相关描述。示例性的,基于图14中的(a)-(b)所示的复制和粘贴操作,参见图14中的(c),Android文件管理窗口中添加了目标文件,实现了目标文件从Windows资源管理器到Android文件管理的复制。For the description of this step, refer to the relevant description in the above step 612 . Exemplary, based on the copy and paste operations shown in (a)-(b) in Figure 14, see (c) in Figure 14, the target file is added in the Android file management window, and the target file is obtained from the Windows resource Clone Manager to Android File Manager.
1309、Guest侧将共享文件夹中的目标文件删除,并基于Qemu Pipe通知Host侧传输完成。1309. The Guest side deletes the target file in the shared folder, and notifies the Host side that the transfer is complete based on the Qemu Pipe.
后续,响应于用户在其他Android应用程序的窗口中的粘贴操作,可以重新执行步骤1303-1309,从而将目标文件复制到其他Android应用程序的窗口中,实现多次粘贴。Subsequently, in response to the user's pasting operation in the windows of other Android applications, steps 1303-1309 may be re-executed, so as to copy the target file to the windows of other Android applications to realize multiple pasting.
在上述过程中,用户执行的是复制和粘贴操作,在其他一些实施例中,如果用户通过鼠标或键盘的快捷键等方式,基于Windows应用程序窗口中的目标文件执行剪切操作,则在上述步骤1309之后,该方法还包括:In the above process, what the user performs is a copy and paste operation. In some other embodiments, if the user performs a cut operation based on the target file in the Windows application window through the mouse or keyboard shortcut keys, etc., then in the above After step 1309, the method also includes:
1310、Host侧接收到传输完成通知后,删除Windows应用程序中的目标文件,删除Host剪贴板中目标文件的路径信息。1310. After receiving the transmission completion notification, the Host side deletes the target file in the Windows application program, and deletes the path information of the target file in the Host clipboard.
1311、Host侧同步Host剪贴板的变化,删除共享剪贴板中存放的目标文件的路径信息。1311. The Host side synchronizes the changes of the Host clipboard, and deletes the path information of the target file stored in the shared clipboard.
示例性的,目标对象为目标文件,针对图15中的(a)-(b)所示的用户基于Windows资源管理器窗口1501中的目标文件,按下快捷键Ctrl+X的剪切操作,以及用户基于Android文件管理窗口1502按下快捷键Ctrl+V的粘贴操作(或者用户点击粘贴选项1503的粘贴操作),参见图15中的(c),Android文件管理窗口中添加了目标文件, Windows资源管理器中删除了目标文件,实现了从Windows资源管理器剪切目标文件并粘贴到Android文件管理的过程。Exemplarily, the target object is a target file, and for the user shown in (a)-(b) in FIG. And the user presses the paste operation of the shortcut key Ctrl+V based on the Android file management window 1502 (or the user clicks the paste operation of the paste option 1503), referring to (c) in Figure 15, the target file is added in the Android file management window, Windows The target file is deleted in the explorer, and the process of cutting the target file from the Windows explorer and pasting it to the Android file management is realized.
在一些实施例中,Host侧还可以在目标文件的复制/剪切过程中显示传输进度条。例如,该传输进度条为复制进度条,Host侧在确定源文件存在后,可以显示复制进度条;在接收到来自Guest侧的文件复制完成通知后,复制进度条显示完成。In some embodiments, the Host side can also display a transfer progress bar during the copy/cut process of the target file. For example, the transfer progress bar is a copy progress bar, and the Host side can display the copy progress bar after determining that the source file exists; after receiving the file copy completion notification from the Guest side, the copy progress bar displays completion.
在步骤1300之后,若目标对象为目标文本,则执行以下步骤:After step 1300, if the target object is the target text, then perform the following steps:
1312、若目标对象为目标文本,则Host侧响应于用户的复制操作,将目标文本存放到Host剪贴板中。1312. If the target object is the target text, the Host side stores the target text in the Host clipboard in response to the user's copy operation.
1313、Host侧监控Host侧剪贴板的变化,将Host侧剪贴板中目标文本存放到共享剪贴板中。1313. The Host side monitors the changes of the Host side clipboard, and stores the target text in the Host side clipboard into the shared clipboard.
1314、Guest侧检测到Android应用程序的窗口中的粘贴操作,该粘贴操作用于指示在该窗口中粘贴目标文本。1314. The Guest side detects a paste operation in the window of the Android application program, and the paste operation is used to instruct to paste the target text in the window.
1315、Guest侧对Android应用程序对应的待粘贴目的路径,以及共享剪贴板中目标文本进行预检查。1315. The Guest side pre-checks the target path to be pasted corresponding to the Android application program and the target text in the shared clipboard.
其中,该步骤1315为可选的步骤。Wherein, this step 1315 is an optional step.
1316、Guest侧在预检查通过后,将共享剪贴板中的目标文本复制到Android应用程序。1316. After the pre-check is passed, the Guest side copies the target text in the shared clipboard to the Android application program.
1317、Guest侧的Android应用程序根据粘贴位置进行相应处理。1317. The Android application program on the Guest side performs corresponding processing according to the paste position.
例如,Android应用程序根据具体的粘贴位置,将目标文本插入到粘贴位置,或者将目标文本发送给联系人。For example, the Android application program inserts the target text into the pasting position according to the specific pasting position, or sends the target text to the contact.
示例性的,目标对象为目标文本,针对图16中的(a)-(b)所示的用户基于Windows应用程序(如Windows应用程序1)窗口1601中的目标文本按下快捷键Ctrl+C的复制操作,以及用户基于Android应用程序(如Android社交应用)窗口1602按下快捷键Ctrl+C的粘贴操作,参见图16中的(c),Android应用程序中添加了目标文本,且目标文本发送给了对应的联系人,实现了目标文本从Android文件管理到Android社交应用的复制。Exemplarily, the target object is the target text, and the user shown in (a)-(b) in FIG. 16 presses the shortcut key Ctrl+C based on the target text in the Windows application (such as Windows application 1) window copy operation, and the user presses the shortcut key Ctrl+C paste operation based on the Android application program (such as Android social application) window 1602, referring to (c) in Figure 16, the target text is added in the Android application program, and the target text It is sent to the corresponding contact, and the target text is copied from the Android file management to the Android social application.
如果用户执行的是剪切和粘贴操作,则在上述步骤1317之后,该方法还包括:If the user performs cut and paste operations, after the above step 1317, the method further includes:
1318、Host侧删除Windows应用程序中的目标文本。1318. The host side deletes the target text in the Windows application program.
本申请实施例通过Qemu Pipe通信实现Android模拟器Host侧与Guest侧进行通信交互,通过如图4所示的共享剪贴板复制文件路径,通过Virtio-9p实现Host侧与Guest侧的文件共享,或者通过共享剪贴板实现Host侧与Guest侧的文本共享,从而实现在Windows应用程序与Android应用程序之间复制/剪切文件或文本。The embodiment of the present application realizes the communication interaction between the Host side and the Guest side of the Android emulator through Qemu Pipe communication, copies the file path through the shared clipboard as shown in Figure 4, and realizes the file sharing between the Host side and the Guest side through Virtio-9p, or The text sharing between the Host side and the Guest side is realized by sharing the clipboard, so as to realize copying/cutting files or texts between Windows applications and Android applications.
该方案在9P共享文件系统的基础上,实现了Windows与Android模拟器侧共享剪贴板的相关操作。在用户体验上实现了Windows侧与Android侧剪贴板的功能,与Windows与Android剪贴板的使用方式保持一致,符合用户的操作使用习惯。Based on the 9P shared file system, this solution realizes the related operations of sharing the clipboard on the side of the Windows and Android emulators. In terms of user experience, the function of the clipboard on the Windows side and the Android side is realized, which is consistent with the use of the Windows and Android clipboards, and conforms to the user's operating habits.
在图13A-图16描述的方案中,基于用户在源端Windows应用程序的窗口针对目标对象的简单的复制/剪切操作,和在目的端Android应用程序的窗口的简单的粘贴操作,即可实现Windows应用程序到Android应用程序的目标对象的复制/剪切,而不需要用户进行多步、复杂的操作。并且,用户通过鼠标或键盘等输入设备在窗口内的复 制/剪切和粘贴操作,更符合用户基于Windows操作系统和电脑的操作使用习惯,因而用户使用体验较好,能够增加产品的竞争力。而且,该方案不需要依赖adb、socket通信和网络能力等因素,文件传输速度快且安全可靠。In the solution described in Figure 13A-Figure 16, based on the simple copy/cut operation of the user on the target object in the window of the Windows application program at the source end, and the simple paste operation on the window of the Android application program at the destination end, the Realize the copy/cut of the target object from the Windows application to the Android application without requiring the user to perform multi-step and complicated operations. Moreover, the user's copy/cut and paste operations in the window through input devices such as mouse or keyboard are more in line with the user's operating habits based on the Windows operating system and computers, so the user experience is better and the competitiveness of the product can be increased. Moreover, this solution does not need to rely on factors such as adb, socket communication, and network capabilities, and the file transfer speed is fast and safe and reliable.
需要说明的是,在场景(4)中,以上多个实施例中的部分或全部步骤(例如图13B所示流程中的部分步骤),在不冲突的情况下,可以重新组合,从而构成新的实施例。本申请实施例对此不再具体说明。It should be noted that in scenario (4), some or all of the steps in the above multiple embodiments (such as some steps in the process shown in Figure 13B) can be recombined to form a new the embodiment. This embodiment of the present application will not specifically describe this.
场景(5)、复制和粘贴操作实现Android应用程序到Windows应用程序的文件传输:Scenario (5), copy and paste operations to achieve file transfer from Android applications to Windows applications:
在该交互场景中,用户可以通过鼠标、触摸屏或键盘的快捷键,基于Android应用程序窗口中的目标文件执行复制操作(例如选中目标对象后点击对应的复制选项,或者在目标对象后长按鼠标左键后点击出现的复制选项,或者按下键盘上的Ctrl+C快捷键,或者针对目标文件点击鼠标右键后选择复制选项等),并在Windows应用程序的窗口中执行粘贴操作(例如点击鼠标右键后选择粘贴选项,或者按下键盘上的Ctrl+V快捷键等)。电脑根据用户的复制和粘贴操作,将Android应用程序中的目标文件复制到Windows应用程序,实现Android应用程序到Windows应用程序的文件传输。In this interactive scenario, the user can perform a copy operation based on the target file in the Android application window through the shortcut keys of the mouse, touch screen or keyboard (for example, click the corresponding copy option after selecting the target object, or long press the mouse after the target object Left-click and click the copy option that appears, or press the shortcut key Ctrl+C on the keyboard, or click the right mouse button on the target file and select the copy option, etc.), and perform the paste operation in the window of the Windows application (for example, click the mouse Right-click and select the Paste option, or press the Ctrl+V shortcut key on the keyboard, etc.). The computer copies the target file in the Android application program to the Windows application program according to the user's copy and paste operation, so as to realize the file transfer from the Android application program to the Windows application program.
以下结合图17所示的流程图及图18所示的界面示意图进行说明:The following will be described in conjunction with the flow chart shown in Figure 17 and the schematic diagram of the interface shown in Figure 18:
1700、Guest侧检测到Android应用程序的窗口中针对目标对象的复制操作。1700. The Guest side detects a copy operation on the target object in the window of the Android application program.
若目标对象为目标文件,则执行步骤1701-1711;若目标对象为目标文本,则执行步骤1712-1717。If the target object is a target file, execute steps 1701-1711; if the target object is target text, execute steps 1712-1717.
1701、若目标对象为目标文件,则Guest侧响应于用户的复制操作,将目标文件的路径信息存放到Guest侧剪贴板中。1701. If the target object is a target file, the Guest side stores the path information of the target file in the clipboard of the Guest side in response to a user's copy operation.
1702、Guest侧监控Guest侧剪贴板的变化,将Guest侧剪贴板中目标文件的路径信息存放到共享剪贴板中。1702. The Guest side monitors the changes of the Guest side clipboard, and stores the path information of the target file in the Guest side clipboard into the shared clipboard.
其中,Guest侧可以基于Qemu Pipe,将Guest侧剪贴板中目标文件的路径信息存放到共享剪贴板中。Among them, the Guest side can store the path information of the target file in the Guest side clipboard to the shared clipboard based on Qemu Pipe.
1703、Host侧检测到Windows应用程序窗口中的粘贴操作,该粘贴操作用于指示在该窗口中粘贴目标文件。1703. The Host side detects a paste operation in the Windows application window, and the paste operation is used to instruct to paste the target file in the window.
1704、Host侧对Windows应用程序窗口对应的待粘贴目的路径,以及共享剪贴板中的路径信息对应的目标文件进行预检查,并在预检查通过后,基于Qemu Pipe向Guest侧发起目标文件复制请求。1704. The Host side pre-checks the target path to be pasted corresponding to the Windows application window and the target file corresponding to the path information in the shared clipboard, and after the pre-check passes, initiates a target file copy request to the Guest side based on the Qemu Pipe .
其中,该预检查操作可以为可选操作。Wherein, the pre-check operation may be an optional operation.
1705、Guest侧接收到复制请求后,确定源目标文件是否存在。1705. After receiving the copy request, the Guest side determines whether the source target file exists.
1706、若Guest侧确定源目标文件存在,则将源目标文件拷贝到9p共享文件夹,并在拷贝完成后,基于Qemu Pipe通知Host侧。1706. If the Guest side determines that the source and target files exist, copy the source and target files to the 9p shared folder, and notify the Host side based on the Qemu Pipe after the copy is completed.
其中,当目标文件包括多个文件时,Guest侧可以每拷贝完目标文件中的一个文件后,就通知Host侧;也可以在目标文件的全部文件都拷贝完后再通知Host侧。Wherein, when the target file includes multiple files, the Guest side can notify the Host side after every copy of a file in the target file; it can also notify the Host side after all the files of the target file have been copied.
1707、Host侧将目标文件从共享文件夹复制到Windows应用程序。1707. The Host side copies the target file from the shared folder to the Windows application program.
1708、Host侧的Windows应用程序根据粘贴位置进行相应处理。1708. The Windows application program on the Host side performs corresponding processing according to the paste position.
该步骤的相关说明可以参见步骤612中的相关描述。例如,Windows应用程序根 据具体的粘贴位置,将目标文件复制到粘贴位置对应的目录下,或者将目标文件发送给联系人等。For the related description of this step, refer to the related description in step 612 . For example, the Windows application program copies the target file to a directory corresponding to the pasting position according to the specific pasting position, or sends the target file to a contact person.
示例性的,针对图18中的(a)-(b)所示的用户基于Android文件管理窗口1801中的目标文件按下快捷键Ctrl+C的复制操作(或者,用户点击复制选项1803的复制操作),以及用户基于Windows资源管理器窗口1802按下快捷键Ctrl+V的粘贴操作,参见图18中的(c),Windows资源管理器窗口中添加了目标文件,实现了目标文件从Android文件管理到Windows资源管理器的复制。Exemplary, for the user shown in (a)-(b) in Figure 18, press the copy operation of the shortcut key Ctrl+C based on the target file in the Android file management window 1801 (or, the user clicks the copy operation of the copy option 1803 operation), and the paste operation that the user presses the shortcut key Ctrl+V based on the Windows Explorer window 1802, referring to (c) in Figure 18, the target file is added in the Windows Explorer window, and the target file is converted from the Android file Manage replication to Windows Explorer.
1709、Host侧将共享文件夹中的目标文件删除,并基于Qemu Pipe通知Guest侧文件传输完成。1709. The Host side deletes the target file in the shared folder, and notifies the Guest side that the file transfer is completed based on the Qemu Pipe.
在上述过程中,用户执行的是复制和粘贴操作,在其他一些实施例中,如果用户通过鼠标或键盘的快捷键等方式,基于Android文件管理窗口中的目标文件进行剪切操作,则在上述步骤1709之后,该方法还包括:In the above process, what the user performs is a copy and paste operation. In some other embodiments, if the user performs a cut operation based on the target file in the Android file management window through the shortcut keys of the mouse or keyboard, then in the above After step 1709, the method also includes:
1710、Guest侧接收到传输完成通知后,删除Android应用程序中的目标文件,删除Guest侧剪贴板中目标文件的路径信息。1710. After receiving the transmission completion notification, the Guest side deletes the target file in the Android application program, and deletes the path information of the target file in the clipboard of the Guest side.
1711、Guest侧同步Guest侧剪贴板的变化,删除共享剪贴板中存放的目标文件的路径信息。1711. The Guest side synchronizes the changes of the clipboard on the Guest side, and deletes the path information of the target file stored in the shared clipboard.
在一些实施例中,电脑在目标文件的复制/剪切过程中还可以显示传输进度条。In some embodiments, the computer can also display a transmission progress bar during the copying/cutting process of the target file.
在步骤1701之后,若目标对象为目标文本,则执行以下步骤:After step 1701, if the target object is the target text, then perform the following steps:
1712、若目标对象为目标文本,则Guest侧响应于用户的复制操作,将目标文本存放到Guest侧剪贴板中。1712. If the target object is the target text, the Guest side stores the target text in the Guest side clipboard in response to the user's copy operation.
1713、Guest侧监控Guest侧剪贴板的变化,将Guest侧剪贴板中目标文本存放到共享剪贴板中。1713. The Guest side monitors the changes of the Guest side clipboard, and stores the target text in the Guest side clipboard into the shared clipboard.
1714、Host侧检测到Windows应用程序窗口中的粘贴操作,该粘贴操作用于指示在该窗口中粘贴目标文本。1714. The Host side detects a paste operation in the Windows application window, and the paste operation is used to instruct to paste the target text in the window.
1715、Host侧对Windows应用程序对应的待粘贴目的路径,以及共享剪贴板中目标文本进行预检查。1715. The Host side pre-checks the destination path to be pasted corresponding to the Windows application program and the target text in the shared clipboard.
其中,该步骤1715为可选的步骤。Wherein, this step 1715 is an optional step.
1716、Host侧在预检查通过后,将目标文本复制到Windows应用程序。1716. After the pre-check is passed, the host side copies the target text to the Windows application program.
1717、Host侧的Windows应用程序根据粘贴位置进行相应处理。1717. The Windows application program on the Host side performs corresponding processing according to the paste position.
该步骤的相关说明可以参见步骤612中的相关描述。例如,Windows应用程序根据具体的粘贴位置,将目标文本插入到粘贴位置,或者将目标文本发送给联系人。For the related description of this step, refer to the related description in step 612 . For example, the Windows application program inserts the target text into the pasting position according to the specific pasting position, or sends the target text to the contact.
如果用户执行的是剪切和粘贴操作,则在上述步骤1717之后,该方法还包括:If the user performs cut and paste operations, after the above step 1717, the method further includes:
1718、Guest侧删除Android应用程序中的目标文本。1718. The Guest side deletes the target text in the Android application program.
本申请实施例通过Qemu Pipe通信实现Android模拟器Host侧与Guest侧进行通信交互,通过如图4所示的共享剪贴板复制文件路径,通过Virtio-9p实现Host侧与Guest侧的文件共享,或者通过共享剪贴板实现Host侧与Guest侧的文本共享,在Android应用程序与Windows应用程序之间复制/剪切文本或文件。The embodiment of the present application realizes the communication interaction between the Host side and the Guest side of the Android emulator through Qemu Pipe communication, copies the file path through the shared clipboard as shown in Figure 4, and realizes the file sharing between the Host side and the Guest side through Virtio-9p, or Realize text sharing between the Host side and the Guest side by sharing the clipboard, and copy/cut text or files between Android applications and Windows applications.
该方案在9P共享文件系统的基础上,实现了Windows与Android模拟器侧共享剪贴板的相关操作。在用户体验上实现了Windows侧与Android侧剪贴板的功能,与 Windows与Android剪贴板的使用方式保持一致,符合用户的操作使用习惯。Based on the 9P shared file system, this solution realizes the related operations of sharing the clipboard on the side of the Windows and Android emulators. In terms of user experience, the function of the clipboard on the Windows side and the Android side is realized, which is consistent with the use of the Windows and Android clipboards, and conforms to the user's operating habits.
在图17-图18描述的方案中,基于用户在源端Android应用程序的窗口针对目标文件的简单的复制/剪切操作,和在目的端Windows应用程序的窗口的简单的粘贴操作,即可实现Android应用程序到Windows应用程序的文件复制/剪切,而不需要用户进行多步、复杂的操作。并且,用户通过鼠标或键盘等输入设备在窗口内的复制/剪切和粘贴操作,更符合用户基于Windows操作系统和电脑的操作使用习惯,因而用户使用体验较好,能够增加产品的竞争力。而且,该方案不需要依赖adb、socket通信和网络能力等因素,文件传输速度快且安全可可靠。In the solution described in Figure 17-Figure 18, based on the simple copy/cut operation of the user on the source Android application window for the target file, and the simple paste operation on the destination Windows application window, you can Realize file copy/cut from Android application to Windows application, without requiring users to perform multi-step and complicated operations. Moreover, the user's copy/cut and paste operations in the window through mouse or keyboard input devices are more in line with the user's operating habits based on the Windows operating system and computers, so the user experience is better and the competitiveness of the product can be increased. Moreover, this solution does not need to rely on factors such as adb, socket communication, and network capabilities, and the file transfer speed is fast and safe and reliable.
需要说明的是,在场景(5)中,以上多个实施例中的部分或全部步骤(例如图17所示流程中的部分步骤),在不冲突的情况下,可以重新组合,从而构成新的实施例。本申请实施例对此不再具体说明。It should be noted that in scenario (5), some or all of the steps in the above multiple embodiments (such as some steps in the process shown in Figure 17) can be recombined to form a new the embodiment. This embodiment of the present application will not specifically describe this.
场景(6)、复制和粘贴操作实现Android应用程序到另一Android应用程序的文件传输:Scenario (6), copy and paste operations to achieve file transfer from an Android application to another Android application:
在该交互场景中,用户可以通过鼠标、触摸屏或键盘的快捷键,基于Android应用程序1窗口中的目标文件执行复制操作(例如选中目标文件后点击对应的复制选项,或者在目标对象后长按鼠标左键后点击出现的复制选项,或者按下键盘上的Ctrl+C快捷键,或者针对目标文件点击鼠标右键后选择复制选项等),并在Android应用程序2的窗口中执行粘贴操作(例如点击粘贴选项,按下键盘上的Ctrl+V快捷键,或者点击鼠标右键后选择粘贴选项等)。电脑根据用户的复制和粘贴操作,将Android应用程序1中的目标文件复制到Android应用程序1,实现Android应用程序间的文件传输。In this interactive scenario, the user can perform a copy operation based on the target file in the Android application 1 window through the shortcut keys of the mouse, touch screen or keyboard (for example, click the corresponding copy option after selecting the target file, or long press the target object Click the copy option that appears after the left mouse button, or press the Ctrl+C shortcut key on the keyboard, or click the right mouse button on the target file and select the copy option, etc.), and perform the paste operation in the window of the Android application 2 (for example Click the paste option, press the shortcut key Ctrl+V on the keyboard, or click the right mouse button and select the paste option, etc.). The computer copies the target file in the Android application program 1 to the Android application program 1 according to the user's copy and paste operation, so as to realize the file transfer between the Android application programs.
以下结合图19所示的流程图及图20所示的界面示意图进行说明:The following will be explained in conjunction with the flow chart shown in Figure 19 and the schematic diagram of the interface shown in Figure 20:
1900、Guest侧检测到Android应用程序1窗口中针对目标对象的复制操作。1900. The Guest side detects a copy operation on the target object in the Android application program 1 window.
若目标对象为目标文件,则执行步骤1901-1908;若目标对象为目标文件,则执行步骤1909-1915。If the target object is a target file, execute steps 1901-1908; if the target object is a target file, execute steps 1909-1915.
1901、若目标对象为目标文件,则Guest侧响应于用户的复制操作,将目标文件的路径信息存放到Guest侧剪贴板中。1901. If the target object is a target file, the Guest side stores the path information of the target file in the clipboard of the Guest side in response to a user's copy operation.
1902、Guest侧监控Guest侧剪贴板的变化,将Guest侧剪贴板中目标文件的路径信息存放到共享剪贴板中。1902. The Guest side monitors the changes of the Guest side clipboard, and stores the path information of the target file in the Guest side clipboard into the shared clipboard.
其中,Guest侧可以基于Qemu Pipe,将Guest侧剪贴板中目标文件的路径信息存放到共享剪贴板中。Among them, the Guest side can store the path information of the target file in the Guest side clipboard to the shared clipboard based on Qemu Pipe.
1903、Guest侧检测到Android应用程序2窗口中的粘贴操作,该粘贴操作用于指示在该窗口中粘贴目标文件。1903. The Guest side detects a paste operation in the Android application program 2 window, and the paste operation is used to instruct to paste the target file in the window.
1904、Guest侧对当前Android应用程序2窗口对应的待粘贴目的路径,以及共享剪贴板中的路径信息对应的目标文件进行预检查。1904. The Guest side pre-checks the target path to be pasted corresponding to the current Android application 2 window and the target file corresponding to the path information in the shared clipboard.
其中,该预检查可以为可选操作。Wherein, the pre-check may be an optional operation.
1905、Guest侧在预检查通过后,确定源目标文件是否存在。1905. After the pre-check is passed, the Guest side determines whether the source target file exists.
1906、若Guest侧确定源目标文件存在,则将共享剪切板中的路径信息对应的目标文件复制到Android应用程序2。1906. If the Guest side determines that the source target file exists, copy the target file corresponding to the path information in the shared clipboard to the Android application program 2.
1907、Guest侧的Android应用程序2根据粘贴位置进行相应处理。1907. The Android application program 2 on the Guest side performs corresponding processing according to the paste position.
示例性的,针对图20中的(a)-(b)所示的用户基于Android文件管理窗口2001中的目标文件按下快捷键Ctrl+C的复制操作(或者用户点击复制选项2003的复制操作),以及用户基于Android社交应用窗口2002按下快捷键Ctrl+V的粘贴操作,参见图20中的(c),Android社交应用窗口中添加了目标文件,且目标文件发送给了对应的联系人,实现了目标文件从Android文件管理到Android社交应用的复制。Exemplarily, for the user shown in (a)-(b) among Fig. 20, press the copy operation of shortcut key Ctrl+C based on the target file in Android file management window 2001 (or the user clicks the copy operation of copy option 2003 ), and the paste operation that the user presses the shortcut key Ctrl+V based on the Android social application window 2002, see (c) in Figure 20, the target file is added in the Android social application window, and the target file is sent to the corresponding contact , realizing the copying of target files from Android file management to Android social applications.
在上述过程中,用户执行的是复制和粘贴操作,在其他一些实施例中,如果用户通过鼠标或键盘的快捷键等方式,基于Android文件管理窗口中的目标文件进行剪切操作,则在上述步骤1907之后,该方法还包括:In the above process, what the user performs is a copy and paste operation. In some other embodiments, if the user performs a cut operation based on the target file in the Android file management window through the shortcut keys of the mouse or keyboard, then in the above After step 1907, the method also includes:
1908、Guest侧删除Android应用程序1中的目标文件。1908. The Guest side deletes the target file in the Android application program 1.
在一些实施例中,电脑在目标文件的复制/剪切过程中还可以显示传输进度条。In some embodiments, the computer can also display a transmission progress bar during the copying/cutting process of the target file.
也就是说,本申请实施例通过Qemu Pipe通信实现Android模拟器Host侧与Guest侧进行通信交互,通过共享剪贴板复制文件路径,在Android应用程序之间复制/剪切目标文件。在步骤1901之后,若目标对象为目标文本,则执行以下步骤:That is to say, the embodiment of the present application realizes the communication and interaction between the Host side and the Guest side of the Android emulator through Qemu Pipe communication, and copies the file path through the shared clipboard, and copies/cuts the target file between Android applications. After step 1901, if the target object is the target text, then perform the following steps:
1909、若目标对象为目标文本,则Guest侧响应于用户的复制操作,将目标文本存放到Guest侧剪贴板中。1909. If the target object is the target text, the Guest side stores the target text in the Guest side clipboard in response to the user's copy operation.
1910、Guest侧监控Guest侧剪贴板的变化,将Guest侧剪贴板中目标文本存放到共享剪贴板中。1910. The Guest side monitors the changes of the Guest side clipboard, and stores the target text in the Guest side clipboard into the shared clipboard.
1911、Guest侧检测到Android应用程序2窗口中的粘贴操作,该粘贴操作用于指示在该窗口中粘贴目标文本。1911. The Guest side detects a paste operation in the Android application program 2 window, and the paste operation is used to instruct to paste the target text in the window.
1912、Guest侧对Android应用程序对应的待粘贴目的路径,以及共享剪贴板中目标文本进行预检查。1912. The Guest side pre-checks the target path to be pasted corresponding to the Android application program and the target text in the shared clipboard.
其中,该步骤1912为可选的步骤。Wherein, this step 1912 is an optional step.
1913、Guest侧在预检查通过后,将目标文本复制到Android应用程序2。1913. After the pre-check is passed, the Guest side copies the target text to the Android application program 2.
1914、Guest侧的Android应用程序2根据粘贴位置进行相应处理。1914. The Android application program 2 on the Guest side performs corresponding processing according to the paste position.
该步骤的相关说明可以参见步骤612中的相关描述。例如,Android应用程序2根据具体的粘贴位置,将目标文本插入到粘贴位置,或者将目标文本发送给联系人。For the related description of this step, refer to the related description in step 612 . For example, the Android application 2 inserts the target text into the pasting position according to the specific pasting position, or sends the target text to the contact.
如果用户执行的是剪切和粘贴操作,则在上述步骤1914之后,该方法还包括:If the user performs cut and paste operations, after the above step 1914, the method further includes:
1915、Guest侧删除Android应用程序1中的目标文本。1915. The Guest side deletes the target text in the Android application program 1.
该方案在用户体验上实现了Android侧剪贴板的功能,与Android剪贴板的使用方式保持一致,符合用户的操作使用习惯。In terms of user experience, this solution implements the function of the Android side clipboard, which is consistent with the use of the Android clipboard and conforms to the user's operating habits.
在图19-图20描述的方案中,基于用户在源端Android应用程序1的窗口针对目标对象的简单的复制/剪切操作,和在目的端Android应用程序2的窗口的简单的粘贴操作,即可实现Android应用程序间的目标对象的复制/剪切,而不需要用户进行多步、复杂的操作。并且,用户通过鼠标或键盘等输入设备在窗口内的复制/剪切和粘贴操作,更符合用户基于Windows操作系统和电脑的操作使用习惯,因而用户使用体验较好,能够增加产品的竞争力。而且,该方案不需要依赖adb、socket通信和网络能力等因素,文件传输速度快且安全可靠。In the solution described in Fig. 19-Fig. 20, based on the user's simple copy/cut operation on the target object in the window of the Android application program 1 at the source end, and the simple paste operation on the window of the Android application program 2 at the destination end, The copying/cutting of target objects between Android application programs can be realized without requiring the user to perform multi-step and complicated operations. Moreover, the user's copy/cut and paste operations in the window through mouse or keyboard input devices are more in line with the user's operating habits based on the Windows operating system and computers, so the user experience is better and the competitiveness of the product can be increased. Moreover, this solution does not need to rely on factors such as adb, socket communication, and network capabilities, and the file transfer speed is fast and safe and reliable.
需要说明的是,在场景(6)中,以上多个实施例中的部分或全部步骤(例如图19所示流程中的部分步骤),在不冲突的情况下,可以重新组合,从而构成新的实施 例。本申请实施例对此不再具体说明。It should be noted that in scenario (6), some or all of the steps in the above multiple embodiments (such as some steps in the process shown in Figure 19) can be recombined to form a new the embodiment. This embodiment of the present application will not specifically describe this.
在本申请的一些实施例中,在上述场景(4)-(6)中,可传输的目标对象也可以为文件夹,且文件夹的传输方式与文件的传输方式相同。也可以理解为,目标对象类型中的文件包括文件夹。In some embodiments of the present application, in the above scenarios (4)-(6), the transferable target object may also be a folder, and the transfer method of the folder is the same as that of the file. It can also be understood that the files in the target object type include folders.
在本申请的另一些实施例中,在上述场景(4)-(6)中,可传输的目标对象不能为文件夹,若目标对象为文件夹,则Host侧直接通知源窗口不允许复制/剪切,用户在Android应用程序窗口执行粘贴操作时,Host侧可以提示用户(例如通过弹窗等方式来提示用户)不允许复制/剪切;在Android侧窗口中执行复制/剪切文件夹的操作时,Guest侧也不会将相关信息通知给Host侧。In other embodiments of the present application, in the above-mentioned scenarios (4)-(6), the target object that can be transferred cannot be a folder, if the target object is a folder, then the Host side directly notifies the source window that copying is not allowed/ Cut, when the user performs a paste operation in the Android application window, the Host side can prompt the user (for example, prompt the user through a pop-up window, etc.) that copy/cut is not allowed; perform copy/cut folder in the Android side window During the operation, the Guest side will not notify the Host side of relevant information.
在其他一些实施例中,在传输目标对象的过程中,第一操作系统与第二操作系统之间可以通过Socket或其他通信技术进行通信交互。In some other embodiments, during the process of transmitting the target object, communication and interaction between the first operating system and the second operating system may be performed through Socket or other communication technologies.
可以理解的是,为了实现上述功能,电子设备包含了执行各个功能相应的硬件和/或软件模块。结合本文中所公开的实施例描述的各示例的算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以结合实施例对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。It can be understood that, in order to realize the above functions, the electronic device includes hardware and/or software modules corresponding to each function. Combining the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software drives hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions in combination with the embodiments for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
本实施例可以根据上述方法示例对电子设备进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块可以采用硬件的形式实现。需要说明的是,本实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In this embodiment, the functional modules of the electronic device may be divided according to the above method example. For example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The above integrated modules may be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic, and is only a logical function division, and there may be other division methods in actual implementation.
在采用对应各个功能划分各个功能模块的情况下,上述实施例中涉及的电子设备的一种可能的组成示意图,该电子设备可以包括:显示单元、传输单元和处理单元等。需要说明的是,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。In the case of dividing each functional module corresponding to each function, a schematic diagram of a possible composition of the electronic device involved in the above embodiment, the electronic device may include: a display unit, a transmission unit, and a processing unit. It should be noted that all relevant content of the steps involved in the above method embodiments can be referred to the function description of the corresponding function module, and will not be repeated here.
本申请实施例还提供一种电子设备,包括一个或多个处理器以及一个或多个存储器。该一个或多个存储器与一个或多个处理器耦合,一个或多个存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当一个或多个处理器执行计算机指令时,使得电子设备执行上述相关方法步骤实现上述实施例中的跨系统传输目标对象的方法。The embodiment of the present application also provides an electronic device, including one or more processors and one or more memories. The one or more memories are coupled with one or more processors, the one or more memories are used to store computer program codes, the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the electronic device performs The above related method steps implement the method for transferring target objects across systems in the above embodiments.
本申请的实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机指令,当该计算机指令在电子设备上运行时,使得电子设备执行上述相关方法步骤实现上述实施例中的跨系统传输目标对象的方法。Embodiments of the present application also provide a computer-readable storage medium, where computer instructions are stored in the computer-readable storage medium, and when the computer instructions are run on the electronic device, the electronic device executes the above-mentioned relevant method steps to realize the above-mentioned embodiment Methods for transferring target objects across systems in .
本申请的实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中电子设备执行的跨系统传输目标对象的方法。Embodiments of the present application also provide a computer program product, which, when running on a computer, causes the computer to execute the above-mentioned related steps, so as to implement the method for transmitting a target object across systems performed by the electronic device in the above-mentioned embodiment.
另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使装置执行上述各方法实 施例中电子设备执行的跨系统传输目标对象的方法。In addition, an embodiment of the present application also provides a device, which may specifically be a chip, a component or a module, and the device may include a connected processor and a memory; wherein the memory is used to store computer-executable instructions, and when the device is running, The processor can execute the computer-executed instructions stored in the memory, so that the apparatus executes the method for transmitting a target object across systems performed by the electronic device in the above method embodiments.
其中,本实施例提供的电子设备、计算机可读存储介质、计算机程序产品或装置均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。Among them, the electronic equipment, computer-readable storage medium, computer program product or device provided in this embodiment are all used to execute the corresponding method provided above, therefore, the beneficial effects it can achieve can refer to the above-mentioned The beneficial effects of the corresponding method will not be repeated here.
通过以上实施方式的描述,所属领域的技术人员可以了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。Through the description of the above embodiments, those skilled in the art can understand that for the convenience and brevity of the description, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions can be assigned by different Completion of functional modules means that the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be Incorporation or may be integrated into another device, or some features may be omitted, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The unit described as a separate component may or may not be physically separated, and the component displayed as a unit may be one physical unit or multiple physical units, that is, it may be located in one place, or may be distributed to multiple different places . Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the software product is stored in a storage medium Among them, several instructions are included to make a device (which may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes such as U disk, mobile hard disk, read only memory (ROM), random access memory (random access memory, RAM), magnetic disk or optical disk.
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above content is only the specific implementation of the application, but the scope of protection of the application is not limited thereto. Anyone familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the application, and should covered within the scope of protection of this application. Therefore, the protection scope of the present application should be determined by the protection scope of the claims.

Claims (38)

  1. 一种目标对象的传输方法,应用于电子设备,所述电子设备运行有第一操作系统,所述第一操作系统上运行有所述第一操作系统的应用程序,且所述第一操作系统上基于模拟器运行有第二操作系统的应用程序,其特征在于,所述方法包括:A method for transmitting a target object, applied to an electronic device, the electronic device runs a first operating system, an application program of the first operating system runs on the first operating system, and the first operating system An application program based on a simulator running a second operating system, wherein the method includes:
    所述电子设备显示第一界面,所述第一界面包括第一应用程序的窗口和第二应用程序的窗口,所述第一应用程序的窗口中包括目标对象,所述第二应用程序的窗口中不包括所述目标对象;其中,所述第一应用程序或所述第二应用程序中的至少一个为所述第二操作系统的应用程序;The electronic device displays a first interface, the first interface includes a window of a first application program and a window of a second application program, the window of the first application program includes a target object, and the window of the second application program does not include the target object; wherein, at least one of the first application program or the second application program is an application program of the second operating system;
    所述电子设备响应于所述目标对象从所述第一应用程序的窗口拖拽至所述第二应用程序的窗口后释放拖拽的拖拽事件,将所述目标对象传输至所述第二应用程序。The electronic device transmits the target object to the second application program in response to a drag event in which the target object is dragged from the window of the first application program to the window of the second application program and the drag is released. application.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, further comprising:
    所述电子设备响应于所述目标对象从所述第一应用程序的窗口拖拽至所述第二应用程序的窗口后释放拖拽的拖拽事件,显示第二界面,所述第二界面包括所述第一应用程序的窗口和所述第二应用程序的窗口,所述第二应用程序的窗口中包括所述目标对象。The electronic device displays a second interface in response to a drag event in which the target object is dragged from the window of the first application program to the window of the second application program and then released, and the second interface includes The window of the first application program and the window of the second application program, the window of the second application program includes the target object.
  3. 根据权利要求1或2所述的方法,其特征在于,所述第一应用程序或所述第二应用程序中的一个为所述第二操作系统的应用程序,所述目标对象包括一个或多个文件,所述电子设备包括所述第一操作系统和所述第二操作系统的共享文件夹;所述电子设备将所述目标对象传输至所述第二应用程序,包括:The method according to claim 1 or 2, wherein one of the first application program or the second application program is an application program of the second operating system, and the target object includes one or more files, the electronic device includes shared folders of the first operating system and the second operating system; the electronic device transfers the target object to the second application program, including:
    所述电子设备基于所述共享文件夹,将所述目标对象传输至所述第二应用程序。The electronic device transmits the target object to the second application program based on the shared folder.
  4. 根据权利要求3所述的方法,其特征在于,所述第一应用程序为所述第一操作系统的应用程序,所述第二应用程序为所述第二操作系统的应用程序;所述第一操作系统为所述模拟器的主机端Host,所述第二操作系统为所述模拟器的客户端Guest;所述电子设备基于所述共享文件夹,将所述目标对象传输至所述第二应用程序,包括:The method according to claim 3, wherein the first application program is an application program of the first operating system, and the second application program is an application program of the second operating system; the second application program is an application program of the second operating system; An operating system is the host-end Host of the emulator, and the second operating system is the client-side Guest of the emulator; the electronic device transmits the target object to the second operating system based on the shared folder. Two applications, including:
    所述主机端Host将所述目标对象拷贝至所述共享文件夹;The host end Host copies the target object to the shared folder;
    所述客户端Guest从所述共享文件夹获取所述目标对象;The client Guest obtains the target object from the shared folder;
    所述客户端Guest根据所述目标对象构建所述第二操作系统侧的拖拽事件,以将所述目标对象传输至所述第二应用程序。The client Guest constructs a drag event on the second operating system side according to the target object, so as to transmit the target object to the second application program.
  5. 根据权利要求4所述的方法,其特征在于,在所述主机端Host将所述目标对象拷贝至所述共享文件夹之前,所述方法还包括:The method according to claim 4, wherein, before the host-side Host copies the target object to the shared folder, the method further comprises:
    所述主机端Host基于管道通信通知所述客户端Guest发生拖拽事件;The host-side Host notifies the client-side Guest of a drag event based on pipeline communication;
    所述主机端Host在拖拽释放后,基于管道通信将拖拽释放位置坐标和拽释放窗口对应的所述第二操作系统侧窗口标识和传输类型通知给所述客户端Guest;所述传输类型用于表示所述目标对象在所述第一操作系统的应用程序与所述第二操作系统的应用程序之间传输;After the drag release, the host host host notifies the client Guest of the second operating system side window identification and transmission type corresponding to the drag release position coordinates and the drag release window based on pipeline communication; used to indicate that the target object is transferred between the application program of the first operating system and the application program of the second operating system;
    若所述客户端Guest根据所述拖拽释放位置坐标和所述拽释放窗口对应的所述第二操作系统侧窗口标识确定所述释放位置允许拖拽,则基于所述传输类型通过管道通信通知所述主机端Host传输所述目标对象;If the client Guest determines that dragging is allowed at the release position according to the coordinates of the drag release position and the second operating system side window identifier corresponding to the drag release window, then a notification is made through a pipeline communication based on the transmission type The host end Host transmits the target object;
    所述主机端Host将所述目标对象拷贝至所述共享文件夹,包括:The host-side Host copies the target object to the shared folder, including:
    所述主机端Host将所述目标对象拷贝至所述共享文件夹,并基于管道通信将拷贝完成消息通知给所述客户端Guest;The host host host copies the target object to the shared folder, and notifies the client Guest of a copy completion message based on pipeline communication;
    所述客户端Guest从所述共享文件夹获取所述目标对象,包括:The client Guest obtains the target object from the shared folder, including:
    所述客户端Guest接收到拷贝完成消息后,从所述共享文件夹获取所述目标对象。After the client Guest receives the copy completion message, it acquires the target object from the shared folder.
  6. 根据权利要求5所述的方法,其特征在于,所述主机端Host将所述目标对象拷贝至所述共享文件夹,并基于管道通信将拷贝完成消息通知给所述客户端Guest,包括:The method according to claim 5, wherein the host-side Host copies the target object to the shared folder, and notifies the client Guest of a copy completion message based on pipeline communication, including:
    所述主机端Host每将所述目标对象中的单个文件拷贝至所述共享文件夹后,基于管道通信将拷贝完成消息通知给所述客户端Guest;After the host end Host copies a single file in the target object to the shared folder, it notifies the client Guest of a copy completion message based on pipeline communication;
    所述客户端Guest从所述共享文件夹获取所述目标对象,包括:The client Guest obtains the target object from the shared folder, including:
    所述客户端Guest每接收到一次拷贝完成消息后,从所述共享文件夹获取所述目标对象的一个文件;The client Guest obtains a file of the target object from the shared folder after each receiving a copy completion message;
    所述客户端Guest根据所述目标对象构建所述第二操作系统侧的拖拽事件,以将所述目标对象传输至所述第二应用程序,包括:The client Guest constructs a drag event on the second operating system side according to the target object, so as to transmit the target object to the second application program, including:
    所述客户端Guest根据所述目标对象中的单个文件分别构建所述第二操作系统侧的拖拽事件,以将所述目标对象中的每个文件分别传输至所述第二应用程序。The client Guest constructs a drag event on the second operating system side according to a single file in the target object, so as to transfer each file in the target object to the second application program.
  7. 根据权利要求5或6所述的方法,其特征在于,所述拷贝完成消息包括拷贝完成的文件的文件名;或者,所述拷贝完成消息包括拷贝完成的文件的文件名信息和时间戳。The method according to claim 5 or 6, wherein the copy completion message includes the file name of the copied file; or, the copy completion message includes file name information and time stamp of the copied file.
  8. 根据权利要求4-7任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 4-7, wherein the method further comprises:
    当所述拖拽位置进入第三应用程序的窗口后,所述第三应用程序为所述第二操作系统的应用程序,且所述第三应用程序与所述第二应用程序相同或不同,所述电子设备根据所述第三应用程序是否允许拖入所述目标对象,显示允许拖拽标识或禁止拖拽标识。When the dragging position enters the window of the third application program, the third application program is an application program of the second operating system, and the third application program is the same as or different from the second application program, The electronic device displays a drag-and-drop permission mark or a drag-and-drop prohibition mark according to whether the third application program allows dragging of the target object.
  9. 根据权利要求3所述的方法,其特征在于,所述第一应用程序为所述第二操作系统的应用程序,所述第二应用程序为所述第一操作系统的应用程序;所述第一操作系统为所述模拟器的主机端Host,所述第二操作系统为所述模拟器的客户端Guest;所述电子设备基于所述共享文件夹,将所述目标对象传输至所述第二应用程序,包括:The method according to claim 3, wherein the first application program is an application program of the second operating system, and the second application program is an application program of the first operating system; the second application program is an application program of the first operating system; An operating system is the host-end Host of the emulator, and the second operating system is the client-side Guest of the emulator; the electronic device transmits the target object to the second operating system based on the shared folder. Two applications, including:
    所述主机端Host构建所述第一操作系统侧的拖拽事件;The host-side Host constructs a drag event on the first operating system side;
    所述客户端Guest将所述目标对象拷贝至所述共享文件夹;The client Guest copies the target object to the shared folder;
    所述主机端Host取消所述第一操作系统侧的拖拽事件,将所述目标对象从所述共享文件夹,剪切至所述第二应用程序。The host end Host cancels the drag event on the first operating system side, and cuts the target object from the shared folder to the second application program.
  10. 根据权利要求9所述的方法,其特征在于,若所述第二应用程序为所述第一操作系统的资源管理器,则所述客户端Guest将所述目标对象拷贝至所述共享文件夹,包括:The method according to claim 9, wherein if the second application program is a resource manager of the first operating system, the client Guest copies the target object to the shared folder ,include:
    所述客户端Guest以单个文件为粒度,将所述目标对象中的每个文件分别拷贝至所述共享文件夹;The client Guest copies each file in the target object to the shared folder with a single file as the granularity;
    所述主机端Host从所述共享文件夹将所述目标对象,剪切至所述第二应用程序,包括:The host end Host cuts the target object from the shared folder to the second application program, including:
    所述主机端Host分别将所述目标对象中的每个文件从所述共享文件夹,剪切至所 述第二应用程序。The host end Host cuts each file in the target object from the shared folder to the second application program respectively.
  11. 根据权利要求3所述的方法,其特征在于,所述第一应用程序为所述第二操作系统的应用程序,所述第二应用程序为所述第一操作系统的应用程序;所述第一操作系统为所述模拟器的主机端Host,所述第二操作系统为所述模拟器的客户端Guest;所述电子设备基于所述共享文件夹,将所述目标对象传输至所述第二应用程序,包括:The method according to claim 3, wherein the first application program is an application program of the second operating system, and the second application program is an application program of the first operating system; the second application program is an application program of the first operating system; An operating system is the host-end Host of the emulator, and the second operating system is the client-side Guest of the emulator; the electronic device transmits the target object to the second operating system based on the shared folder. Two applications, including:
    所述主机端Host构建所述第一操作系统侧的拖拽事件;The host-side Host constructs a drag event on the first operating system side;
    所述客户端Guest将所述目标对象拷贝至所述共享文件夹;The client Guest copies the target object to the shared folder;
    所述主机端Host从所述共享文件夹获取所述目标对象;The host-side Host obtains the target object from the shared folder;
    所述主机端Host基于所述第一操作系统侧的拖拽事件,将所述目标对象传输至所述第二应用程序,并结束所述第一操作系统侧的拖拽事件。The host end Host transmits the target object to the second application program based on the drag event on the first operating system side, and ends the drag event on the first operating system side.
  12. 根据权利要求9-11任一项所述的方法,其特征在于,在所述客户端Guest将所述目标对象拷贝至所述共享文件夹之前,所述方法还包括:The method according to any one of claims 9-11, wherein before the client Guest copies the target object to the shared folder, the method further comprises:
    所述客户端Guest基于管道通信通知所述主机端Host发生拖拽事件;The client-side Guest notifies the host-side Host of a drag event based on pipeline communication;
    在拖拽释放后,若拖拽释放窗口为所述第一操作系统应用程序的窗口,则所述主机端Host基于管道通信将传输类型通知给所述客户端Guest;所述传输类型用于表示所述目标对象在所述第一操作系统的应用程序与所述第二操作系统的应用程序之间传输;After dragging and releasing, if the dragging and releasing window is the window of the first operating system application program, then the host end Host notifies the client Guest of the transmission type based on pipeline communication; the transmission type is used to represent the target object is transferred between an application of the first operating system and an application of the second operating system;
    所述客户端Guest接收到所述传输类型后,基于管道通信通知所述主机端Guest传输所述目标对象;After the client Guest receives the transmission type, it notifies the host-side Guest to transmit the target object based on pipeline communication;
    在所述客户端Guest将所述目标对象拷贝至所述共享文件夹之后,所述方法还包括:After the client Guest copies the target object to the shared folder, the method further includes:
    所述客户端Guest将拷贝完成消息通知给所述主机端Host。The client Guest notifies the host Host of a copy completion message.
  13. 根据权利要求12所述的方法,其特征在于,所述拷贝完成消息包括拷贝完成的文件的文件名;或者,所述拷贝完成消息包括拷贝完成的文件的文件名信息和时间戳。The method according to claim 12, wherein the copy completion message includes the file name of the copied file; or, the copy completion message includes file name information and time stamp of the copied file.
  14. 根据权利要求12或13所述的方法,其特征在于,在所述客户端Guest基于管道通信通知所述主机端Host发生拖拽事件之后,所述方法还包括:The method according to claim 12 or 13, characterized in that, after the client Guest notifies the host host Host of a drag event based on pipeline communication, the method further comprises:
    所述客户端Guest基于管道通信将所述目标对象的文件名信息和拖拽图标通知给所述主机端Host;The client Guest notifies the host host Host of the file name information and the drag icon of the target object based on pipeline communication;
    所述主机端Host根据所述文件名信息构建所述第一操作系统侧的拖拽事件,并设置拖拽图标。The host-side Host constructs a drag event on the first operating system side according to the file name information, and sets a drag icon.
  15. 根据权利要求1或2所述的方法,其特征在于,所述第一应用程序和所述第二应用程序为所述第二操作系统的应用程序,所述目标对象包括一个或多个文件;所述电子设备将所述目标对象传输至所述第二应用程序,包括:The method according to claim 1 or 2, wherein the first application program and the second application program are applications of the second operating system, and the target object includes one or more files; The electronic device transmitting the target object to the second application program includes:
    所述电子设备基于管道通信,将所述目标对象传输至所述第二应用程序。The electronic device transmits the target object to the second application program based on pipe communication.
  16. 根据权利要求15所述的方法,其特征在于,所述电子设备基于管道通信,将所述目标对象传输至所述第二应用程序,包括:The method according to claim 15, wherein the electronic device transmits the target object to the second application program based on pipeline communication, comprising:
    所述客户端Guest基于管道通信通知所述主机端Host发生拖拽事件;The client-side Guest notifies the host-side Host of a drag event based on pipeline communication;
    所述主机端Host构建所述第一操作系统侧的拖拽事件;The host-side Host constructs a drag event on the first operating system side;
    在拖拽释放后,若所述主机端Host根据释放位置坐标确定拖拽释放窗口为所述第二操作系统其他应用程序的窗口,则基于管道通信将拖拽源窗口对应的所述第二操作系统侧窗口标识、拖拽释放位置、拽释放窗口对应的所述第二操作系统侧窗口标识和传输类型通知给所述客户端Guest;所述传输类型用于表示所述目标对象在所述第二操作系统的不同应用程序之间传输;After dragging and releasing, if the host side Host determines that the dragging and releasing window is the window of other application programs of the second operating system according to the coordinates of the releasing position, then the second operation corresponding to the dragging source window will be performed based on pipeline communication The system side window identifier, drag and drop position, the second operating system side window identifier and the transmission type corresponding to the drag and release window are notified to the client Guest; the transmission type is used to indicate that the target object is in the second operating system Transfer between different applications of the two operating systems;
    若所述客户端Guest根据所述拖拽释放位置和所述拽释放窗口对应的所述第二操作系统侧窗口标识确定所述释放位置允许拖拽,则基于管道通信通知所述主机端Host传输所述目标对象;If the client Guest determines that dragging is allowed at the release position according to the drag release position and the second operating system side window identifier corresponding to the drag release window, then the host-side Host is notified based on pipeline communication to transmit said target audience;
    所述客户端Guest获取所述目标对象,并根据所述目标对象构建所述第二操作系统侧拖拽事件,以将所述目标对象传输至所述第二应用程序。The client Guest obtains the target object, and constructs the drag event on the second operating system side according to the target object, so as to transmit the target object to the second application program.
  17. 根据权利要求16所述的方法,其特征在于,所述Guest侧存储有所述目标对象的文件名信息;The method according to claim 16, wherein the Guest side stores file name information of the target object;
    或者,所述客户端Guest基于管道通信通知所述主机端Host发生拖拽事件后,将所述目标对象的文件名信息通知给所述主机端Host;在拖拽释放后,所述主机端Host将所述文件名信息通知给所述客户端Guest;Or, after the client Guest notifies the host-side Host of the drag event based on pipeline communication, it notifies the host-side Host of the file name information of the target object; after dragging and dropping, the host-side Host Notifying the client Guest of the file name information;
    所述客户端Guest获取所述目标对象,包括:所述客户端Guest根据所述文件名信息,获取所述目标对象。The acquiring the target object by the client Guest includes: acquiring the target object by the client Guest according to the file name information.
  18. 根据权利要求15-17任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 15-17, wherein the method further comprises:
    当所述拖拽位置进入第三应用程序的窗口后,所述第三应用程序为所述第二操作系统的应用程序,且所述第三应用程序与所述第二应用程序相同或不同,所述电子设备根据所述第三应用程序是否允许拖入所述目标对象,显示允许拖拽标识或禁止拖拽标识。When the dragging position enters the window of the third application program, the third application program is an application program of the second operating system, and the third application program is the same as or different from the second application program, The electronic device displays a drag-and-drop permission mark or a drag-and-drop prohibition mark according to whether the third application program allows dragging of the target object.
  19. 根据权利要求1-18任一项所述的方法,其特征在于,在所述电子设备将将所述目标对象传输至所述第二应用程序之后,所述方法还包括:The method according to any one of claims 1-18, wherein after the electronic device transmits the target object to the second application program, the method further comprises:
    所述电子设备将所述目标对象保存到所述第二应用程序的窗口内拖拽释放位置对应的目录下;The electronic device saves the target object to a directory corresponding to the drag-and-drop position in the window of the second application program;
    或者,所述电子设备将所述目标对象通过所述第二应用程序发送给联系对象。Or, the electronic device sends the target object to a contact object through the second application program.
  20. 根据权利要求1-19任一项所述的方法,其特征在于,所述拖拽事件为用户使用鼠标进行的拖拽操作触发的事件,或者用户基于触摸屏的拖拽操作触发的事件。The method according to any one of claims 1-19, wherein the drag event is an event triggered by a user's drag operation using a mouse, or an event triggered by a user's drag operation based on a touch screen.
  21. 根据权利要求1或2所述的方法,其特征在于,所述目标对象为目标文本,所述电子设备将所述目标对象传输至所述第二应用程序,包括:The method according to claim 1 or 2, wherein the target object is target text, and the electronic device transmits the target object to the second application program, comprising:
    所述电子设备基于管道通信,将所述目标对象传输至所述第二应用程序。The electronic device transmits the target object to the second application program based on pipe communication.
  22. 根据权利要求21所述的方法,其特征在于,所述第一应用程序为所述第一操作系统的应用程序,所述第二应用程序为所述第二操作系统的应用程序,所述电子设备基于管道通信,将所述目标对象传输至所述第二应用程序,包括:The method according to claim 21, wherein the first application program is an application program of the first operating system, the second application program is an application program of the second operating system, and the electronic The device transmits the target object to the second application program based on pipeline communication, including:
    所述主机端Host基于管道通信通知所述客户端Guest发生拖拽事件;The host-side Host notifies the client-side Guest of a drag event based on pipeline communication;
    所述主机端Host在拖拽释放后,基于管道通信将拖拽释放位置坐标和拽释放窗口对应的所述第二操作系统侧窗口标识、传输类型和所述目标对象的文本内容通知给所述客户端Guest;所述传输类型用于表示所述目标对象在所述第一操作系统的应用程序 与所述第二操作系统的应用程序之间传输;After the drag and drop is released, the host-side Host notifies the drag release location coordinates and the second operating system side window identifier corresponding to the drag release window, the transmission type, and the text content of the target object to the Client Guest; the transmission type is used to indicate that the target object is transmitted between the application program of the first operating system and the application program of the second operating system;
    若所述客户端Guest根据所述拖拽释放位置坐标和所述拽释放窗口对应的所述第二操作系统侧窗口标识确定所述释放位置允许拖拽,则基于所述传输类型,根据所述文本内容构建所述第二操作系统侧拖拽事件,以将所述目标对象传输至所述第二应用程序。If the client Guest determines that dragging is allowed at the release position according to the coordinates of the drag release position and the second operating system side window identifier corresponding to the drag release window, based on the transmission type, according to the The text content constructs the drag event on the second operating system side, so as to transmit the target object to the second application program.
  23. 根据权利要求21所述的方法,其特征在于,所述第一应用程序为所述第二操作系统的应用程序,所述第二应用程序为所述第一操作系统的应用程序,所述电子设备基于管道通信,将所述目标对象传输至所述第二应用程序,包括:The method according to claim 21, wherein the first application program is an application program of the second operating system, the second application program is an application program of the first operating system, and the electronic The device transmits the target object to the second application program based on pipeline communication, including:
    所述客户端Guest基于管道通信通知所述主机端Host发生拖拽事件,并将所述目标对象的文本内容通知给所述主机端Host;The client Guest notifies the host host of a drag event based on pipeline communication, and notifies the host host of the text content of the target object;
    所述主机端Host构建所述第一操作系统侧拖拽事件;The host-side Host constructs a drag-and-drop event on the first operating system side;
    在拖拽释放后,若所述主机端Host根据释放位置坐标确定拖拽释放窗口为所述第一操作系统应用程序的窗口,则基于管道通信将传输类型通知给所述客户端Guest;所述传输类型用于表示所述目标对象在所述第一操作系统的应用程序与所述第二操作系统的应用程序之间传输;After dragging and releasing, if the host terminal Host determines that the dragging and releasing window is the window of the first operating system application program according to the release position coordinates, then the transmission type is notified to the client Guest based on the pipeline communication; The transfer type is used to indicate that the target object is transferred between the application program of the first operating system and the application program of the second operating system;
    若拖拽释放窗口为所述第一操作系统的资源管理器窗口,则所述主机端Host基于所述传输类型,取消所述第一操作系统侧拖拽事件,将所述目标对象剪切至所述第二应用程序;If the drag release window is the resource manager window of the first operating system, then the host-side Host cancels the drag event on the first operating system side based on the transmission type, and clips the target object to said second application;
    若拖拽释放窗口不是所述第一操作系统的资源管理器窗口,则所述主机端Host基于所述传输类型,通过所述第一操作系统侧拖拽事件将所述目标对象传输至所述第二应用程序,并结束所述第一操作系统侧拖拽事件。If the drag release window is not the resource manager window of the first operating system, then the host-side Host transfers the target object to the The second application, and ends the drag event on the first OS side.
  24. 根据权利要求21所述的方法,其特征在于,所述第一应用程序和所述第二应用程序为所述第二操作系统的不同应用程序,所述电子设备基于管道通信,将所述目标对象传输至所述第二应用程序,包括:The method according to claim 21, wherein the first application program and the second application program are different application programs of the second operating system, and the electronic device communicates with the target object transfer to said second application, comprising:
    所述客户端Guest基于管道通信通知所述主机端Host发生拖拽事件,并将所述目标对象的文本内容通知给所述主机端Host;The client Guest notifies the host host of a drag event based on pipeline communication, and notifies the host host of the text content of the target object;
    所述主机端Host构建所述第一操作系统侧的拖拽事件;The host-side Host constructs a drag event on the first operating system side;
    在拖拽释放后,若所述主机端Host根据释放位置坐标确定拖拽释放窗口为所述第二操作系统其他应用程序的窗口,则基于管道通信将拖拽源窗口对应的所述第二操作系统侧窗口标识、拖拽释放位置、拽释放窗口对应的所述第二操作系统侧窗口标识、传输类型和所述文本内容通知给所述客户端Guest;所述传输类型用于表示所述目标对象在所述第二操作系统的不同应用程序之间传输;After dragging and releasing, if the host side Host determines that the dragging and releasing window is the window of other application programs of the second operating system according to the coordinates of the releasing position, then the second operation corresponding to the dragging source window will be performed based on pipeline communication System side window identification, drag and drop position, the second operating system side window identification corresponding to the drag and release window, transmission type and the text content are notified to the client Guest; the transmission type is used to represent the target objects are transferred between different applications of the second operating system;
    若所述客户端Guest根据所述拖拽释放位置和所述拽释放窗口对应的所述第二操作系统侧窗口标识确定所述释放位置允许拖拽,则基于所述传输类型获取所述目标对象,根据所述目标对象构建所述第二操作系统侧拖拽事件,以将所述目标对象传输至所述第二应用程序。If the client Guest determines that dragging is allowed at the release position according to the drag release position and the second operating system side window identifier corresponding to the drag release window, then acquire the target object based on the transmission type Constructing a drag event on the second operating system side according to the target object, so as to transmit the target object to the second application program.
  25. 根据权利要求21-24任一项所述的方法,其特征在于,所述Guest侧存储有所述目标对象的文本内容;The method according to any one of claims 21-24, wherein the Guest side stores the text content of the target object;
    或者,所述客户端Guest基于管道通信通知所述主机端Host发生拖拽事件后,将 所述目标对象的文本内容通知给所述主机端Host;在拖拽释放后,所述主机端Host将所述文本内容通知给所述客户端Guest;Or, after the client Guest notifies the host host of the drag event based on pipeline communication, the text content of the target object is notified to the host host; after the drag is released, the host host will The text content is notified to the client Guest;
    所述客户端Guest获取所述目标对象,包括:所述客户端Guest获取所述文本内容。The acquiring the target object by the client Guest includes: acquiring the text content by the client Guest.
  26. 一种目标对象的传输方法,应用于电子设备,所述电子设备运行有第一操作系统,所述第一操作系统上运行有所述第一操作系统的应用程序,且所述第一操作系统上基于模拟器运行有第二操作系统的应用程序,其特征在于,所述方法包括:A method for transmitting a target object, applied to an electronic device, the electronic device runs a first operating system, an application program of the first operating system runs on the first operating system, and the first operating system An application program based on a simulator running a second operating system, wherein the method includes:
    所述电子设备显示第一界面,所述第一界面包括第一应用程序的窗口和第二应用程序的窗口,所述第一应用程序的窗口中包括目标对象,所述第二应用程序的窗口中不包括所述目标对象;其中,所述第一应用程序和所述第二应用程序为不同操作系统中的应用程序,所述目标对象包括一个或多个文件;The electronic device displays a first interface, the first interface includes a window of a first application program and a window of a second application program, the window of the first application program includes a target object, and the window of the second application program does not include the target object; wherein, the first application program and the second application program are applications in different operating systems, and the target object includes one or more files;
    所述电子设备响应于针对所述第一应用程序的窗口中所述目标对象的目标事件,所述目标事件包括复制事件或剪切事件,以及所述第二应用程序的窗口中的粘贴事件,将所述目标对象传输至所述第二应用程序。the electronic device is responsive to a target event for the target object in the window of the first application, the target event comprising a copy event or a cut event, and a paste event in the window of the second application, The target object is transferred to the second application.
  27. 根据权利要求26所述的方法,其特征在于,所述电子设备包括所述第一操作系统和所述第二操作系统的共享剪贴板和共享文件夹;所述电子设备响应于针对所述第一应用程序的窗口中所述目标对象的目标事件,以及所述第二应用程序的窗口中的粘贴事件,将所述目标对象传输至所述第二应用程序,包括:The method according to claim 26, wherein the electronic device includes a shared clipboard and a shared folder of the first operating system and the second operating system; the electronic device responds to the A target event of the target object in the window of an application program, and a paste event in the window of the second application program, and transferring the target object to the second application program includes:
    所述电子设备响应于针对所述第一应用程序的窗口中所述目标对象的目标事件,以及所述第二应用程序的窗口中的粘贴事件,基于所述共享剪贴板将所述目标对象传输至所述第二应用程序。The electronic device transmits the target object based on the shared clipboard in response to a target event for the target object in the window of the first application program and a paste event in the window of the second application program to the second application.
  28. 根据权利要求27所述的方法,其特征在于,所述第一应用程序为所述第一操作系统的应用程序,所述第二应用程序为所述第二操作系统的程序,所述第一操作系统为所述模拟器的主机端Host,所述第二操作系统为所述模拟器的客户端Guest;所述电子设备响应于针对所述第一应用程序的窗口中所述目标对象的目标事件,以及所述第二应用程序的窗口中的粘贴事件,将所述目标对象传输至所述第二应用程序,包括:The method according to claim 27, wherein the first application program is an application program of the first operating system, the second application program is a program of the second operating system, and the first The operating system is the host end Host of the emulator, and the second operating system is the client Guest of the emulator; the electronic device responds to the target object in the window of the first application program The event, and the paste event in the window of the second application program, transfers the target object to the second application program, including:
    所述主机端Host响应于针对所述第一应用程序的窗口中所述目标对象的目标事件,将所述目标对象的路径信息存放到所述第一操作系统的剪贴板;The host end Host stores the path information of the target object in the clipboard of the first operating system in response to the target event for the target object in the window of the first application program;
    所述主机端Host将所述第一操作系统的剪贴板中的所述路径信息同步到所述共享剪贴板;The host-side Host synchronizes the path information in the clipboard of the first operating system to the shared clipboard;
    所述客户端Guest响应于所述第二应用程序的窗口中的粘贴事件,基于管道通信通知所述主机端Host传输所述目标对象;The client Guest notifies the host-side Host to transmit the target object based on pipeline communication in response to the pasting event in the window of the second application program;
    所述主机端Host将所述共享剪贴板中的所述路径信息对应的所述目标对象拷贝到共享文件夹,并将拷贝完成消息通知给所述客户端Guest;The host end Host copies the target object corresponding to the path information in the shared clipboard to a shared folder, and notifies the client Guest of a copy completion message;
    所述客户端Guest接收到所述拷贝完成消息后,将所述目标对象从所述共享文件夹复制到所述第二应用程序。After the client Guest receives the copy completion message, it copies the target object from the shared folder to the second application program.
  29. 根据权利要求28所述的方法,其特征在于,所述客户端Guest基于管道通信通知所述主机端Host传输所述目标对象,包括:The method according to claim 28, wherein the client Guest notifies the host-side Host to transmit the target object based on pipeline communication, comprising:
    所述客户端Guest对所述第二应用程序对应的待粘贴目的路径,以及所述共享剪贴板中的所述路径信息对应的所述目标对象进行预检查,在预检查通过后基于管道通信通知所述主机端Host传输所述目标对象;The client Guest conducts a pre-check on the destination path to be pasted corresponding to the second application program and the target object corresponding to the path information in the shared clipboard, and notifies based on pipeline communication after the pre-check is passed The host end Host transmits the target object;
    所述主机端Host将所述共享剪贴板中的所述路径信息对应的所述目标对象拷贝到共享文件夹,包括:The host-side Host copies the target object corresponding to the path information in the shared clipboard to a shared folder, including:
    所述主机端Host确定源目标对象是否存在,若存在则将所述共享剪贴板中的所述路径信息对应的所述目标对象拷贝到共享文件夹。The host-side Host determines whether the source target object exists, and if so, copies the target object corresponding to the path information in the shared clipboard to a shared folder.
  30. 根据权利要求27所述的方法,其特征在于,所述第一应用程序为所述第二操作系统的应用程序,所述第二应用程序为所述第一操作系统的程序,所述第一操作系统为所述模拟器的主机端Host,所述第二操作系统为所述模拟器的客户端Guest;所述电子设备响应于针对所述第一应用程序的窗口中所述目标对象的目标事件,以及所述第二应用程序的窗口中的粘贴事件,将所述目标对象传输至所述第二应用程序,包括:The method according to claim 27, wherein the first application program is an application program of the second operating system, the second application program is a program of the first operating system, and the first The operating system is the host end Host of the emulator, and the second operating system is the client Guest of the emulator; the electronic device responds to the target object in the window of the first application program The event, and the paste event in the window of the second application program, transfers the target object to the second application program, including:
    所述客户端Guest响应于针对所述第一应用程序的窗口中所述目标对象的目标事件,将所述目标对象的路径信息存放到所述第二操作系统的剪贴板;The client Guest stores the path information of the target object in the clipboard of the second operating system in response to the target event of the target object in the window of the first application program;
    所述客户端Guest将所述第二操作系统的剪贴板中的所述路径信息同步到所述共享剪贴板;The client Guest synchronizes the path information in the clipboard of the second operating system to the shared clipboard;
    所述主机端Host响应于所述第二应用程序的窗口中的粘贴操作,基于管道通信通知所述客户端Guest传输所述目标对象;In response to the pasting operation in the window of the second application program, the host host notifies the client Guest to transmit the target object based on pipeline communication;
    所述客户端Guest将所述共享剪贴板中的所述路径信息对应的所述目标对象拷贝到共享文件夹,并将拷贝完成消息通知给所述主机端Host;The client Guest copies the target object corresponding to the path information in the shared clipboard to a shared folder, and notifies the host host of a copy completion message;
    所述主机端Host接收到所述拷贝完成消息后,将所述目标对象从所述共享文件夹复制到所述第二应用程序。After the host-side Host receives the copy completion message, it copies the target object from the shared folder to the second application program.
  31. 根据权利要求30所述的方法,其特征在于,所述主机端Host基于管道通信通知所述客户端Guest传输所述目标对象,包括:The method according to claim 30, wherein the host-side Host notifies the client-side Guest to transmit the target object based on pipeline communication, comprising:
    所述主机端Host对所述第二应用程序对应的待粘贴目的路径,以及所述共享剪贴板中的所述路径信息对应的所述目标对象进行预检查,在预检查通过后基于管道通信通知所述客户端Guest传输所述目标对象;The host-side Host pre-checks the target path to be pasted corresponding to the second application program and the target object corresponding to the path information in the shared clipboard, and notifies based on the pipeline communication after the pre-check is passed The client Guest transmits the target object;
    所述客户端Guest将所述共享剪贴板中的所述路径信息对应的所述目标对象拷贝到共享文件夹,包括:The client Guest copies the target object corresponding to the path information in the shared clipboard to a shared folder, including:
    所述客户端Guest确定源目标对象是否存在,若存在则将所述共享剪贴板中的所述路径信息对应的所述目标对象拷贝到共享文件夹。The client Guest determines whether the source target object exists, and if it exists, copies the target object corresponding to the path information in the shared clipboard to a shared folder.
  32. 根据权利要求26-31任一项所述的方法,其特征在于,在所述电子设备将将所述目标对象传输至所述第二应用程序之后,所述方法还包括:The method according to any one of claims 26-31, wherein after the electronic device transmits the target object to the second application program, the method further comprises:
    所述电子设备将所述目标对象保存到所述第二应用程序的窗口内拖拽释放位置对应的目录下;The electronic device saves the target object to a directory corresponding to the drag-and-drop position in the window of the second application program;
    或者,所述电子设备将所述目标对象通过所述第二应用程序发送给联系对象。Or, the electronic device sends the target object to a contact object through the second application program.
  33. 根据权利要求26-32任一项所述的方法,其特征在于,所述目标事件为复制事件,所述复制事件由以下任意操作触发:用户针对所述目标对象使用键盘快捷键的复 制操作,用户针对所述目标对象使用鼠标右键选择复制的操作,用户针对所述目标对象长按鼠标左键后选择复制的操作,或用户基于触摸屏长按所述目标对象后选择复制的操作;The method according to any one of claims 26-32, wherein the target event is a copy event, and the copy event is triggered by any of the following operations: the user uses a keyboard shortcut to copy the target object, The user uses the right mouse button to select the copy operation for the target object, the user selects the copy operation after long pressing the left mouse button for the target object, or the user selects the copy operation after long pressing the target object based on the touch screen;
    所述粘贴事件由以下任意操作触发:用户针对所述目标对象使用键盘快捷键的粘贴操作,用户针对所述目标对象使用鼠标右键选择粘贴的操作,用户针对所述目标对象长按鼠标左键后选择粘贴的操作,或用户基于触摸屏长按所述目标对象后选择粘贴的操作。The paste event is triggered by any of the following operations: the user uses a keyboard shortcut to paste the target object, the user uses the right mouse button to select the paste operation for the target object, and the user presses the left mouse button for the target object. An operation of selecting paste, or an operation of selecting paste after the user presses and holds the target object based on the touch screen.
  34. 根据权利要求26-32任一项所述的方法,其特征在于,所述目标事件为剪切事件,在所述电子设备将所述目标对象传输至所述第二应用程序之后,所述方法还包括:The method according to any one of claims 26-32, wherein the target event is a cut event, and after the electronic device transmits the target object to the second application program, the method Also includes:
    所述电子设备删除所述第一应用程序中的所述目标对象。The electronic device deletes the target object in the first application program.
  35. 根据权利要求1-34任一项所述的方法,其特征在于,所述共享文件夹为Virtio-9p共享文件夹,所述管道通信为Qemu Pipe。The method according to any one of claims 1-34, wherein the shared folder is a Virtio-9p shared folder, and the pipeline communication is Qemu Pipe.
  36. 根据权利要求1-35任一项所述的方法,其特征在于,所述第一操作系统为Windows操作系统,所述第二操作系统为安卓Android操作系统。The method according to any one of claims 1-35, wherein the first operating system is a Windows operating system, and the second operating system is an Android operating system.
  37. 一种电子设备,其特征在于,包括:An electronic device, characterized in that it comprises:
    屏幕,用于显示界面;a screen for displaying an interface;
    一个或多个处理器;one or more processors;
    存储器;memory;
    以及一个或多个计算机程序,其中所述一个或多个计算机程序被存储在所述存储器中,所述一个或多个计算机程序包括指令,当所述指令被所述电子设备执行时,使得所述电子设备执行如权利要求1-36中任一项所述的目标对象的传输方法。and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions which, when executed by the electronic device, cause the The electronic device executes the target object transmission method according to any one of claims 1-36.
  38. 一种计算机可读存储介质,其特征在于,包括计算机指令,当所述计算机指令在计算机上运行时,使得所述计算机执行如权利要求1-36中任一项所述的目标对象的传输方法。A computer-readable storage medium, characterized in that it includes computer instructions, and when the computer instructions are run on a computer, the computer is made to execute the target object transmission method according to any one of claims 1-36 .
PCT/CN2022/106970 2021-07-30 2022-07-21 Method for cross-system transmission of target object, and device WO2023005784A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110871045.6 2021-07-30
CN202110871045.6A CN115700453A (en) 2021-07-30 2021-07-30 Method and equipment for transmitting target object across systems

Publications (1)

Publication Number Publication Date
WO2023005784A1 true WO2023005784A1 (en) 2023-02-02

Family

ID=85087515

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/106970 WO2023005784A1 (en) 2021-07-30 2022-07-21 Method for cross-system transmission of target object, and device

Country Status (2)

Country Link
CN (1) CN115700453A (en)
WO (1) WO2023005784A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105700923A (en) * 2016-01-08 2016-06-22 深圳市创想天空科技股份有限公司 Method and system for installing application program
WO2018112775A1 (en) * 2016-12-21 2018-06-28 深圳前海达闼云端智能科技有限公司 Method for operating another operating system, apparatus and electronic device
US20190302981A1 (en) * 2018-04-03 2019-10-03 Palantir Technologies Inc. Graphical user interface system
CN112068897A (en) * 2020-08-16 2020-12-11 北京麟卓信息科技有限公司 Android application file loading method and device based on mouse key simulation

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105700923A (en) * 2016-01-08 2016-06-22 深圳市创想天空科技股份有限公司 Method and system for installing application program
WO2018112775A1 (en) * 2016-12-21 2018-06-28 深圳前海达闼云端智能科技有限公司 Method for operating another operating system, apparatus and electronic device
US20190302981A1 (en) * 2018-04-03 2019-10-03 Palantir Technologies Inc. Graphical user interface system
CN112068897A (en) * 2020-08-16 2020-12-11 北京麟卓信息科技有限公司 Android application file loading method and device based on mouse key simulation

Also Published As

Publication number Publication date
CN115700453A (en) 2023-02-07

Similar Documents

Publication Publication Date Title
US10846262B2 (en) Data migration to a cloud computing system
CN110378593B (en) Communication status for application of compliance policy updates
US7783985B2 (en) Systems and methods for transferring data between computing devices
US10129264B2 (en) Method and apparatus for implementing document sharing between user groups
US10108787B2 (en) View-based expiration of shared content
US9537952B1 (en) Apparent cloud access for hosted content items
CN111049935B (en) System for remotely controlling electronic equipment and electronic equipment thereof
JP2016529599A (en) Content clipboard synchronization
MX2013003427A (en) Cross-environment redirection.
JP2010218049A (en) Information processing apparatus, information processing method, and program
JP5346405B2 (en) Network system
US20180213025A1 (en) Transparent deferred spooling store and forward based on standard network system and client interface
US11435901B1 (en) Backup services for distributed file systems in cloud computing environments
US20160344819A1 (en) Remote document signing
US20130238673A1 (en) Information processing apparatus, image file creation method, and storage medium
CN113010498B (en) Data synchronization method, device, computer equipment and storage medium
CN109729121B (en) Cloud storage system and method for realizing custom data processing in cloud storage system
WO2020119710A1 (en) Method, device, and system for disk redirection
WO2023005784A1 (en) Method for cross-system transmission of target object, and device
JP4267186B2 (en) Communication of information content between client and host
US20180337988A1 (en) Methods for working collaboratively and systems using the same
JP6205013B1 (en) Application usage system
CN109597537B (en) File synchronization method, device and equipment
US20210374106A1 (en) Using drag-and-drop to open local files remotely
KR20200084129A (en) Network connection system through osd area

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22848389

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE