# US 12,222,897 B2 · File storage location determining method and apparatus, and terminal

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 12,222,897 B2
- Document ID: US12222897B2
- Status: Granted
- Kind: B2
- Application number: 18/017,019
- Filed: 2021-07-26
- Published: 2024-09-05
- Granted: 2025-02-11
- Earliest claimed: 2020-07-31
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Lianbo Zou; Wei Zhang; Puliang Luo
- Web page: https://patentgrep.com/patent/US12222897B2

## CPC

- G06F 16/14: Details of searching files based on file metadata
- G06F 16/13: File access structures, e.g. distributed indices (arrangements of input from, or output to, record carriers G06F3/06)
- H04W 4/80: Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04W: WIRELESS COMMUNICATION NETWORKS (broadcast communication H04H; communication systems using wireless links for non-selective communication, e.g. wireless extensions H04M1/72)

## Abstract

Embodiments of this application are applicable to the field of terminal technologies, and provide a file storage location determining method and apparatus, and a terminal. The method includes: A first terminal determines a plurality of candidate paths corresponding to a target file. Each candidate path points to one file storage location. The first terminal obtains file information of the target file. The first terminal determines, based on the file information and the plurality of candidate paths, a file storage location pointed to by a first candidate path in the plurality of candidate paths as a storage location of the target file. A matching degree of the first candidate path is a highest matching degree in matching degrees of the plurality of candidate paths. According to the foregoing method, accuracy of determining the file storage location is improved.

## Claims

### Claim 1

A file storage location determining method, comprising:
determining, by a first terminal, a plurality of candidate paths corresponding to a target file, wherein each candidate path points to one file storage location;
obtaining, by the first terminal, file information of the target file; and
determining, by the first terminal based on the file information and the plurality of candidate paths, a file storage location pointed to by a first candidate path in the plurality of candidate paths as a storage location of the target file, wherein a matching degree of the first candidate path is the highest matching degree in matching degrees of the plurality of candidate paths; wherein the method further comprises:
if there are a plurality of candidate paths corresponding to the highest matching degree, determining, by the first terminal, a priority of each candidate path corresponding to the highest matching degree, wherein the priority of the candidate path is obtained based on a priority of a manner of determining the candidate path; and
determining, by the first terminal as the storage location of the target file, a file storage location pointed to by a candidate path with the highest priority in the plurality of candidate paths corresponding to the highest matching degree.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the determining, by the first terminal, the plurality of candidate paths corresponding to the target file comprises:
determining, by the first terminal, the plurality of candidate paths corresponding to the target file in one or more of the following manners: object linking and embedding interface invoking, file searching, reading of information about recently used files, or command line parsing.

### Claim 3 (depends on 1)

The method according to claim 1, wherein the obtaining, by the first terminal, the file information of the target file comprises:
obtaining, by the first terminal, window information of the target file, wherein the window information is information displayed at a preset location of the target file; and
determining, by the first terminal, the file information of the target file based on the window information.

### Claim 4 (depends on 1)

The method according to claim 1, wherein the method further comprises:
determining, by the first terminal, a matching degree of each of the plurality of candidate paths based on the file information.

### Claim 5 (depends on 4)

The method according to claim 4, wherein the determining, by the first terminal, the matching degree of each of the plurality of candidate paths based on the file information comprises:
processing, by the first terminal, the file information of the target file in at least one of a preset first processing manner or a preset second processing manner, to obtain a corresponding processing result, wherein precision of the first processing manner is higher than precision of the second processing manner; and
determining, by the first terminal, the matching degree of each of the plurality of candidate paths based on the processing result and path information comprised in each candidate path.

### Claim 6 (depends on 5)

The method according to claim 5, wherein the determining, by the first terminal, the matching degree of each of the plurality of candidate paths based on the processing result and path information comprised in each candidate path comprises:
if path information of a second candidate path comprises the processing result of the first processing manner, determining, by the first terminal, a matching degree of the second candidate path as a first matching degree, wherein the processing result of the first processing manner is a character string comprising the file information, and the second candidate path is any of the plurality of candidate paths; or
if the path information of the second candidate path does not comprise the processing result of the first processing manner, determining, by the first terminal, the matching degree of the second candidate path based on the processing result of the second processing manner and the path information comprised in the second candidate path, wherein the processing result of the second processing manner comprises a plurality of features of the target file, and each feature is in a one-to-one correspondence with each substring in the character string.

### Claim 7 (depends on 6)

The method according to claim 6, wherein the determining, by the first terminal, the matching degree of the second candidate path based on the processing result of the second processing manner and the path information comprised in the second candidate path comprises:
if a quantity of features of the target file that are comprised in the path information of the second candidate path is greater than or equal to a first threshold, determining, by the first terminal, the matching degree of the second candidate path as a second matching degree, wherein the second matching degree is less than the first matching degree;
if the quantity of features of the target file that are comprised in the path information of the second candidate path is greater than or equal to a second threshold and less than the first threshold, determining, by the first terminal, the matching degree of the second candidate path as a third matching degree, wherein the third matching degree is less than the second matching degree; or
if the quantity of features of the target file that are comprised in the path information of the second candidate path is less than the second threshold, determining, by the first terminal, the matching degree of the second candidate path as a fourth matching degree, wherein the fourth matching degree is less than the third matching degree.

### Claim 8 (depends on 1)

