# US 2025/0168167 A1 · Rule searching method and apparatus, device, and computer-readable storage medium

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

- Number: US 2025/0168167 A1
- Document ID: US20250168167A1
- Status: Published application
- Kind: A1
- Application number: 19/029,751
- Filed: 2025-01-17
- Published: 2025-05-22
- Earliest claimed: 2022-07-20
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Shuzhen TIAN; Jing HU
- Web page: https://patentgrep.com/patent/US20250168167A1

## CPC

- G06F 16/906: Clustering; Classification
- H04L 63/10: {for controlling access to devices or network resources}
- G06F 21/604: {Tools and structures for managing or administering access control systems}
- H04L 47/2441: relying on flow classification, e.g. using integrated services [IntServ]
- H04L 63/0263: {Rule management}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

This application discloses a rule searching method and apparatus, a device, and a computer-readable storage medium. The method includes: obtaining a first feature of a first packet; determining a second feature matching the first feature, where the second feature is obtained based on a first access control rule included in a first rule set, the second feature is one or more of features corresponding to a first type rule set, the first type rule set includes the first rule set and a second rule set, the first rule set includes at least one first access control rule, and the second rule set includes at least one second access control rule; and searching the at least one first access control rule for a target rule matching the first packet.

## Claims

### Claim 1

A rule searching method, comprising:
obtaining a first feature of a first packet;
determining a second feature matching the first feature, wherein
the second feature is obtained based on at least one first access control rule comprised in a first rule set;
the second feature is one or more of features corresponding to a first type rule set;
the first type rule set comprises the first rule set and a second rule set;
the first rule set comprises at least one first access control rule;
the second rule set comprises at least one second access control rule; and
the at least one first access control rule is different from the at least one second access control rule; and
searching the at least one first access control rule for a target rule matching the first packet.

### Claim 2 (depends on 1)

The method according to claim 1, wherein before the determining the second feature matching the first feature, the method further comprises:
obtaining a common feature corresponding to the at least one first access control rule comprised in the first rule set;
using the common feature as the second feature; and
wherein the obtaining the first feature of the first packet further comprises:
extracting a first field that is in the first packet and that corresponds to the common feature; and
using information about the first field as the first feature of the first packet.

### Claim 3 (depends on 2)

The method according to claim 2, wherein the obtaining the common feature corresponding to the at least one first access control rule comprised in the first rule set comprises:
extracting a same field of each of the at least one first access control rule comprised in the first rule set; and
determining information about the same field as the common feature corresponding to the at least one first access control rule comprised in the first rule set.

### Claim 4 (depends on 1)

The method according to claim 1, wherein before the determining the second feature matches the first feature, the method further comprises:
obtaining target content corresponding to the at least one first access control rule comprised in the first rule set;
mapping the target content to obtain a mapping value;
using the mapping value as the second feature, wherein the target content is all or a part of content of the first access control rule; and
the obtaining the first feature of the first packet further comprises:
extracting a second field that is in the first packet and that corresponds to the target content;
mapping a value of the second field; and
using an obtained mapping value as the first feature of the first packet.

### Claim 5 (depends on 1)

The method according to claim 1, wherein the searching the at least one first access control rule for the target rule matching the first packet comprises:
determining, in the at least one first access control rule comprised in the first rule set, a reference rule matching the first packet; and
determining, when there are a plurality of reference rules matching the first packet, a highest-priority reference rule in the plurality of reference rules as the target rule.

### Claim 6 (depends on 1)

The method according to claim 1, wherein the method further comprises:
obtaining a third feature of a second packet;
determining, in a process of searching for the target rule corresponding to the first packet, a fourth feature matching the third feature, wherein
the fourth feature is obtained based on a third access control rule comprised in a third rule set;
the fourth feature is one or more of features corresponding to a second type rule set;
the second type rule set comprises the third rule set and a fourth rule set;
the third rule set comprises at least one third access control rule;
the fourth rule set comprises at least one fourth access control rule; and
the at least one third access control rule is different from the at least one fourth access control rule; and
searching the at least one third access control rule for a target rule matching the second packet.

### Claim 7 (depends on 6)

The method according to claim 6, wherein the second type rule set and the first type rule set are different rule sets.

### Claim 8 (depends on 6)

The method according to claim 6, wherein
the second type rule set and the first type rule set are a same rule set; and
the searching the at least one first access control rule for the target rule matching the first packet comprises:
selecting, on a basis that a quantity of first rule sets is greater than a first quantity, the first quantity of first rule sets from a plurality of first rule sets, wherein the first quantity is determined based on a quantity of rule sets comprised in the first type rule set; and
sequentially searching, based on the first quantity, the at least one first access control rule comprised in the plurality of first rule sets for the target rule matching the first packet.

### Claim 9 (depends on 1)

