File processing method and device, computer equipment and storage medium
By obtaining the information of the starting position of a file when dragging it and automatically performing processing operations, the problem in the prior art that the file needs to be dragged to the drag and drop receiving window to obtain information is solved, and more efficient file processing is achieved.
Patent Information
- Application Number
- CN202410464213.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-17
- Publication Date
- 2025-10-24
AI Technical Summary
In the prior art, in the operating system, the user needs to first fix the drag and drop receiving window on the desktop, and then drag the file in the drag path to the drag and drop receiving window to obtain the file information, which leads to complicated interaction steps and low file processing efficiency.
By covering the file information acquisition window at its starting position when dragging the file, the file information is obtained, and the file processing operation is automatically performed when dragging to the corresponding interface interactive element, the interaction steps are simplified and the file processing efficiency is improved.
This simplifies the process of users needing to pin the drag-and-drop receiving window on the desktop and manually open it. Instead, it automatically performs file processing operations when dragging files, improving file processing efficiency and reducing obstruction of other desktop elements.
Smart Images

Figure CN120832064A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of operating systems, and in particular to a file processing method and device, a computer device, and a storage medium. BACKGROUND
[0002] In the current PC operating system, user drag operation has become a common interaction method, which is usually used to move files. In related technologies, the user needs to first fix the drag-and-drop receiving window on the desktop, manually open the drag-and-drop receiving window, and then release the file after dragging it into the drag-and-drop receiving window, so as to realize file transfer. Because the user needs to first fix the drag-and-drop receiving window on the desktop and manually open the drag-and-drop receiving window, the interaction steps are complex and the file processing efficiency is low. SUMMARY
[0003] Therefore, it is necessary to provide a file processing method and device, a computer device, a storage medium, and a computer program product for improving file processing efficiency.
[0004] In a first aspect, the present application provides a file processing method, which comprises:
[0005] In response to a first interaction operation, at least one interface interaction element is displayed, the interface interaction element serving as an operation entrance of a file processing operation, the first interaction operation being used to drag a file, the interface interaction element corresponding to the file processing operation, the file processing operation matching a file type of the dragged file;
[0006] Based on a file information acquisition window, file information of the dragged file is acquired, the file information acquisition window covering a starting position of the dragged file;
[0007] In response to a second interaction operation, the dragged file is processed based on the file information and the file processing operation corresponding to the interface interaction element, the second interaction operation being used to stop dragging at the interface interaction element.
[0008] In one of the embodiments, the first interaction operation is triggered by dragging a file in a resource manager or a web element in a web page.
[0009] In one of the embodiments, the type of the file processing operation includes at least one of a file transfer operation or a file opening operation.
[0010] In one of the embodiments, after the file information of the dragged file is acquired based on the file information acquisition window, the method further comprises:
[0011] In the case where the file information acquisition window is newly created when the first interaction operation is triggered, the file information acquisition window is destroyed.
[0012] In a case where the file information obtaining window has been created when the first interaction operation is triggered, and the file information obtaining window has been set as valid before the file information of the dragged file is obtained, the file information obtaining window is set as invalid.
[0013] In one of the embodiments, the file processing operation is a file transfer operation, the file information includes a file original path, and the interface interaction element corresponds to a file target path; based on the file information and the file processing operation corresponding to the interface interaction element, the dragged file is processed, including:
[0014] The dragged file is transferred from the file original path to the file target path corresponding to the interface interaction element.
[0015] In one of the embodiments, the first interaction operation is triggered by selecting a file by a mouse and dragging, and the desktop operating system is a windows system; the monitoring manner of the first interaction operation includes:
[0016] In a case where the trigger state of the mouse button is a pressed state and there is a display window for displaying the file dragging position, the first interaction operation is triggered.
[0017] In one of the embodiments, the determination manner of whether the display window for displaying the file dragging position exists includes:
[0018] The existing windows are enumerated to obtain the window information of the existing windows, and in a case where the window information of the display window exists in the window information of the existing windows, it is determined that the display window exists; or a function for creating the display window or a function for performing the drag and drop is intercepted, and it is determined that the display window exists based on the intercepted message.
[0019] In one of the embodiments, the first interaction operation is triggered by selecting a file by a mouse and dragging, the desktop operating system is a windows system, the file information obtaining window has been registered as a drag and drop target through a RegisterDragDrop function, and an IDropTarget interface has been defined as a response class for taking over the drag and drop through the RegisterDragDrop function; based on the file information obtaining window, the file information of the dragged file is obtained, including:
[0020] In a case where the mouse enters the file information obtaining window, the file information of the dragged file is obtained by calling a DragEnter function in the IDropTarget interface.
[0021] In one of the embodiments, the first interaction operation is triggered by selecting and dragging a file by a mouse, and the desktop operating system is a Linux system; the monitoring manner of the first interaction operation comprises:
[0022] In the case that the XSelectInput function receives a CreateNotify event of a root window and the XISelectEvents function receives a global mouse click event, the first interaction operation is triggered;
[0023] The XSelectInput function has declared to receive a CreateNotify event of a root window, and the XISelectEvents function has declared to receive a global mouse click event.
[0024] In one of the embodiments, the first interaction operation is triggered by selecting and dragging a file by a mouse, the desktop operating system is a Linux system, and a file information obtaining window has been added with an XdndAware attribute as a drag-and-drop target; based on the file information obtaining window, file information of the dragged file is obtained, comprising:
[0025] In the case that a mouse enters the file information obtaining window, based on information transmitted between the file information obtaining window and a source window where the dragged file is located, file information of the dragged file is obtained.
[0026] In a second aspect, the present application provides a file processing device, comprising:
[0027] A display module is configured to display at least one interface interaction element as an operation entrance of a file processing operation in response to a first interaction operation, the first interaction operation is used for dragging a file, the interface interaction element corresponds to the file processing operation, and the file processing operation matches a file type of the dragged file;
[0028] An obtaining module is configured to obtain file information of the dragged file based on a file information obtaining window, and the file information obtaining window covers a starting position where the dragged file is located;
[0029] A processing module is configured to process the dragged file based on the file information and the file processing operation corresponding to the interface interaction element in response to a second interaction operation, and the second interaction operation is used for stopping dragging at the interface interaction element.
[0030] In a third aspect, the present application further provides a computer device, comprising a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0031] In response to the first interaction operation, at least one interface interaction element is displayed, the interface interaction element serving as an operation portal of a file processing operation, the first interaction operation being used for dragging a file, the interface interaction element corresponding to the file processing operation, and the file processing operation matching a file type of the dragged file;
[0032] Based on a file information acquisition window, file information of the dragged file is acquired, and the file information acquisition window covers a starting position of the dragged file;
[0033] In response to a second interaction operation, the dragged file is processed based on the file information and the file processing operation corresponding to the interface interaction element, and the second interaction operation is used for stopping dragging at the interface interaction element.
[0034] In the fourth aspect, the present application further provides a computer readable storage medium, which has a computer program stored thereon, and the computer program is executed by a processor to implement the following steps:
[0035] In response to the first interaction operation, at least one interface interaction element is displayed, the interface interaction element serving as an operation portal of a file processing operation, the first interaction operation being used for dragging a file, the interface interaction element corresponding to the file processing operation, and the file processing operation matching a file type of the dragged file;
[0036] Based on a file information acquisition window, file information of the dragged file is acquired, and the file information acquisition window covers a starting position of the dragged file;
[0037] In response to a second interaction operation, the dragged file is processed based on the file information and the file processing operation corresponding to the interface interaction element, and the second interaction operation is used for stopping dragging at the interface interaction element.
[0038] In the fifth aspect, the present application further provides a computer program product. The computer program product comprises a computer program, and the computer program is executed by a processor to implement the following steps:
[0039] In response to the first interaction operation, at least one interface interaction element is displayed, the interface interaction element serving as an operation portal of a file processing operation, the first interaction operation being used for dragging a file, the interface interaction element corresponding to the file processing operation, and the file processing operation matching a file type of the dragged file;
[0040] Based on a file information acquisition window, file information of the dragged file is acquired, and the file information acquisition window covers a starting position of the dragged file;
[0041] In response to a second interaction operation, the dragged file is processed based on the file information and the file processing operation corresponding to the interface interaction element, and the second interaction operation is used for stopping dragging at the interface interaction element.
[0042] The file processing method, device, computer device, storage medium and computer program product can display at least one interface interactive element as an operation entrance in response to a first interactive operation. When a file is stopped from being dragged at the interface interactive element, the dragged file can be processed based on file information obtained through a file information obtaining window and a file processing operation corresponding to the interface interactive element, so that the user no longer needs to fix a drag-and-drop receiving window on the desktop and manually open the drag-and-drop receiving window when saving a file, thereby simplifying the interactive steps and improving the file processing efficiency.
[0043] In addition, the interface interactive element is displayed only when the first interactive operation is triggered, so that other desktop elements are not blocked. The file information can be obtained based on a file information obtaining window covering the starting position of the dragged file, so that the file information is obtained at the first time when the file is dragged, which provides a basis for automatically performing the file processing operation when the file is dragged to the interface interactive element. At the same time, the file information obtaining window is set to be invisible, so that the file information obtaining window is not perceived by the user and does not interfere with the user operation. BRIEF DESCRIPTION OF DRAWINGS
[0044] Figure 1 A flowchart of a file processing method in an embodiment;
[0045] Figure 2 A schematic diagram of a desktop file dragging process in an embodiment;
[0046] Figure 3 A schematic diagram of a desktop file dragging process in another embodiment;
[0047] Figure 4 A schematic diagram of a web page element dragging process in an embodiment;
[0048] Figure 5 A flowchart of a process of monitoring a file dragging operation in an embodiment;
[0049] Figure 6 A flowchart of a process of obtaining file information of a dragged file in an embodiment;
[0050] Figure 7 A flowchart of a process of monitoring a file dragging operation in an embodiment;
[0051] Figure 8 A flowchart of a process of obtaining file information of a dragged file in an embodiment;
[0052] Figure 9Fig. 1 is a flowchart of a file processing method according to an embodiment of the present application;
[0053] Figure 10 Fig. 2 is a structural block diagram of a file processing device according to an embodiment of the present application;
[0054] Figure 11 Fig. 3 is an internal structural diagram of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not intended to limit the present application.
[0056] It can be understood that the terms "first", "second", and the like used in the present application can be used herein to describe various technical terms, but unless specifically stated, these technical terms are not limited by these terms. These terms are only used to distinguish one technical term from another. For example, without departing from the scope of the present application, the third preset threshold and the fourth preset threshold can be the same or different.
[0057] In the current PC operating system, user drag operation has become a common interaction method, which is usually used to move files. In the related art, the user needs to fix the drag-and-drop receiving window on the desktop, manually open the drag-and-drop receiving window, and then drag the file moved to the desktop into the drag-and-drop receiving window and release it, so as to realize file transfer. Because the user needs to fix the drag-and-drop receiving window on the desktop and manually open the drag-and-drop receiving window, the operation process is complex and the file processing efficiency is low. In addition to file transfer, it can be foreseen that other types of file processing also have the problem of low file processing efficiency. For example, converting a pdf format file to a doc format file requires opening a pdf application, selecting the format conversion function in the application, selecting the pdf file to be converted, and finally performing format conversion.
[0058] As can be seen, the current desktop operating system or desktop assistant application usually lacks the perception ability of user drag operation, and cannot provide corresponding optional operations such as sending files, reading file content, sharing files, etc. according to the type of file being dragged. It can be foreseen that if the user's drag operation can be perceived and targeted optional operations can be provided, the user's operation process can be simplified and the file processing efficiency can be improved.
[0059] To meet the above requirements, an embodiment of the present application provides a file processing method. The main idea of the method is that when a user drags a file, the user can obtain file information of the dragged file based on a file information obtaining window overlaid by a position where a drag pointer is located when the file is dragged, and when the user drags the file to an operation entry corresponding to a file processing operation, the user can directly execute the file processing operation on the file based on the file information. Since it is no longer necessary to fix a drag-and-drop receiving window on a desktop, manually open the drag-and-drop receiving window, and then drag the file to the drag-and-drop receiving window, but directly drag the file with display of an operation entry, and drag the file to the operation entry to automatically execute a corresponding file processing operation, the method can simplify an interaction step and improve file processing efficiency.
[0060] The method can be applied to a computer device provided with a desktop operating system. The computer device can be a mobile phone, a tablet computer, or a personal computer, and the present application is not limited in this regard. Based on the above description, referring to Figure 1 , a file processing method is provided, and the execution subject of the method is taken as an example of a computer device provided with a desktop operating system. The method provided by the present application includes the following steps:
[0061] 102. In response to a first interaction operation, at least one interface interaction element is displayed, the interface interaction element serving as an operation entry of a file processing operation, the first interaction operation being used to drag a file, the interface interaction element corresponding to a file processing operation, and the file processing operation matching a file type of the dragged file.
[0062] The specific operation type of the first interaction operation can be related to an input device. For example, if the input device is a mouse, the first interaction operation can be to click a left mouse button (or a right mouse button) to select a file, and to drag the file by moving the mouse. If the input device is a touchpad, the first interaction operation can be to click the touchpad to select a file, and to drag the file by sliding on the touchpad. Of course, in addition to the above input devices and corresponding drag operation manners, other input devices and drag operation manners can be used to trigger the first interaction operation, and the present application is not limited in this regard.
[0063] The interface interaction elements may be controls such as icons and buttons, etc., which are not specifically limited in the embodiments of the present application. The display position of the interface interaction elements may be in the middle of the screen or in the upper middle of the screen, which are not specifically limited in the embodiments of the present application. The interface elements correspond to file processing operations, such as converting the format of a file or transferring a file. It is understandable that there may be multiple file processing operations, and in actual implementation, which file processing operation corresponds to which interface interaction element can be displayed, which can be determined based on the file type of the dragged file. That is, some file processing operations may not be suitable for some file types, so the interface interaction elements that match the file type of the dragged file can be displayed for the user to select a file processing operation that is valid for the file.
[0064] 104. Obtain file information of the dragged file based on the file information acquisition window; the file information acquisition window is covered with the starting position of the dragged file.
[0065] Current desktop operating systems, whether Windows or Linux, typically feature a set of file dragging interface functions or protocols. Regardless of the mechanism used by the desktop operating system to implement file dragging, the user must drag a file from the desktop into a drag-and-drop receiving window. Only through the window can the desktop operating system detect the drag operation and obtain the file information of the dragged file for file transfer. This means that in related art, the internal mechanisms of the desktop operating system can complicate the user's file transfer process.
[0066] The reason for performing this step is to eliminate the need for users to follow the relevant technical procedures in order to obtain file information. In other words, the desktop operating system no longer needs to detect the drag operation and obtain file information after the user drags the file into the drag-and-drop receiving window. This step primarily allows the desktop operating system to detect the drag operation and directly obtain the file information of the dragged file through the file information acquisition window when the user begins dragging the file. It can be seen that the file information acquisition window is not the actual drag receiving window for the file, but rather a "deceptive drag receiving window" used to obtain file information.
[0067] Here, the file information acquisition window "covering the starting position of the dragged file" means that the starting position of the dragged file is located within the window. Figure 2 As shown, the user can drag the "XX.doc" file. Figure 2 The corresponding tracks formed from 202 to 208 are the drag tracks of the "XX.doc" file, and the dotted box corresponding to 210 may represent a file information acquisition window.
[0068] It can be seen that the file information obtaining window 210 is overlaid with the starting position of the dragged file, and the "starting position" refers to the position of the file before it is dragged. It should be noted that, taking the mouse dragging file as an example, the mouse dragging file may sometimes be dragged at a high speed. If the file information obtaining window 210 is created based on the position of the file before it is dragged, the mouse may have been dragged away when the file information obtaining window 210 is created. Therefore, the file information obtaining window 210 should be overlaid with the starting position of the dragged file, but the mouse position is generally synchronized with the file position when the file is dragged, so the file information obtaining window 210 can actually be overlaid with the current position of the mouse.
[0069] In actual implementation, the file information obtaining window is overlaid with the starting position of the dragged file, so that the file can be directly perceived by the desktop operating system when it is dragged, and the file information of the dragged file can be directly obtained. The file information of the dragged file does not need to be obtained by the desktop operating system when the file is dragged to the drag-and-drop receiving window. Therefore, the file information can be obtained in time when the file is dragged.
[0070] It should be noted that the file information obtaining window can be created in advance before the file is dragged, or can be newly created when the file is dragged. Regardless of when the file information obtaining window is created, the file information obtaining window can be overlaid with the starting position of the dragged file, so as to obtain the file information of the dragged file. In addition, the size and position of the file information obtaining window are not limited in the embodiments of the present application. In actual implementation, the position of the file information obtaining window can be set arbitrarily, and the size of the file information obtaining window can also be set arbitrarily, as long as the file information obtaining window is overlaid with the starting position of the dragged file.
[0071] It can be understood that if the size of the file information obtaining window is the size of the entire desktop, the starting position of the dragged file can be overlaid by the file information obtaining window regardless of where the starting position is. Therefore, in actual implementation, the size of the entire desktop can be directly selected as the size of the file information obtaining window. In addition, if the file information obtaining window is newly created when the file is dragged, the file information obtaining window can be created based on the starting position of the dragged file, so that the created file information obtaining window is overlaid with the starting position of the dragged file.
[0072] File information refers to information that can provide a processing basis for file processing operations. Different file processing operations may require different file information. The embodiments of the present application do not specifically limit the type of file processing operation and the corresponding required file information. For example, if the file processing operation is a transfer operation, the file information may include the file path of the dragged file. If the file processing operation is a file open operation, the file information may include the file type, such as the MIME (Multipurpose Internet Mail Extensions) type.
[0073] Among them, since the file MIME type can be used to determine whether a file processing operation can be provided for the corresponding file, in order to decide whether it is necessary to display at least one interface interaction element as an operation entry, the file information can also include the file MIME type. Therefore, although in the embodiment of the present application, step 104 is located after step 102, in actual implementation, in response to the first interactive operation, the file information of the dragged file can be first obtained based on the file information acquisition window covering the starting position of the dragged file. If it is determined based on the MIME type in the file information that an existing file processing operation does not support the file, the interface interaction element as the operation entry may not be displayed. If an existing file processing operation does not support the file, the corresponding interface interaction element of the supported file processing operation may be displayed, that is, the "interface interaction element that displays the corresponding file processing operation and the file type of the dragged file" mentioned above.
[0074] The file information acquisition window can be set to invisible, which can be achieved by setting the transparency of the file information acquisition window. It is understandable that different levels of transparency correspond to different levels of visibility. If the file information acquisition window is set to completely transparent, the file information acquisition window will be completely invisible. The reason for setting the file information acquisition window to invisible is that the main function of the file information acquisition window is to perceive the first interactive operation and obtain file information, and it does not need to be visible as an interactive window. If the file information acquisition window is visible, it will interfere with the user's normal operation because it is perceived by the user.
[0075] 106. In response to a second interactive operation, based on the file information and the file processing operation corresponding to the interface interactive element, process the dragged file, where the second interactive operation is used to stop dragging at the interface interactive element.
[0076] like Figure 2 As shown, the icon 212 corresponding to "Send to Large Screen" and the icon 214 corresponding to "Send to Folder" are both interface interaction elements, and 216 is the frame that carries and displays the interface interaction elements 212 and 214. Figure 2In the previous step 102, the frame 216 and the interface interaction elements 212 and 214 can be displayed simultaneously in response to the display of the interface interaction element in the first interaction operation. Figure 2 In the foregoing, only two interface interaction elements are displayed, and in actual implementation, at least one interface interaction element can be displayed in the frame 216, and the size of the frame 216 can also be set according to requirements, which is not limited in the embodiments of the present application.
[0077] In the foregoing, Figure 2 The trajectories formed by the positions 202 to 208 correspond to the drag trajectory of the file “XX.doc”. As shown in FIG. 2B, when the user drags the file “XX.doc” from the position 202 to the position 216 and stops dragging, that is, drags the file to the interface interaction element 212 and stops dragging, the file “XX.doc” can be sent to the large screen to process the dragged file based on the file information and the file processing operation corresponding to the interface interaction element 212, that is, “send to the large screen”. Figure 3
[0078] The file processing method described above can display at least one interface interaction element as an operation entrance in response to the first interaction operation, and can process the dragged file based on the file information obtained through the file information obtaining window and the file processing operation corresponding to the interface interaction element when the file is stopped dragging at the interface interaction element, so that the user no longer needs to fix the drag-and-drop receiving window on the desktop and manually open the drag-and-drop receiving window when saving the file, thereby simplifying the interaction steps and improving the file processing efficiency.
[0079] In addition, the interface interaction element is displayed only when the first interaction operation is triggered, so that the interface interaction element does not block other desktop elements. The file information can be obtained based on the file information obtaining window overlaid with the starting position of the dragged file, which makes it possible to obtain the file information at the first time when the file is dragged, and provides a basis for automatically executing the file processing operation when the file is dragged to the interface interaction element. At the same time, the file information obtaining window is set to be invisible, so that the file information obtaining window is not perceived by the user and does not interfere with the user operation.
[0080] In some embodiments, the first interaction operation is triggered by dragging a file in a resource manager or a web element in a web page.
[0081] In the above embodiments, the resource manager can refer to a folder window in a desktop operating system, the file in the resource manager can refer to a file in the folder, and the webpage can refer to a webpage displayed by a browser. The webpage element in the webpage can be an image, a video, an audio, or a text file, etc. The embodiments of the present application do not make a specific limitation thereon. As shown in Figure 2 or Figure 3 The corresponding "XX.doc" file 202 is a file located on the desktop (in the desktop folder). In Figure 4 , the corresponding image 404 is a webpage element in the webpage. In Figure 4 , the browser 402 displays a webpage with a webpage address www.abcd.com, and the image 404 is a webpage element in the webpage.
[0082] In addition, Figure 4 The 406 and 408 in the above embodiments both represent a webpage element being dragged. The trajectory formed by the 404, 406, and 408 represents a drag trajectory of the webpage element. The 408 represents that the webpage element is dragged to the interface interactive element 212 and stopped. In combination with the foregoing content, the dragged file can be processed at this time based on the file information and the file processing operation corresponding to the interface interactive element 212, i.e., the image in the webpage is sent to the large screen. It should be noted that, in addition to the file in the resource manager or the webpage element in the webpage, other application scenarios supporting the drag operation of the file can also implement the scheme provided by the embodiments of the present application. For example, the first interactive operation can also be triggered by the drag operation of a file in an application program other than the browser, such as a video player, etc. The embodiments of the present application do not make a specific limitation thereon.
[0083] In the above embodiments, the drag operation of the file in the resource manager or the webpage element in the webpage can be responded to, so as to simplify the interactive steps when the dragged file is processed, thereby improving the file processing efficiency when the file in the resource manager or the webpage element in the webpage is processed. At the same time, the application scenarios supporting the drag operation of the file are not limited to one, but are at least extended to support the drag operation of the webpage element, so that the interactive steps can be simplified and the file processing efficiency can be improved in more application scenarios.
[0084] In some embodiments, the type of the file processing operation includes at least one of a file transfer operation or a file opening operation.
[0085] The file storage operation refers to storing a file in a file original path to a file target path, and the file opening operation refers to opening the file in the file original path by an application matched with a file type. It should be noted that the file target path can refer to a local file path of a terminal where a desktop operating system is located, or a cloud storage path on a cloud server, which is not limited in the embodiments of the present application.
[0086] In the above embodiments, the dragged file can be processed by using various file processing operations, thereby expanding the operation types of processing the dragged file, and thereby simplifying the interaction steps and improving the file processing efficiency in more application scenarios.
[0087] In some embodiments, after obtaining the file information of the dragged file based on the file information obtaining window covering the position where the dragged file is located, the method further includes:
[0088] In a case where the file information obtaining window is newly created when the first interaction operation is triggered, destroying the file information obtaining window;
[0089] In a case where the file information obtaining window is created when the first interaction operation is triggered, and the file information obtaining window is set to be valid before the file information of the dragged file is obtained, setting the file information obtaining window to be invalid.
[0090] It can be understood that, since the file information obtaining window is invisible, in actual implementation, the process corresponding to the file information obtaining window can be selected to be continuously maintained, so as to timely perceive the dragging operation when the file is dragged and obtain the file information. However, the process corresponding to the file information obtaining window is continuously maintained, which causes the system resources to be continuously occupied, and in fact, as long as the process corresponding to the file information obtaining window can be maintained when the file is started to be dragged, the corresponding effect can be achieved.
[0091] Therefore, the file information obtaining window can be temporarily newly created each time the first interaction operation is triggered. In order to improve the process corresponding to the file information obtaining window to be continuously maintained, thereby causing the system resources to be occupied, after obtaining the file information of the dragged file based on the file information obtaining window covering the position where the dragged file is located, the file information obtaining window can also be destroyed, that is, the first branch scheme mentioned in the embodiments of the present application. It should be noted that the timing of destroying the file information obtaining window can be selected according to requirements, for example, the file information obtaining window can be destroyed at the same time when the file information is obtained, or the file information obtaining window can be destroyed after the dragged file is processed, which is not limited in the embodiments of the present application.
[0092] It can be seen that in the first branch solution, the file information obtaining window is newly created temporarily each time the first interaction operation is triggered, and the file information obtaining window is destroyed after the file information is obtained each time. This causes the process of creating and destroying the file information obtaining window to be triggered in sequence each time the first interaction operation is triggered, resulting in that the file information obtaining window may be created and destroyed too frequently, which may also cause too many system resources to be occupied. In view of the above problems, the second branch solution is further provided in the embodiments of the present application.
[0093] In the second branch solution, the file information obtaining window can be created only once and set to be invalid. When the first interaction operation is triggered, the file information obtaining window can be set from invalid to valid. After the file information of the dragged file is obtained based on the file information obtaining window overlaid on the position where the dragged file is located, the file information obtaining window can be set from valid to invalid.
[0094] The valid means that the file information obtaining window can perceive the first interaction operation, and the invalid means that the file information obtaining window cannot perceive the first interaction operation, and the file information obtaining window can occupy less system resources when invalid than when valid. The file information obtaining window can be set to valid by using a show function, and the file information obtaining window can be set to invalid by using a hide function. How to actually implement this can be related to the interface function provided by the desktop operating system, which is not limited in the embodiments of the present application.
[0095] In the above embodiments, the file information obtaining window can be newly created temporarily each time the first interaction operation is triggered, and the file information obtaining window can be destroyed after the file information is obtained, so as to improve the problem that the system resources are continuously occupied due to the process corresponding to the file information obtaining window being continuously persisted. In addition, the file information obtaining window can be created only once, and the file information obtaining window can be set from invalid to valid when the first interaction operation is triggered, and the file information obtaining window can be set from valid to invalid after the file information of the dragged file is obtained. In this way, the problem that the file information obtaining window can be created and destroyed too frequently and too many system resources are occupied due to the process of creating and destroying the file information obtaining window being triggered in sequence each time the first interaction operation is triggered can be improved. In addition, the file information obtaining window can occupy less system resources when invalid than when valid, so that the system resources can also be saved.
[0096] In some embodiments, the file processing operation is a file transfer operation, the file information includes a file original path, and the interface interaction element corresponds to a file target path; based on the file information and the file processing operation corresponding to the interface interaction element, the dragged file is processed, including: transferring the dragged file from the file original path to the file target path corresponding to the interface interaction element.
[0097] It should be noted that if the first interaction operation is triggered by dragging a web element in a web page, unlike the file in the resource manager directly corresponding to the file original path, the web element in the web page actually serves as downloaded cache content and also corresponds to a file original path, such as a storage path of the web cache content.
[0098] In the above embodiments, since the interface interaction element serving as at least one operation entrance can be displayed in response to the first interaction operation, when the file is stopped dragging at the interface interaction element, the dragged file can be transferred from the file original path to the file target path, so that the user no longer needs to fix the drag-and-drop receiving window on the desktop and manually open the drag-and-drop receiving window when transferring the file, thereby simplifying the interaction steps and improving the file processing efficiency.
[0099] In some embodiments, the first interaction operation is triggered by selecting a file by a mouse and dragging, and the desktop operating system is a windows system; the monitoring manner of the first interaction operation includes:
[0100] In a case where the trigger state of the mouse button is the pressed state and there is a display window for displaying the file dragging position, the first interaction operation is triggered.
[0101] In the process of selecting a file by a mouse and dragging, the mouse button can be triggered, and the display window for displaying the file dragging position can be displayed. Figure 2 Or Figure 3 The trigger state of the mouse button can be obtained by using the GetAsyncKeyState function, which is an interface function provided by the windows system and can be used to check the state of the physical mouse button, for example, GetAsyncKeyState(VK_LBUTTON) can always return the state of the left physical mouse button. It can be understood that if the mouse button is triggered, it means that the mouse can be clicked or selected, but this is not enough to indicate that the user is dragging the file.
[0102] In a desktop operating system, a file usually corresponds to a display icon. In the Windows system, when a file is dragged, a window is usually created to display a "shadow icon" of the file being dragged to follow the mouse, to show the user where the file is currently being dragged to, and can be used to prompt the user that a drag operation is being performed. Thus, whether the first interaction operation is triggered can be determined by detecting whether the display window for displaying the file drag position (i.e., the window for displaying the "shadow icon") exists. In the case where it is detected that the trigger state is the pressed state and the display window for displaying the file drag position exists, it can be determined that the first interaction operation is triggered.
[0103] It should be noted that in actual implementation, the mouse button (such as the left button) can be first detected to determine whether it is in the pressed state, and then the display window for displaying the file drag position is detected to determine whether it exists. The trigger state of the mouse button can be detected periodically, such as through an infinite loop, the trigger state of the left mouse button is detected every 300 milliseconds, that is, the trigger state of the left mouse button is detected each time, and if it is found that it is not in the pressed state, the detection can be initiated again after 300 milliseconds. In addition, if it is detected that it is in the pressed state, but it is detected that the display window does not exist, the detection of the mouse button can also be initiated again after 300 milliseconds. Of course, the interval can also be set according to requirements, and the present application embodiment does not make a specific limitation on this. The process of monitoring the first interaction operation can be referred to Figure 5 .
[0104] In the above embodiment, whether the first interaction operation is triggered can be determined by detecting whether the trigger state of the mouse button is in the pressed state and whether the display window for displaying the file drag position exists, so that the recognition accuracy of the file drag operation can be improved.
[0105] In some embodiments, the determination of whether the display window for displaying the file drag position exists includes:
[0106] The window information of the existing window is obtained by enumerating all existing windows, and in the case where the window information of the display window exists in the window information of the existing window, it is determined that the display window exists; or the function for creating the display window or the function for performing the drag and drop is intercepted, and it is determined that the display window exists based on the intercepted message.
[0107] The window information refers to information that can be used to specify the window type, and can include a window title name and a class name of the window object, and the embodiments of the present application do not make a specific limitation on this. The enumerated window can be realized by using the EnumWindows and EnumChildWindows functions, and the embodiments of the present application do not make a specific limitation on this. Since the window information of the display window can be known in advance, by enumerating all existing windows and obtaining the window information, the obtained window information is compared with the window information of the display window, and it is determined whether the display window exists.
[0108] Since all existing windows are enumerated and the window information is obtained, the UI response time of the desktop operating system can be increased, and therefore, in the embodiments of the present application, the function for creating the display window or the function for performing the drag and drop can be intercepted by messages, and it is determined that the display window exists based on the intercepted messages. Specifically, the function for creating the display window can be loaded into the process for intercepting the messages by using the dll injection, and the APIHOOK is used to intercept the messages, and in the case that the message of the function for creating the display window is intercepted, it is determined that the display window exists. The function for creating the display window can be the CreateWindowEx function, and the embodiments of the present application do not make a specific limitation on this. Since the dll injection is used, the system instability can be caused, but the UI response time of the desktop operating system can be reduced. In addition to the function for creating the display window, the function for performing the drag and drop in the Windows system can be intercepted by messages, such as the DoDragDrop function.
[0109] In the above embodiments, the window information obtained by enumerating all existing windows is compared with the window information of the display window, so as to determine whether the display window exists. Since the injection technology is not used, the system instability can be reduced. Alternatively, the function for creating the display window or the function for performing the drag and drop is intercepted by messages based on the dll injection technology, so as to determine whether the display window exists. Since all existing windows do not need to be enumerated, the UI response time of the desktop operating system can be reduced.
[0110] In some embodiments, the first interaction operation is triggered by selecting a file by using a mouse and dragging, the desktop operating system is the Windows system, the file information obtaining window has been registered as a drag and drop target by using the RegisterDragDrop function, and the IDropTarget interface has been defined as a response class for taking over the drag and drop by using the RegisterDragDrop function; based on the file information obtaining window, the file information of the dragged file is obtained, including:
[0111] In the case that the mouse enters the file information acquisition window, the file information of the dragged file is acquired by calling the DragEnter function in the IDropTarget interface.
[0112] Specifically, the RegisterDragDrop function is mainly used to register the specified window as a window that can be used as an OLE (Object Linking and Embedding) drag-and-drop operation target, and to specify the IDropTarget instance to be used for the drop operation. The IDropTarget interface is a pure virtual interface left by the system for user programs supporting drag-and-drop, and no implementation of any function of the interface is performed in advance, but the user takes over the result of the drag-and-drop by implementing the interface function. When the user selects a file or a piece of text with the mouse and moves the mouse into a window that can accept drag-and-drop (which has called RegisterDragDrop), the DragEnter function in the IDropTarget interface will be called first. Based on the DragEnter function, the file information of the dragged file can be acquired when the mouse drags the file into the file information acquisition window.
[0113] In actual implementation, the IDropTarget interface can be implemented first, and then the file information acquisition window is registered as a drag-and-drop target through the RegisterDragDrop function, and the DragEnter function is implemented. Subsequently, the DragEnter function of the IDropTarget interface can be called through the window message loop. By calling the DragEnter function, the file information of the dragged file is acquired and saved to the memory, and finally the file information acquisition window is closed (such as logging out the window or processing the window through the hide function) and the window message loop is exited. Of course, the interval time can also be set according to the requirements, and the present application embodiment does not make specific limitation thereon. The process of acquiring the file information of the dragged file can be referred to Figure 6 .
[0114] In the above embodiment, the file information can be acquired based on the file information acquisition window overlaid with the starting position of the dragged file, which makes it unnecessary to acquire the file information after the file is dragged into the drag-and-drop receiving window, but acquires the file information at the first time when the file is dragged, which provides a basis for automatically performing the file processing operation when the file is dragged to the interface interaction element, so as to simplify the subsequent interaction steps and improve the file processing efficiency.
[0115] In some embodiments, the first interaction operation is triggered by selecting the file with the mouse and dragging it, and the desktop operating system is a Linux system; the monitoring method of the first interaction operation includes:
[0116] In the case that the XSelectInput function receives a CreateNotify event of the root window and the XISelectEvents function receives a global mouse click event, there is a first interaction operation triggered;
[0117] Wherein, the XSelectInput function has declared to receive a CreateNotify event of the root window, and the XISelectEvents function has declared to receive a global mouse click event.
[0118] Specifically, the XSelectInput function and the XISelectEvents function are both interface functions provided by xlib. The xlib is a graphics library for X Window system, which can obtain the activity state of a window by detecting active window events. The XSelectInput function is used to set the event mask of a window, including active window events. By setting the event_mask parameter of the XSelectInput function to FocusChangeMask, the active window event can be listened to. The XISelectEvents can listen to the input events of the input device, such as the global mouse click event; the CreateNotify event is generated when the window is created.
[0119] The reason for listening to the CreateNotify event is that Linux, similar to windows, will also create a window to display the "shadow icon" of the file being dragged to follow the mouse, to show the user where the file is currently being dragged, and can be used to prompt the user that the drag operation is being performed. And listening to the CreateNotify event can listen to whether a window is created. Only listening to the CreateNotify event for indicating the creation of a window may not be enough to indicate that the user is dragging a file. Therefore, it can be further determined whether the XISelectEvents function receives a global mouse click event. The above process of monitoring the first interaction operation can be referred to Figure 7 .
[0120] In the above embodiment, since whether there is a global mouse click event can be detected through the XISelectEvents function, and whether there is a CreateNotify event of the root window can be detected through the XSelectInput function at the same time, whether there is a first interaction operation triggered is determined through the two detection results, so that the recognition accuracy of the drag file operation can be improved.
[0121] In some embodiments, the first interaction operation is triggered by selecting a file by a mouse and dragging the file, the desktop operating system is a Linux system, and the file information obtaining window has been added as a drag-and-drop target by adding an XdndAware attribute; based on the file information obtaining window, file information of the dragged file is obtained, including:
[0122] In a case where the mouse enters the file information obtaining window, based on information transmitted between the file information obtaining window and a source window where the dragged file is located, file information of the dragged file is obtained.
[0123] Specifically, the XdndAware attribute can be created for the window to indicate that the window supports XDND (X Window System Drag-and-Drop Protocol) as a drag-and-drop target. As can be known from the foregoing, the user can create the file information obtaining window when dragging the file.
[0124] Thus, the source window where the file is located (such as a window corresponding to a desktop folder) can send an XdndEnter type ClientMessage and an XdndPosition type ClientMessage to the file information obtaining window. The XdndEnter type ClientMessage can include a protocol version to be used and data types (such as MIME types) supported by the source window for drag-and-drop, and the XdndPosition type ClientMessage can include a timestamp, a position of the target mouse, and an action requested by the user (such as moving the file or copying the file).
[0125] After the file information obtaining window receives the ClientMessage sent by the source window, the XConvertSelection function can be used to inform the XServer that the file information obtaining window needs to perform a paste operation, and to request that the file information (such as a file path) dragged by the mouse be sent to the XdndSelection clipboard (shared cache). Based on the requirement of the file information obtaining window, the XServer can send a paste request to the source window to inform the source window to send the file information to the XdndSelection.
[0126] The source window can send the file information to the XdndSelection according to the aforementioned timestamp, so that the timestamp and the file information are stored in the XdndSelection in association. After sending the file information to the XdndSelection, the source window can send a SelectionNotify event to the file information obtaining window, and the application process performing the method provided by the embodiment of the present application can retrieve the file information in the XdndSelection according to the aforementioned timestamp, and save the file information to the corresponding process space. After obtaining the file information, the file information obtaining window can be closed. The process of obtaining the file information of the dragged file can refer to Figure 8 .
[0127] In the above embodiment, the file information can be obtained based on the file information obtaining window covering the starting position of the dragged file, which makes it unnecessary to obtain the file information after the file is dragged to the drag-and-drop receiving window, but to obtain the file information at the first time when the file is dragged, which provides a basis for automatically performing a file processing operation when the file is dragged to the interface interactive element, so as to simplify the subsequent interaction steps and improve the file processing efficiency.
[0128] For ease of understanding, it is assumed that the first interactive operation is triggered by selecting a file by a mouse and dragging the file, and a desktop operating system is a windows system, and the overall method flow provided by the embodiment of the present application is described. Referring to Figure 9 , the specific implementation can be shown in the following flow steps:
[0129] 902, monitoring the operation of dragging a file by a mouse.
[0130] 904, creating a fake drag receiving window in the case of monitoring the operation of dragging a file by a mouse.
[0131] The fake drag receiving window corresponds to the aforementioned file information obtaining window, can be generated according to the mouse position to cover the mouse position or directly set to full screen, and can be set to be transparent so as not to be visible to a user.
[0132] 906, obtaining file information of the dragged file.
[0133] There are two ways for the windows platform to receive the data of the dragged file, which are WM_DROPFILES and implementing the IDropTarget interface. Since the WM_DROPFILES can only be received when the user releases the mouse, the IDropTarget interface is used in the embodiment of the present application. When the file dragged by the mouse enters the fake drag receiving window, the file information can be obtained.
[0134] 908、Destroy the fake drag-receiving window.
[0135] In which, the solution of using show function and hide function mentioned above can also be adopted.
[0136] 910、The application process displays at least one interface interactive element as an operation entrance according to the file information.
[0137] In which, the application process refers to an application process which executes the method provided by the embodiments of the present application.
[0138] 912、In the case that the release event of the left mouse button is monitored at the interface interactive element, the file stops being dragged, and the dragged file is processed based on the file information and the file processing operation corresponding to the interface interactive element.
[0139] It should be understood that, although each step in the flowchart involved in each of the above embodiments is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless explicitly stated herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other sequences. Moreover, at least part of the steps in the flowchart involved in each of the above embodiments can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or steps or stages in other steps.
[0140] Based on the same inventive concept, the embodiments of the present application also provide a file processing device for implementing the above-mentioned file processing method. The implementation scheme of the problem solving provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more file processing device embodiments provided below can refer to the limitations of the file processing method in the above text, which will not be repeated here.
[0141] In one embodiment, as shown in Figure 10 a file processing device is provided, which comprises a display module 1002, an acquisition module 1004 and a processing module 1006, wherein:
[0142] The display module 1002 is configured to display at least one interface interactive element as an operation entrance of a file processing operation in response to a first interactive operation, the first interactive operation being used to drag a file, the interface interactive element corresponding to a file processing operation, and the file processing operation matching the file type of the dragged file.
[0143] The acquisition module 1004 is configured to acquire file information of the dragged file based on a file information acquisition window, the file information acquisition window covering a starting position of the dragged file;
[0144] The processing module 1006 is configured to process the dragged file based on the file information and a file processing operation corresponding to the interface interactive element in response to a second interactive operation, the second interactive operation being used to stop dragging at the interface interactive element.
[0145] In some embodiments, the first interactive operation is triggered by dragging a file in a resource manager or a web element in a web page.
[0146] In some embodiments, the file processing operation includes at least one of a file transfer operation or a file opening operation.
[0147] In some embodiments, the processing module 1006 is further configured to destroy the file information acquisition window in a case where the file information acquisition window is newly created when the first interactive operation is triggered, and set the file information acquisition window to be invalid in a case where the file information acquisition window is already created when the first interactive operation is triggered and the file information acquisition window is set to be valid before the file information of the dragged file is acquired.
[0148] In some embodiments, the file processing operation is a file transfer operation, the file information includes a file original path, and the interface interactive element corresponds to a file target path; the processing module 1006 is configured to transfer the dragged file from the file original path to the file target path corresponding to the interface interactive element.
[0149] In some embodiments, the first interactive operation is triggered by selecting a file by a mouse and dragging the file, and the desktop operating system is a windows system; the processing module 1006 is further configured to determine that the first interactive operation is triggered in a case where a trigger state of a mouse button is a pressed state and a display window for displaying a file dragging position exists.
[0150] In some embodiments, the processing module 1006 is further configured to obtain window information of an existing window by enumerating all existing windows, and determine that the display window exists in a case where the window information of the existing window includes window information of the display window; or intercept a function for creating the display window or a function for performing the drag and drop, and determine that the display window exists based on the intercepted message.
[0151] In some embodiments, the first interaction operation is triggered by selecting a file by a mouse and dragging the file, the desktop operating system is a Windows system, the file information obtaining window has been registered as a drag-and-drop target through a RegisterDragDrop function, and an IDropTarget interface has been defined as a response class for taking over the drag-and-drop through the RegisterDragDrop function; the obtaining module 1004 is configured to, in a case where the mouse enters the file information obtaining window, obtain file information of the dragged file by calling a DragEnter function in the IDropTarget interface.
[0152] In some embodiments, the first interaction operation is triggered by selecting a file by a mouse and dragging the file, the desktop operating system is a Linux system, and the processing module 1006 is further configured to, in a case where an XSelectInput function receives a CreateNotify event of a root window and an XISelectEvents function receives a global mouse click event, the first interaction operation is triggered; the XSelectInput function has been declared to receive the CreateNotify event of the root window, and the XISelectEvents function has been declared to receive the global mouse click event.
[0153] In some embodiments, the first interaction operation is triggered by selecting a file by a mouse and dragging the file, the desktop operating system is a Linux system, and the file information obtaining window has been registered as a drag-and-drop target by adding an XdndAware attribute; the obtaining module 1004 is configured to, in a case where the mouse enters the file information obtaining window, obtain file information of the dragged file based on information transmitted between the file information obtaining window and a source window in which the dragged file is located.
[0154] The file processing apparatus described above can display at least one interface interaction element as an operation entrance in response to the first interaction operation, and can process the dragged file based on the file information obtained through the file information obtaining window and the file processing operation corresponding to the interface interaction element when the file is stopped at the interface interaction element, so that the user no longer needs to fix the drag-and-drop receiving window on the desktop and manually open the drag-and-drop receiving window when transferring the file, thereby simplifying the interaction steps and improving the file processing efficiency.
[0155] In addition, the interface interaction element is displayed only when the first interaction operation is triggered, so that other desktop elements are not blocked. The file information can be obtained based on a file information obtaining window overlaid with a starting position of the dragged file, which enables the file information to be obtained at the first time when the file is dragged, instead of being obtained after the file is dragged to the drag-and-drop receiving window, thereby providing a basis for automatically performing the file processing operation when the file is dragged to the interface interaction element. Meanwhile, the file information obtaining window is set to be invisible, so that the file information obtaining window is not perceived by the user and does not interfere with the user operation.
[0156] The specific limitations of the file processing apparatus can be referred to the limitations of the file processing method in the foregoing, which will not be repeated here. Each module in the file processing apparatus can be realized by software, hardware, or a combination thereof, in whole or in part. Each module can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to each module.
[0157] In one embodiment, a computer device is provided, which can be a terminal, and an internal structure diagram thereof can be as shown in Figure 11 The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to perform wired or wireless communication with external terminals. The wireless communication can be achieved through WIFI, mobile cellular network, NFC (near field communication), or other technologies. The computer program is executed by the processor to implement a file processing method. The display unit of the computer device is configured to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball, or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad, or mouse, etc.
[0158] Those skilled in the art can understand that Figure 11The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0159] In one embodiment, a computer device is provided, comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program:
[0160] In response to a first interaction operation, at least one interface interaction element is displayed, the interface interaction element being an operation entry of a file processing operation, the first interaction operation being used for dragging a file, the interface interaction element corresponding to the file processing operation, and the file processing operation matching a file type of the dragged file;
[0161] Based on a file information acquisition window, file information of the dragged file is acquired, and the file information acquisition window covers a starting position of the dragged file;
[0162] In response to a second interaction operation, the dragged file is processed based on the file information and the file processing operation corresponding to the interface interaction element, and the second interaction operation is used for stopping dragging at the interface interaction element.
[0163] In one embodiment, a computer readable storage medium is provided, storing a computer program, and the computer program is executed by a processor to implement the following steps:
[0164] In response to a first interaction operation, at least one interface interaction element is displayed, the interface interaction element being an operation entry of a file processing operation, the first interaction operation being used for dragging a file, the interface interaction element corresponding to the file processing operation, and the file processing operation matching a file type of the dragged file;
[0165] Based on a file information acquisition window, file information of the dragged file is acquired, and the file information acquisition window covers a starting position of the dragged file;
[0166] In response to a second interaction operation, the dragged file is processed based on the file information and the file processing operation corresponding to the interface interaction element, and the second interaction operation is used for stopping dragging at the interface interaction element.
[0167] In one embodiment, a computer program product is provided, comprising a computer program, and the computer program is executed by a processor to implement the following steps:
[0168] In response to the first interaction operation, at least one interface interaction element is displayed, the interface interaction element being an operation portal of the file processing operation, the first interaction operation being used for dragging the file, the interface interaction element corresponding to the file processing operation, and the file processing operation matching the file type of the dragged file;
[0169] Based on the file information acquisition window, file information of the dragged file is acquired, and the file information acquisition window covers the starting position of the dragged file;
[0170] In response to the second interaction operation, the dragged file is processed based on the file information and the file processing operation corresponding to the interface interaction element, and the second interaction operation is used for stopping the dragging at the interface interaction element.
[0171] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, the processes of the above-mentioned embodiments can be included. Any reference to a memory, a database or other medium in each embodiment provided by the present application can include at least one of a non-volatile and a volatile memory. The non-volatile memory can include a read-only memory (ROM), a tape, a floppy disk, a flash memory, an optical memory, a high-density embedded non-volatile memory, a resistive memory (ReRAM), a magnetoresistive random access memory (MRAM), a ferroelectric memory (FRAM), a phase change memory (PCM), a graphene memory, etc. The volatile memory can include a random access memory (RAM) or an external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as a static random access memory (SRAM) or a dynamic random access memory (DRAM), etc. The database involved in each embodiment provided by the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., and is not limited thereto. The processor involved in each embodiment provided by the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., and is not limited thereto.
[0172] Any technical features in the above embodiments can be combined, and for the sake of brevity, not all possible combinations are described above, however, as long as the combinations of technical features do not have contradictions, they shall be considered within the scope of the present disclosure.
[0173] The above embodiments only express several implementation manners of the present application, and the description is relatively specific and detailed, but it shall not be understood as a limitation on the patent scope of the present application. It shall be pointed out that, for ordinary skilled persons in the art, several modifications and improvements can be made without departing from the concept of the present application, and these shall be within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. A file processing method characterized by, The method comprises: in response to a first interaction operation, displaying at least one interface interaction element as an operation entry of a file processing operation, the first interaction operation being used for dragging a file, the interface interaction element corresponding to a file processing operation matching a file type of the dragged file; based on a file information obtaining window, obtaining file information of the dragged file, the file information obtaining window covering a starting position of the dragged file; in response to a second interaction operation, processing the dragged file based on the file information and the file processing operation corresponding to the interface interaction element, the second interaction operation being used for stopping dragging at the interface interaction element.
2. The method of claim 1, wherein, The first interaction operation is triggered by dragging a file in a resource manager or a web element in a web page.
3. The method of claim 1, wherein, The type of the file processing operation comprises at least one of a file transfer operation or a file opening operation.
4. The method of claim 1, wherein, After the file information of the dragged file is obtained based on the file information obtaining window, the method further comprises: in a case where the file information obtaining window is newly created when the first interaction operation is triggered, destroying the file information obtaining window; in a case where the file information obtaining window has been created when the first interaction operation is triggered and the file information obtaining window has been set to be valid before the file information of the dragged file is obtained, setting the file information obtaining window to be invalid.
5. The method of claim 3, wherein, The file processing operation is a file transfer operation, the file information comprises a file original path, and the interface interaction element corresponds to a file target path; and the processing of the dragged file based on the file information and the file processing operation corresponding to the interface interaction element comprises: transferring the dragged file from the file original path to the file target path corresponding to the interface interaction element.
6. The method according to any one of claims 1 to 5, characterized in that, The first interaction operation is triggered by selecting a file by a mouse and dragging the file, and the desktop operating system is a windows system; and the monitoring manner of the first interaction operation comprises: in a case where a trigger state of a mouse button is a pressed state and a display window for displaying a file dragging position exists, the first interaction operation is triggered.
7. The method of claim 6, wherein, The determination manner of whether the display window for displaying the file dragging position exists comprises: obtaining window information of all existing windows by enumerating all the existing windows, and determining that the display window exists in a case where the window information of the display window exists in the window information of the existing windows; or intercepting a message of a function for creating the display window or a function for performing the drag and drop, and determining that the display window exists based on the intercepted message.
8. The method according to any one of claims 1 to 5, characterized in that, The first interaction operation is triggered by selecting a file by a mouse and dragging the file, the desktop operating system is a windows system, the file information obtaining window has been registered as a drag and drop target by a RegisterDragDrop function, and an IDropTarget interface has been defined as a response class for taking over the drag and drop by the RegisterDragDrop function. The file information acquisition window is used to acquire file information of the dragged file, including: In the case that the mouse enters the file information acquisition window, the file information of the dragged file is acquired by calling a DragEnter function in the IDropTarget interface.
9. The method according to any one of claims 1 to 5, characterized in that, The first interaction operation is triggered by selecting and dragging the file by the mouse, and the desktop operating system is a Linux system; the monitoring method of the first interaction operation includes: In the case that an XSelectInput function receives a CreateNotify event of a root window and an XISelectEvents function receives a global mouse click event, the first interaction operation is triggered; The XSelectInput function has declared to receive the CreateNotify event of the root window, and the XISelectEvents function has declared to receive the global mouse click event.
10. The method according to any one of claims 1 to 5, characterized in that, The first interaction operation is triggered by selecting and dragging the file by the mouse, the desktop operating system is a Linux system, and a file information acquisition window has been added with an XdndAware attribute as a drag-and-drop target; The file information acquisition window is used to acquire file information of the dragged file, including: In the case that the mouse enters the file information acquisition window, the file information of the dragged file is acquired based on information transmitted between the file information acquisition window and a source window in which the dragged file is located.
11. A file processing apparatus characterized by comprising: It includes: The display module is configured to display at least one interface interactive element as an operation entrance of a file processing operation in response to a first interaction operation, the first interaction operation being used to drag a file, the interface interactive element corresponding to a file processing operation, and the file processing operation matching a file type of the dragged file; The acquisition module is configured to acquire file information of the dragged file based on a file information acquisition window, the file information acquisition window covering a starting position of the dragged file; The processing module is configured to process the dragged file based on the file information and the file processing operation corresponding to the interface interactive element in response to a second interaction operation, the second interaction operation being used to stop dragging at the interface interactive element.
12. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to implement the steps of the method in any one of claims 1 to 10.
13. A computer readable storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 10.
14. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 10.