The method according to claim 1, wherein a priority relationship between a plurality of manners of determining the candidate path is as follows:
a priority of the file searching is higher than a priority of the object linking and embedding interface invoking, the priority of the object linking and embedding interface invoking is higher than a priority of the command line parsing, and the priority of the command line parsing is higher than a priority of the reading of information about recently used files.

### Claim 9 (depends on 1)

The method according to claim 1, wherein the method further comprises:
obtaining, by the first terminal, the target file from the storage location; and
sending, by the first terminal, the target file to a second terminal.

### Claim 10

A terminal, comprising:
a processor, and
a non-transitory memory coupled to the processor and configured to store a computer program comprising instructions that, when executed by the processor, cause the terminal to perform:
determining a plurality of candidate paths corresponding to a target file, wherein each candidate path points to one file storage location;
obtaining file information of the target file; and
determining, based on the file information and the plurality of candidate paths, a file storage location pointed to by a first candidate path in the plurality of candidate paths as a storage location of the target file, wherein a matching degree of the first candidate path is the highest matching degree in matching degrees of the plurality of candidate paths, wherein the instructions further cause the terminal to perform:
if there are a plurality of candidate paths corresponding to the highest matching degree, determining a priority of each candidate path corresponding to the highest matching degree, wherein the priority of the candidate path is obtained based on a priority of a manner of determining the candidate path; and
determining, as the storage location of the target file, a file storage location pointed to by a candidate path with the highest priority in the plurality of candidate paths corresponding to the highest matching degree.

### Claim 11 (depends on 10)

The terminal according to claim 10, wherein the determining the plurality of candidate paths corresponding to the target file comprises:
determining the plurality of candidate paths corresponding to the target file in one or more of the following manners: object linking and embedding interface invoking, file searching, reading of information about recently used files, or command line parsing.

### Claim 12 (depends on 10)

The terminal according to claim 10, wherein the obtaining the file information of the target file comprises:
obtaining window information of the target file, wherein the window information is information displayed at a preset location of the target file; and
determining the file information of the target file based on the window information.

### Claim 13 (depends on 10)

The terminal according to claim 10, wherein the computer program further comprises instructions that, when executed by the processor, cause the terminal to perform
determining a matching degree of each of the plurality of candidate paths based on the file information.

### Claim 14 (depends on 13)

The terminal according to claim 13, wherein the determining the matching degree of each of the plurality of candidate paths based on the file information comprises:
processing the file information of the target file in a preset first processing manner and/or a preset second processing manner, to obtain a corresponding processing result, wherein precision of the first processing manner is higher than precision of the second processing manner; and
determining the matching degree of each of the plurality of candidate paths based on the processing result and path information comprised in each candidate path.

### Claim 15 (depends on 14)

The terminal according to claim 14, wherein the determining the matching degree of each of the plurality of candidate paths based on the processing result and path information comprised in each candidate path comprises:
if path information of a second candidate path comprises the processing result of the first processing manner, determining a matching degree of the second candidate path as a first matching degree, wherein the processing result of the first processing manner is a character string comprising the file information, and the second candidate path is any of the plurality of candidate paths; or
if the path information of the second candidate path does not comprise the processing result of the first processing manner, determining the matching degree of the second candidate path based on the processing result of the second processing manner and the path information comprised in the second candidate path, wherein the processing result of the second processing manner comprises a plurality of features of the target file, and each feature is in a one-to-one correspondence with each substring in the character string.

### Claim 16 (depends on 15)

The terminal according to claim 15, wherein the determining the matching degree of the second candidate path based on the processing result of the second processing manner and the path information comprised in the second candidate path comprises:
if a quantity of features of the target file that are comprised in the path information of the second candidate path is greater than or equal to a first threshold, determining the matching degree of the second candidate path as a second matching degree, wherein the second matching degree is less than the first matching degree;
if the quantity of features of the target file that are comprised in the path information of the second candidate path is greater than or equal to a second threshold and less than the first threshold, determining the matching degree of the second candidate path as a third matching degree, wherein the third matching degree is less than the second matching degree; or
if the quantity of features of the target file that are comprised in the path information of the second candidate path is less than the second threshold, determining the matching degree of the second candidate path as a fourth matching degree, wherein the fourth matching degree is less than the third matching degree.

### Claim 17 (depends on 10)

The terminal according to claim 10, wherein a priority relationship between a plurality of manners of determining the candidate path is as follows:
a priority of the file searching is higher than a priority of the object linking and embedding interface invoking, the priority of the object linking and embedding interface invoking is higher than a priority of the command line parsing, and the priority of the command line parsing is higher than a priority of the reading of information about recently used files.

### Claim 18

A non-transitory computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions that, when executed by a processor of a terminal, cause the terminal to perform:
determining a plurality of candidate paths corresponding to a target file, wherein each candidate path points to one file storage location;
obtaining file information of the target file; and
determining, based on the file information and the plurality of candidate paths, a file storage location pointed to by a first candidate path in the plurality of candidate paths as a storage location of the target file, wherein a matching degree of the first candidate path is the highest matching degree in matching degrees of the plurality of candidate paths, wherein the computer instructions further cause the terminal to perform:
if there are a plurality of candidate paths corresponding to the highest matching degree, determining a priority of each candidate path corresponding to the highest matching degree, wherein the priority of the candidate path is obtained based on a priority of a manner of determining the candidate path; and
determining, as the storage location of the target file, a file storage location pointed to by a candidate path with the highest priority in the plurality of candidate paths corresponding to the highest matching degree.