The method according to claim 1, wherein before the determining the second feature matching the first feature, the method further comprises:
obtaining a plurality of initial access control rules; and
dividing different initial access control rules into a corresponding rule set based on a similarity between the plurality of initial access control rules and a quantity of rule sets, to obtain the first type rule set.

### Claim 10

A rule searching apparatus, wherein the apparatus comprises:
a non-transitory memory storing instructions; and
a processor coupled to the non-transitory memory; wherein the instructions, when executed by the processor, cause the apparatus to:
obtain a first feature of a first packet;
determine a second feature matching the first feature, wherein
the second feature is obtained based on at least one first access control rule comprised in a first rule set;
the second feature is one or more of features corresponding to a first type rule set;
the first type rule set comprises the first rule set and a second rule set;
the first rule set comprises at least one first access control rule;
the second rule set comprises at least one second access control rule; and
the at least one first access control rule is different from the at least one second access control rule; and
search the at least one first access control rule for a target rule matching the first packet.

### Claim 11 (depends on 10)

The apparatus according to claim 10, wherein the instructions, when executed by the processor, further cause the apparatus to:
obtain a common feature corresponding to the first access control rule comprised in the first rule set;
use the common feature as the second feature;
extract a first field that is in the first packet and that corresponds to the common feature; and
use information about the first field as the first feature of the first packet.

### Claim 12 (depends on 11)

The apparatus according to claim 11, wherein the instructions, when executed by the processor, further cause the apparatus to:
extract a same field of each of the at least one first access control rule comprised in the first rule set, and determine information about the same field as the common feature corresponding to the first access control rule comprised in the first rule set.

### Claim 13 (depends on 10)

The apparatus according to claim 10, wherein the instructions, when executed by the processor, further cause the apparatus to:
obtain target content corresponding to the at least one first access control rule comprised in the first rule set;
map the target content to obtain a mapping value;
use the mapping value as the second feature, wherein the target content is all or a part of content of the first access control rule;
extract a second field that is in the first packet and that corresponds to the target content;
map a value of the second field; and
use an obtained mapping value as the first feature of the first packet.

### Claim 14 (depends on 10)

The apparatus according to claim 10, wherein the instructions, when executed by the processor, further cause the apparatus to:
determine, in the at least one first access control rule comprised in the first rule set, a reference rule matching the first packet; and
determine, when there are a plurality of reference rules matching the first packet, a highest-priority reference rule in the plurality of reference rules as the target rule.

### Claim 15 (depends on 10)

The apparatus according to claim 10, wherein the instructions, when executed by the processor, further cause the apparatus to:
obtain a third feature of a second packet;
determine, in a process of searching for the target rule corresponding to the first packet, a fourth feature matching the third feature, wherein
the fourth feature is obtained based on a third access control rule comprised in a third rule set;
the fourth feature is one or more of features corresponding to a second type rule set;
the second type rule set comprises the third rule set and a fourth rule set;
the third rule set comprises at least one third access control rule;
the fourth rule set comprises at least one fourth access control rule; and
the at least one third access control rule is different from the at least one fourth access control rule; and
search the at least one third access control rule for a target rule matching the second packet.

### Claim 16 (depends on 15)

The apparatus according to claim 15, wherein the second type rule set and the first type rule set are different rule sets.

### Claim 17 (depends on 15)

The apparatus according to claim 15, wherein
the second type rule set and the first type rule set are a same rule set; and
the instructions, when executed by the processor, further cause the apparatus to:
select, on a basis that a quantity of first rule sets is greater than a first quantity, the first quantity of first rule sets from a plurality of first rule sets, wherein the first quantity is determined based on a quantity of rule sets comprised in the first type rule set; and
sequentially search, based on the first quantity, the at least one first access control rules comprised in the plurality of first rule sets for the target rule matching the first packet.

### Claim 18 (depends on 10)

The apparatus according to claim 10, wherein the instructions, when executed by the processor, further cause the apparatus to:
obtain a plurality of initial access control rules; and
divide different initial access control rules into one or more corresponding rule sets based on a similarity between the plurality of initial access control rules and a quantity of rule sets, to obtain the first type rule set.

### Claim 19

A chip, comprising:
a processor, wherein the processor is configured to:
obtain a first feature of a first packet;
determine a second feature matching the first feature, wherein
the second feature is obtained based on at least one first access control rule comprised in a first rule set;
the second feature is one or more of features corresponding to a first type rule set;
the first type rule set comprises the first rule set and a second rule set;
the first rule set comprises at least one first access control rule;
the second rule set comprises at least one second access control rule; and
the at least one first access control rule is different from the at least one second access control rule; and
search the at least one first access control rule for a target rule matching the first packet.

### Claim 20 (depends on 19)

The chip according to claim 19, further comprising:
an input interface;
an output interface; and
a memory, wherein the input interface, the output interface, the processor, and the memory are connected through an internal connection path.
