Target file processing method, device, equipment and medium

By simulating the input of the first letter of the filename and using image recognition technology, combined with the maximize operation, the problem of target file selection and uploading is solved, realizing automated selection and uploading under complex paths.

CN116627918BActive Publication Date: 2026-05-29欧摩威软件系统开发(重庆)有限公司

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
欧摩威软件系统开发(重庆)有限公司
Filing Date
2023-05-25
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately select and upload target files, especially in scenarios with complex file paths, particularly when the filename is not displayed on the screen, making it impossible to complete the selection using a simulated keyboard.

Method used

By simulating the input of the first letter of the target file's name, combined with image recognition technology and the maximization operation, the system automatically locates and selects the target file until a match is found or the maximum number of inputs is reached.

Benefits of technology

It enables the automatic and accurate selection and uploading of target files in complex file path scenarios, solving the problem of filenames not being displayed and improving selection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116627918B_ABST
    Figure CN116627918B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a target file processing method, which can automatically select files. The method comprises: starting a file selection window and obtaining a storage path of a target file; automatically positioning and clicking elements in the storage path in the file selection window in sequence until the target file is positioned according to the storage path; and selecting the target file; wherein the automatic positioning and selection of the elements in the storage path comprises: identifying the first letter of the element; determining that the number of elements with the first letter in the folder where the element is located is a first value; when the folder where the element is located is opened, simulating input of the first letter to position a candidate element with the first letter; judging whether the candidate element matches the first element; if yes, the element is positioned; if not, the first letter is continuously simulated to position other candidate elements until the element is positioned, or the number of times of simulating input of the first letter is equal to the first value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, device, and medium for processing target files. Background Technology

[0002] When using software (such as utility software), it often involves uploading target files so that the software can process them, such as extracting data from the target files. Traditionally, target files are selected manually. To improve efficiency, technicians often develop automated tools that integrate scripts that simulate mouse and keyboard operations, thereby automating software to complete specific tasks. However, in some scenarios, implementing automatic selection and uploading of target files by these automated tools can become challenging. For example, when the target software uses... Figure 1A When using the file upload interface shown, you can simulate a keyboard input by automatically entering the target file's storage path in the input box next to "File Name," thus achieving automatic selection and upload of the target file. However, when the target software uses... Figure 1B When uploading files as shown, since the target file cannot be automatically selected by simulating a keyboard, image recognition technology is needed to identify elements and simulate mouse clicks on the corresponding elements to gradually select the target file. However, in this scenario, there is a possibility that the expanded path of the target file is too long, causing the corresponding filename not to be displayed on the screen, making it impossible to click the correct path and thus failing to accurately select the target file. Summary of the Invention

[0003] In view of this, embodiments of the present invention provide a method, apparatus, device, and medium for processing target files, which can accurately select target files in an automated manner.

[0004] This invention discloses a method for processing target files, used to automatically select target files, including: launching a file selection window; obtaining the storage path of the target file, the storage path including a first element; automatically locating and clicking elements in the storage path in the file selection window according to the storage path until the target file is located; and selecting the target file.

[0005] The step of automatically locating and selecting elements in the storage path sequentially in the file selection window includes: identifying the first letter of a first element; determining, based on the storage path, the number of elements with that first letter in the folder containing the first element as a first value; when the folder containing the first element is opened, simulating input of the first letter to locate candidate elements with that first letter; determining whether the candidate elements match the first element; if they match, locating the first element; if they do not match, continuing to simulate input of the first letter to locate other candidate elements until the first element is located, or the number of times the first letter is simulated equals the first value.

[0006] If the number of simulated inputs of the first letter equals the first value and the first element is still not matched, then the message "the storage path does not exist" will be displayed.

[0007] The first element is the filename of the target file.

[0008] Specifically, before automatically locating and selecting elements in the storage path in the file selection window, the file selection window is maximized.

[0009] The step of maximizing the file selection window includes: obtaining the screen resolution; moving the file selection window to the origin coordinates of the screen; and enlarging the file selection window to the same size as the screen resolution.

[0010] The step of automatically locating and clicking elements in the storage path sequentially in the file selection window includes: using image recognition technology to identify a first element in the file selection window; automatically clicking the first element when it is identified; and performing the step of identifying the first letter of the first element when it is not identified.

[0011] The method further includes: after obtaining the storage path of the target file, dividing the storage path to identify multiple elements from the storage path, wherein the multiple elements have an order relationship; and automatically locating and selecting the elements in the storage path in the file selection window in sequence, including: locating and clicking the multiple elements in the file selection window in sequence based on the order relationship.

