Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Multithread-based pattern matching method and device and electronic device

A pattern matching and multi-threading technology, applied in the field of pattern matching, which can solve the problems of poor algorithm performance, low efficiency, and long time consumption.

Inactive Publication Date: 2019-03-29
南京中孚信息技术有限公司
View PDF3 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0002] At present, the AC (Aho-Corasick) algorithm is commonly used to perform pattern matching on the text to be scanned. However, the time complexity of the AC algorithm is determined by the number of bytes of the text to be scanned.
For the text to be scanned with a large number of bytes, it takes a long time to scan using the AC algorithm, and the performance of the algorithm is not good
Pattern matching in this way is less efficient

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Multithread-based pattern matching method and device and electronic device
  • Multithread-based pattern matching method and device and electronic device
  • Multithread-based pattern matching method and device and electronic device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0024] In order to make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of them. 的实施例。 Example. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.

[0025] At present, the AC algorithm is commonly used to perform pattern matching on the scanned text, but the time complexity of the AC algorithm is determined by the number of bytes of the text to be scanned. For example, when the number of bytes of the text to be scanned is n, the AC algorithm is used to scan, and the corresponding time complexity is O(n). It can be seen that for the text to b...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides a multithread-based pattern matching method and device and an electronic device, which relate to the technical field of pattern matching. The method comprises the following steps: obtaining the text to be scanned and the identification information of the text to be scanned; Wherein, the identification information comprises the number of bytes of the text to be scanned and the starting address of the text to be scanned; Starting a plurality of threads according to the number of bytes of the text to be scanned, and assigning numbers to each thread respectively; wherein Thenumber of multiple threads is incremented in arithmetic sequence. The first term of the arithmetic sequence is 0; Determining a start scan offset corresponding to each thread according to the start address of the text to be scanned and the number of each thread; loading The text to be scanned into a plurality of threads, and at the same time, scanning the text to be scanned by a pre-constructed state machine according to the initial scanning offset corresponding to the threads in each thread, so as to obtain a target pattern string matched with the state machine in the text to be scanned. Theinvention can effectively improve the efficiency of pattern matching.

Description

Technical field [0001] The present invention relates to the technical field of pattern matching, in particular to a method, device and electronic equipment for pattern matching based on multithreading. Background technique [0002] At present, the AC (Aho-Corasick) algorithm is commonly used to perform pattern matching on the scanned text. However, the time complexity of the AC algorithm is determined by the number of bytes of the text to be scanned. For the text to be scanned with a large number of bytes, it takes a long time to scan with the AC algorithm, and the performance of the algorithm is not good. Pattern matching in this way is less efficient. Summary of the invention [0003] In view of this, the purpose of the present invention is to provide a multi-thread-based pattern matching method, device and electronic device to effectively improve the efficiency of pattern matching. [0004] In the first aspect, an embodiment of the present invention provides a multi-thread-base...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06K9/62
CPCG06F18/22
Inventor 袁春峰曲志峰纪翀楼方平
Owner 南京中孚信息技术有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products