CN-121985070-A - Policy execution method and device and electronic equipment
Abstract
The embodiment of the application discloses a policy execution method, a device and electronic equipment, wherein the method comprises the steps of receiving a telephone traffic request, extracting key information in the telephone traffic request, obtaining first index information, screening a policy set in a policy library according to the key information and the first index information, splitting the policy set into a hot spot policy set and a conventional policy set according to policy types, performing policy matching on the telephone traffic request in the hot spot policy set by using a field programmable gate array FPGA circuit, performing policy matching on the telephone traffic request in the conventional policy set by using a single instruction stream multiple data stream SIMD engine until the policy matching is successful, and executing actions corresponding to the successfully matched policies.
Inventors
- LI LIMIN
- HU SHUO
- JIANG JUN
- WANG YINGTONG
- SHI GUANNAN
- WANG HANGYU
- WANG YANMEI
- ZHAO HUILI
- WU CHAO
- Lei Chunhui
Assignees
- 中移在线服务有限公司
- 中国移动通信集团有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20251219
Claims (10)
- 1. A policy enforcement method, said method comprising: receiving a traffic request; extracting key information in the telephone traffic request, and acquiring first index information; Screening a strategy set from a strategy library according to the key information and the first index information; Splitting the strategy set into a hot spot strategy set and a conventional strategy set according to strategy types; performing policy matching on the traffic request in the hot spot policy set by using a Field Programmable Gate Array (FPGA) circuit, and performing policy matching on the traffic request in the conventional policy set by using a single instruction Stream (SIMD) engine until the policy matching is successful; And executing the action corresponding to the strategy with successful matching.
- 2. The method of claim 1, wherein the key information includes channel information and a timestamp, and wherein screening the policy set from the policy repository based on the key information and the first index information includes: Selecting strategies associated with the channel information from the strategy library to obtain a first subset; selecting strategies which are effective in the time period of the time stamp from the strategy library to obtain a second subset; Aiming at the strategies containing the first conditions related to the first index information in the strategy library, eliminating the strategies of which the first index information does not meet the first conditions, and taking the residual strategies in the strategy library after the elimination operation as a third subset; and merging the second subset and the third subset, then taking an intersection with the first subset, and then performing deduplication to obtain a policy set.
- 3. The method of claim 1, wherein said using field programmable gate array FPGA circuitry to policy match the traffic request in the set of hotspot policies comprises: Constructing the hotspot policies in the hotspot policy set into abstract syntax trees through a syntax parser; eliminating redundant conditions and combining similar conditions for the hotspot strategy in the abstract syntax tree; generating a hardware description language code by the abstract syntax tree, compiling to obtain a bit stream, and storing the bit stream in a memory of the FPGA circuit; and operating the FPGA circuit to carry out strategy matching on the telephone traffic request.
- 4. A method according to claim 3, further comprising: Counting the number of strategies processed by the FPGA circuit in real time; and under the condition that the number of strategies is larger than the overload threshold, transferring the hot spot strategy with the heat lower than the specified threshold to the SIMD engine for processing.
- 5. The method of claim 1, wherein said policy matching the traffic request in the regular policy set using a single instruction stream multiple data stream SIMD engine comprises: extracting service features from the traffic request; Storing the regular policies in the regular policy set in a vector register of the SIMD engine in the form of policy packets, wherein one policy packet contains a plurality of regular policies; Using one SIMD instruction to process a plurality of conventional strategies in the vector register in parallel aiming at each service feature, and eliminating conventional strategies which are not satisfied by the service feature; combining and deduplicating conventional strategies obtained after each service feature is subjected to the rejection operation; and in the merging and de-duplication results, carrying out policy matching according to the priority of the policy package from high to low and the order of the priority of the policies from high to low in the same policy package aiming at the traffic request.
- 6. The method of claim 5, wherein the plurality of regular policies in the vector register are stored in columns, wherein a starting address of each data column is aligned with a central processing unit CPU cache line.
- 7. The method as recited in claim 1, further comprising: Setting a default type as a conventional strategy for each new strategy in the strategy library; And regularly calculating the heat of each newly added strategy, and if the heat is greater than a heat threshold, modifying the type of the strategy into a hot spot strategy, wherein the heat is calculated according to the following formula: ; wherein HeatScore is heat, E is the number of times of strategy hit in a sliding time window, T is the length of the sliding time window, C is the average calculation cost of strategy matching, B is the calculation cost of a reference strategy, and the units of C and B are CPU cycles.
- 8. An electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, which when executed by the processor implements the steps of the policy enforcement method of any of claims 1 to 7.
- 9. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the policy enforcement method according to any of claims 1 to 7.
- 10. A computer program product comprising a computer program which, when executed by a processor, implements the steps of the policy enforcement method of any of claims 1 to 7.
Description
Policy execution method and device and electronic equipment Technical Field The present application relates to the field of communications technologies, and in particular, to a policy enforcement method, a policy enforcement device, and an electronic device. Background At present, in a communication traffic system, a policy execution mode based on a rule engine is generally adopted, a service personnel configures a 'condition-action' policy through a visual interface, and the system relies on the rule engine such as Drools to dynamically analyze policy logic. The core of the rule engine is a rule network constructed by a Rete algorithm, and the matching efficiency is optimized through sharing condition nodes. However, the rule engine uses a full-scale traversal mechanism to scan the ten-thousand-level policy library, so that a large amount of calculation force is consumed on invalid matching irrelevant to the current service, the service response is slow, the average response time reaches 2-3 seconds, and the efficiency is low in far-beyond 1 second red line in the communication industry. Disclosure of Invention The embodiment of the application aims to provide a policy execution method, a policy execution device and electronic equipment, so as to solve the problems in the prior art. In order to solve the technical problems, the embodiment of the application is realized as follows: in a first aspect, a policy enforcement method provided by an embodiment of the present application includes: receiving a traffic request; extracting key information in the telephone traffic request, and acquiring first index information; Screening a strategy set from a strategy library according to the key information and the first index information; Splitting the strategy set into a hot spot strategy set and a conventional strategy set according to strategy types; Performing policy matching on the traffic request in the hotspot policy set using a field programmable gate array (Field Programmable GATE ARRAY, FPGA) circuit, and performing policy matching on the traffic request in the regular policy set using a single instruction stream multiple data stream (Single Instruction Multiple Data, SIMD) engine until policy matching is successful; And executing the action corresponding to the strategy with successful matching. In a second aspect, an embodiment of the present application provides a policy enforcement device, including: A receiving module for receiving a traffic request; the acquisition module is used for extracting key information in the telephone traffic request and acquiring first index information; the screening module is used for screening a strategy set from a strategy library according to the key information and the first index information; The splitting module is used for splitting the strategy set into a hot point strategy set and a conventional strategy set according to the strategy type; The matching module is used for carrying out strategy matching on the telephone traffic request in the hot spot strategy set by using a Field Programmable Gate Array (FPGA) circuit, and carrying out strategy matching on the telephone traffic request in the conventional strategy set by using a single instruction Stream (SIMD) engine until the strategy matching is successful; and the execution module is used for executing the action corresponding to the successfully matched strategy. In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a memory, and a computer program stored on the memory and executable on the processor, where the computer program implements the steps of the policy enforcement method described above when executed by the processor. In a fourth aspect, embodiments of the present application provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the policy enforcement method described above. In a fifth aspect, an embodiment of the present application provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the policy enforcement method described above. As can be seen from the technical solution provided by the above embodiment of the present application, in the embodiment of the present application, by receiving a traffic request, extracting key information in the traffic request, obtaining first index information, screening a policy set in a policy library according to the key information and the first index information, splitting the policy set into a hotspot policy set and a conventional policy set according to a policy type, performing policy matching on the traffic request in the hotspot policy set by using an FPGA circuit, performing policy matching on the traffic request in the conventional policy set by using a SIMD engine until the policy matching is successful, performing an action correspo