[0012] This invention provides a target file processing apparatus for automatically selecting target files, comprising: a startup module for launching a file selection window; an acquisition module for acquiring the storage path of the target file, the storage path including a first element; a processing module for automatically locating and clicking elements in the storage path sequentially in the file selection window according to the storage path until the target file is located; and a selection module for selecting the target file.

[0013] The processing module includes: a recognition unit for recognizing the first letter of a first element; a calculation unit for determining, based on the storage path, the number of elements with the first letter in the folder containing the first element as a first value; a simulation unit for simulating inputting the first letter when the folder containing the first element is opened, in order to locate candidate elements with the first letter; and a processing unit for determining whether the candidate elements match the first element; if they match, the first element is located; if they do not match, the first letter is simulated again to locate other candidate elements until the first element is located, or the number of times the first letter is simulated is equal to the first value.

[0014] This invention provides a computer device, including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the executable instructions to implement a processing method according to an embodiment of the invention.

[0015] This invention provides a computer-readable storage medium storing a computer program thereon, the computer program including executable instructions, which, when executed by a processor, implement the processing method according to an embodiment of the invention.

[0016] Beneficial effects of the embodiments of the present invention:

[0017] In this embodiment of the invention, the target element is located and identified in a folder by simulating the input of the first letter of the target element (e.g., the file name of the target file). Thus, the target element can be identified even when it is not displayed in the file selection window, and the target file can be selected accurately in an automated manner. Attached Figure Description

[0018] Other details and advantages of the invention will become apparent from the detailed description provided below. It should be understood that the following drawings are merely illustrative and should not be considered as limiting the invention. A detailed description will be given below with reference to the drawings, in which:

[0019] Figure 1A This is a schematic diagram of a file selection window interface;

[0020] Figure 1B This is an illustration of another interface for the file selection window;

[0021] Figure 2A This is a flowchart illustrating an embodiment of the object file processing method of the present invention;

[0022] Figure 2B yes Figure 2A A flowchart illustrating an embodiment of step S24;

[0023] Figure 2C yes Figure 2A A flowchart illustrating another embodiment of step S24;

[0024] Figure 3A This is a flowchart illustrating another embodiment of the object file processing method of the present invention;

[0025] Figure 3B yes Figure 3A A flowchart illustrating an embodiment of step S32;

[0026] Figure 4 This is a schematic diagram of the structure of an embodiment of the object file processing device of the present invention;

[0027] Figure 5 This is a schematic diagram of the structure of an embodiment of the computer device of the present invention. Detailed Implementation

[0028] To make the technical problems to be solved, the technical solutions, and the beneficial effects of the present invention clearer and more understandable, the present invention 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 for explaining the present invention and are not intended to limit the present invention.

[0029] In the description of this invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. Furthermore, the terms "first," "second," etc., are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein.

[0030] like Figure 2AThe diagram shown is a flowchart illustrating an embodiment of the target file processing method of the present invention. This method can be used to automatically select target files; for example, in technologies for automating software manipulation, this method can be integrated to automatically select and upload files. Specifically, the method includes the following steps:

[0031] Step S20: Launch the file selection window.

[0032] An example of a file selection window can be shown below. Figure 1B As shown in the diagram, in the file selection window, you cannot select files by directly simulating the keyboard input of the file's storage path; you must select the target file by simulating the mouse.

[0033] Step S22: Obtain the storage path of the target file, which includes: the first element.

[0034] The storage path of the target file could be, for example, D:\test. In this example, the storage path of the target file contains the elements "D:" and "test", as well as the implicit element "This PC". Therefore, the first element could be, for example, the computer name, disk name, folder name, or file name, etc.

[0035] After obtaining the storage path of the target file, the storage path can be divided to identify the elements contained within it, and these elements can be assigned a sequential relationship. Subsequently, based on this sequential relationship, the mouse can be simulated to locate and click these elements in the file selection window. When dividing the storage path, the symbol "\" can be used as the dividing interval.

[0036] Step S24: Based on the storage path, automatically locate and click on elements within the storage path in the file selection window until the target file is located.

[0037] Step S26: Select the target file.

[0038] Among them, with Figure 1B Taking the target file's storage path as D:\test as an example, the mouse is simulated to move to the "This PC" element in the file selection area, and then the mouse is simulated to click on the element. Then, in the expanded interface, the mouse is located and clicked on "D:", and finally, the "test" file is located and selected in the expanded interface, thereby realizing the automatic selection and upload of the test file.

[0039] The above method can automatically select the target file. However, in some scenarios, the storage path may be very long. When expanding elements sequentially based on the storage path, some elements may not be displayed in the interface, making it impossible to locate them. For example, assuming the storage path is: D:\test1\test2\......\test, since the test1 folder contains many subfolders, when test1 is located and expanded, test2 may not be displayed in the interface. Therefore, it is impossible to locate and select the test2 folder, making it difficult to locate the final file "test". Based on this, the embodiments of the present invention can adopt... Figure 2B The implementation method is to solve the problem of being unable to locate the target file in the above scenario.

[0040] like Figure 2B As shown, is Figure 2A A flowchart illustrating an embodiment of step S24 includes the following steps:

[0041] Step S240: Identify the first letter of the first element.

[0042] Step S241: Calculate the first value. Based on the storage path, determine the number of elements with the first letter in the folder where the first element is located as the first value.

[0043] Step S242: When locating the first element, update the value of i according to the formula i = i + 1, where the initial value of i is 0.

[0044] Step S243: Determine if i is less than or equal to the first value. If it is less than or equal to the first value, proceed to step S244. If it is greater than the first value, proceed to step S247.

[0045] Step S244: Simulate input of the first letter of the first element to locate candidate elements that have that first letter.

[0046] Step S245: Determine whether the candidate element located in step S244 matches the first element. If they match, proceed to step S246. If they do not match, proceed to step S242.

[0047] Step S246: Locate the first element.

[0048] Step S247: The message indicates that the storage path does not exist.

[0049] Even if the first element is not displayed in the file selection window, this embodiment can still automatically locate it, thus ensuring that the target file is selected accurately in an automated manner.

[0050] Additionally, for elements that can be displayed in the file selection window, image recognition can be used to locate them. When image recognition fails to locate the element, other methods can be used... Figure 2B In this way. For example, as Figure 2C As shown, is Figure 2A A flowchart illustrating another embodiment of step S24 is shown, the process including the following steps:

[0051] Step S2400: Using image recognition technology, identify the first element in the file selection window.

[0052] Step S2401: Determine whether the first element can be identified. If it can be identified, proceed to step S2402. If it cannot be identified, proceed to step S2403.

[0053] Step S2402: Simulate a mouse click on the first element. For example, simulate moving the mouse to the location of the first element and clicking it.

[0054] Step S2403: Execute Figure 2B Step S240 in the process.

[0055] like Figure 3A The diagram shown is a flowchart illustrating another embodiment of the object file processing method of the present invention. Figure 3A and Figure 2A Most of the steps are the same, so the same steps (such as steps S30, S34 to S38) can be referred to the above description and will not be repeated here. Figure 3A and Figure 2A The main difference is that, Figure 3A After launching the file selection window, maximize the file selection window, i.e., step S32. Specifically, as follows: Figure 3B The diagram shown is a flowchart of an embodiment of step S32. It includes: in step S321, obtaining the screen resolution; in step S322, moving the file selection window to the screen's origin coordinates, such as coordinates (0, 0), or the upper left corner; and in step S323, enlarging the file selection window to the same size as the screen resolution, thereby maximizing the file selection window.

[0056] In some scenarios, due to differences in screen configuration and settings, the file selection window may exhibit varying offsets when launched. On some screens, the entire window may be displayed, while on others, only a portion may be visible. Maximizing the window resolves this offset issue and also maximizes the display of more information, facilitating the selection of the target file.

[0057] like Figure 4 The diagram shows a schematic representation of an embodiment of the target file processing apparatus of the present invention. This processing apparatus 4 is capable of automatically selecting a target file and includes: a startup module 40 for launching a file selection window; an acquisition module 41 for acquiring the storage path of the target file, the storage path including a first element; a processing module 42 for simulating a mouse to automatically locate and click elements in the storage path sequentially in the file selection window until the target file is located; and a selection module 43 for selecting the target file.

[0058] The processing module 42 includes: a recognition unit 421 for recognizing the first letter of a first element; a calculation unit 422 for determining, based on the storage path, the number of elements containing the first letter in the folder containing the first element as a first value; and a simulation unit 423 for simulating input of the first letter when the folder containing the first element is opened, to locate candidate elements containing that first letter. A processing unit 424 is used to determine whether the candidate element matches the first element; if they match, the first element is located; if they do not match, the simulation of inputting the first letter continues to locate other candidate elements until the first element is located, or the number of times the first letter is simulated equals the first value.

[0059] It should be noted that, Figure 4 The details of each module or unit involved in the embodiments have been described in the foregoing method embodiments and will not be repeated here.

[0060] like Figure 5 The diagram shown is a structural schematic of an embodiment of a computer device according to the present invention. The computer device 5 includes: a processor 50; and a memory 52 for storing executable instructions of the processor; wherein the processor is configured to execute the executable instructions to implement a method according to the present invention.

[0061] In addition, embodiments of the present invention also provide a computer-readable storage medium storing a computer program thereon, the computer program including executable instructions, which, when executed by a processor, implement the processing method according to embodiments of the present invention.

[0062] The descriptions of the storage medium and device embodiments above are similar to those of the method embodiments above, and have similar beneficial effects. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0063] The aforementioned processor can be at least one of the following: Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), Central Processing Unit (CPU), controller, microcontroller, microprocessor, etc. It is understood that other electronic devices can also implement the functions of the aforementioned processor, and this application does not specifically limit the specific implementation.

[0064] The aforementioned computer storage media / memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random-access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM), etc.; or it can be various terminals that include one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.

[0065] It should be noted that the above description is merely illustrative and not intended to limit the invention. In other embodiments of the invention, the method may have more, fewer, or different steps, and the order, inclusion, and functional relationships between the steps may differ from those described and illustrated. For example, multiple steps may typically be combined into a single step, or a single step may be split into multiple steps. For those skilled in the art, variations in the order of the steps are also within the scope of protection of this invention without inventive effort.

[0066] The technical solution of the present invention, 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. The computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor or microcontroller to execute all or part of the steps of the methods described in the various embodiments of the present invention.

[0067] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware associated with program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments.

[0068] While the present invention has been disclosed above with reference to preferred embodiments, it is not limited thereto. Any modifications and alterations made by those skilled in the art without departing from the spirit and scope of the invention should be included within the scope of protection of the invention. Therefore, the scope of protection of the invention should be determined by the scope defined in the claims.

Claims

1. A method for processing target files, used to automatically select target files, characterized in that, include: Start the file selection window; Obtain the storage path of the target file and divide the storage path to identify multiple elements contained in the storage path; wherein, the multiple elements have an order relationship, and the multiple elements include: a first element, wherein the file name of the target file is the last of the multiple elements; Based on the aforementioned sequential relationship, the file selection window automatically locates and clicks on each element in the storage path sequentially until the target file is located; and Select the target file; The step of automatically locating and selecting each element in the storage path sequentially in the file selection window includes: Image recognition technology is used to identify the first element in the file selection window; When the first element is detected, click on the first element automatically; If the first element is not identified, simulate input of the first letter of the first element to locate the candidate element with that first letter; determine whether the candidate element matches the first element; if they match, locate the first element; if they do not match, continue to simulate input of the first letter until the first element is located, or, the number of times the first letter is simulated is equal to a first value. The first value is the number of elements in the folder containing the first element that have the first letter.

2. The method for processing target files as described in claim 1, characterized in that, If the number of simulated inputs of the first letter equals the first value and the first element is still not matched, then the message "the storage path does not exist" will be displayed.

3. The method for processing target files as described in claim 1, characterized in that, Before automatically locating and selecting elements in the storage path in the file selection window, the file selection window is maximized.

4. The method for processing target files as described in claim 3, characterized in that, The step of maximizing the file selection window includes: Get the screen resolution; Move the file selection window to the origin coordinates of the screen; and Enlarge the file selection window to the same size as the screen resolution.

5. A target file processing apparatus for automatically selecting target files, characterized in that, include: The startup module is used to launch the file selection window; An acquisition module is used to acquire the storage path of the target file and divide the storage path to identify multiple elements contained in the storage path; wherein, the order relationship between the multiple elements includes: a first element, wherein the file name of the target file is the last of the multiple elements; The processing module is configured to automatically locate and click on elements in the storage path sequentially in the file selection window according to the stated order, until the target file is located; and The selection module is used to select the target file; The step of automatically locating and selecting elements in the storage path sequentially in the file selection window includes: Image recognition technology is used to identify the first element in the file selection window; When the first element is detected, click on the first element automatically; If the first element is not identified, simulate input of the first letter of the first element to locate the candidate element with that first letter; determine whether the candidate element matches the first element; if they match, locate the first element; if they do not match, continue to simulate input of the first letter until the first element is located, or, the number of times the first letter is simulated is equal to a first value. The first value is the number of elements in the folder containing the first element that have the first letter.

6. A computer device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the executable instructions to implement the processing method according to any one of claims 1 to 4.

7. A computer-readable storage medium having a computer program stored thereon, the computer program including executable instructions that, when executed by a processor, implement the processing method according to any one of claims 1 to 4.