A multi-threaded data comparison method and system

By using edge and corner detection algorithms in a multi-threaded data comparison system to correct the complexity of the advertising sensitive word trie tree and limit the number of reconstructions, the problem of new advertising sensitive word recognition loopholes in advertising video frame images is solved and the recognition efficiency is improved. rate and processing efficiency.

CN118468871BActive Publication Date: 2024-10-11XIAMEN ZHONGLIAN CENTURY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410934579.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2024-10-11
Estimated Expiration
2044-07-12

AI Technical Summary

Technical Problem

When the existing multi-threaded data comparison technology identifies advertising sensitive words in advertising video frame images, there is a vulnerability that the new advertising sensitive word structure cannot be detected, resulting in low processing efficiency and inaccurate recognition.

Method used

By obtaining the advertising text in the advertising video frame image, the edge detection algorithm and the corner detection algorithm are used to determine the structural complexity and pinyin syllable complexity of the text, correct the complexity of the advertising sensitive word trie tree, and limit the number of reconstructions of the trie tree. Achieve efficient comparison of advertising video frame images.

Benefits of technology

It improves the recognition rate of advertising sensitive words, reduces the possibility of incorrect recognition and filtering of information, and improves the efficiency and accuracy of multi-thread processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118468871B_ABST
    Figure CN118468871B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of multi-threaded data comparison, and specifically to a multi-threaded data comparison method and system, the method comprising: obtaining an advertising video frame image output by a multi-threaded processing system, obtaining a trie tree of each advertising sensitive word in an advertising sensitive word library, determining the complexity of the advertising sensitive word by edge lines in all advertising text images and pinyin syllables of the advertising text in the advertising sensitive word; determining the structural complexity of the advertising sensitive word trie tree based on the depth and number of nodes of the advertising sensitive word trie tree; correcting the complexity based on the structural complexity, and determining the number of reconstructions of the advertising sensitive word trie tree based on the corrected complexity, thereby realizing advertising video frame image comparison. The present application aims to improve the detection efficiency of advertising sensitive words in advertising video files based on multi-threaded processing, while improving the recognition of new advertising sensitive words and reducing the possibility of misrecognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of multi-threaded data comparison, and in particular to a multi-threaded data comparison method and system. Background Art

[0002] In today's information society, big data processing and analysis has become an indispensable core capability in all walks of life. With the rapid growth of data volume and the increasing requirements for real-time and high efficiency, a large amount of text, pictures, and videos need to be manually judged every day to see if there are banned words or banned phrases. The workload of manual judgment is large and the processing is difficult. In the field of advertising risk control, there are many tasks to be processed, especially for video data. If a single-threaded system is used for advertising risk control detection, it often shows problems such as slow processing speed and low resource utilization. Therefore, this application adopts a multi-threaded system to process advertising video frame images, aiming to improve the efficiency of advertising image video frame processing.

[0003] In the traditional multi-threaded data comparison process, in the process of comparing advertising sensitive words, most of the existing technologies construct an advertising sensitive word library, and construct an advertising sensitive word trie by analyzing the advertising sensitive words, and complete the detection and filtering of advertising sensitive words through the DFA algorithm. However, since the construction of the advertising sensitive word library is manually collected and constructed, the construction of the advertising sensitive word trie tree is also manually constructed according to the structures such as radicals and pinyins that the collected advertising sensitive words may be split into, which leads to that when the DFA algorithm is used to identify according to the constructed Trie tree, some new advertising sensitive word formation methods or structures may not be detected, thereby missing these advertising sensitive words, reducing the processing efficiency of multi-threaded processing of advertising video files. Summary of the invention

[0004] In order to solve the above technical problems, the present application provides a multi-threaded data comparison method and system, and the technical solutions adopted are as follows:

[0005] In a first aspect, an embodiment of the present application provides a multi-threaded data comparison method, the method comprising the following steps:

[0006] Obtain the advertisement video frame image output by the multi-thread processing system, obtain the sensitive word trie tree of each sensitive word in the sensitive word library, and use character recognition technology to recognize the advertisement text in the advertisement video frame image;

[0007] The advertisement text in the advertisement video frame image is compared based on the advertisement sensitive word trie tree, and the data comparison process includes the following steps:

[0008] (1) Construct an advertising text image from each advertising text in the advertising video frame image; use an edge detection algorithm to obtain edge lines in the advertising text image;

[0009] (2) Determine the text structure complexity of each ad text based on the number of corner points on the edge line and the position distance distribution between the edge lines; take the pinyin syllable length of each ad text as the text pinyin syllable complexity of the corresponding ad text; determine the text complexity of each ad text based on the text structure complexity and the text pinyin syllable complexity of each ad text; take the sum of the text complexity of all ad texts in each ad sensitive word as the complexity of each ad sensitive word;

[0010] (3) Determine the structural complexity of the advertising sensitive word trie tree based on the depth and number of nodes of the advertising sensitive word trie tree; modify the complexity based on the structural complexity to determine the modified complexity of each advertising sensitive word; determine the number of reconstructions of the advertising sensitive word trie tree based on the modified complexity;

[0011] (4) Advertisement video frame image comparison is achieved based on the advertisement sensitive word trie tree and reconstruction times.

[0012] Preferably, the method for determining the complexity of the advertisement text structure includes:

[0013] Get the maximum similarity between each edge line and all other remaining edge lines;

[0014] Determine the edge complexity of each edge line based on the number of corner points on the edge line and their distribution;

[0015] Determine the advertisement text complexity correction coefficient of each advertisement text based on the position distribution difference between the edge lines;

[0016] Calculating the ratio of the edge complexity of each edge line to the maximum similarity; calculating the sum of the ratios of all edge lines of each advertisement text;

[0017] A normalized value of the product of the advertisement text complexity correction coefficient of each advertisement text and the sum value is calculated as the advertisement text structure complexity of each advertisement text.

[0018] Preferably, the method for determining the edge complexity includes:

[0019] Use corner detection algorithm to obtain the corner points of each edge line;

[0020] Using the corner points as dividing points, each edge line is divided into edge segments, and each edge segment is fitted with a straight line to obtain each edge line segment;

[0021] Calculate the slope of each edge segment, and use a clustering algorithm to cluster all the slopes on each edge line to obtain clusters;

[0022] Determine edge complexity based on the number of clusters and the number of corner points;

[0023] The number of clusters and the number of corner points are both positively correlated with the edge complexity.

[0024] Preferably, the method for determining the advertisement text complexity correction coefficient includes:

[0025] For the longest edge line among all the edge lines of each ad text, the center point of its minimum fitting circle is used as the anchor point;

[0026] All edge lines of each advertisement text are used as inputs of the clustering algorithm, and the Euclidean distance between the distance from the center of gravity of each edge line to the anchor point, the angle from the center of gravity to the anchor point, and the length of each edge line are used as the clustering distance of the clustering algorithm, and the edge line clustering cluster is output; the angle is the angle between the line from the center of gravity of each edge line to the anchor point and the horizontal rightward direction;

[0027] Calculate the average of the absolute values ​​of the differences between the angles of all elements in each edge line cluster; calculate the sum of the average values ​​of all edge line clusters, recorded as the first sum;

[0028] Calculate the difference between the number of edge lines of each advertisement text and the number of edge line clusters, and calculate the sum of the difference and the number 1, which is recorded as the second sum;

[0029] A normalized value of a sum of the first sum value and the second sum value is used as an advertisement text complexity correction coefficient of each advertisement text.

[0030] Preferably, the method for determining the complexity of the advertisement text includes:

[0031] When the number of edge lines of each advertisement text is 1, the number of edge lines is used as the advertisement text complexity of each advertisement text;

[0032] On the contrary, the product of the number of edge lines of each advertising text and the advertising text structure complexity is calculated, recorded as the first product, the advertising text pinyin syllable complexity of each advertising text is calculated, and the maximum value of the first product and the advertising text pinyin syllable complexity is taken as the advertising text complexity of each advertising text.

[0033] Preferably, the method for determining the structural complexity includes:

[0034] Get the perfect binary tree at the same depth corresponding to the trie tree of advertising sensitive words; get the number of nodes in the perfect binary tree;

[0035] Calculate the difference between the depth of the trie tree of sensitive advertising words and the number of advertising words, and record it as a first difference; calculate the ratio of the number of nodes in the trie tree of sensitive advertising words to the number of nodes in the perfect binary tree, and record it as a first ratio;

[0036] The product of the first difference and the first ratio is used as the structural complexity of the advertisement sensitive word trie tree.

[0037] Preferably, the modified complexity is obtained by a normalized value of the ratio of the complexity to the structural complexity.

[0038] Preferably, the method for determining the number of reconstruction times includes:

[0039] Calculating a sum of the first difference and a preset matching sensitivity coefficient;

[0040] The product of the summation result and the corrected complexity of the advertising sensitive words is used as the number of reconstructions of the advertising sensitive words trie tree.

[0041] Preferably, the method for implementing the advertisement video frame image comparison includes:

[0042] Mark the reconstruction times of each advertising sensitive word trie tree in the advertising sensitive word library;

[0043] Compare the advertisement video frame image with each advertisement sensitive word trie tree in the advertisement sensitive word library. When the comparison is successful, it means that the corresponding advertisement sensitive word is recognized in the advertisement video frame image. When the comparison fails, reconstruct the advertisement sensitive word trie tree again in combination with the remaining reconstruction times, and then continue to compare until the comparison is successful or the reconstruction times are used up.

[0044] The reconstruction process of each advertising sensitive word trie tree is as follows: starting from the second-layer node of each advertising sensitive word trie tree, a child node is added at the corresponding layer according to the number of reconstructions, and the child node is pointed to by the node that has been matched at the previous layer of the layer where it is located, and the child node points to all nodes pointed to by the node that has been matched at the previous layer of the layer where it is located, and all nodes of the next layer pointed to by all of the nodes; if a reconstruction has been performed before each reconstruction, the current child node inherits all the nodes pointed to by the child nodes of the previous layer, and the child nodes of the previous layer point to the current child node;

[0045] The sub-node can match all characters.

[0046] In a second aspect, an embodiment of the present application further provides a multi-threaded data comparison system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of any one of the above-mentioned methods when executing the computer program.

[0047] This application has at least the following beneficial effects:

[0048] The present application performs OCR extraction and analysis on advertisement video frame images through multi-threaded processing, and in each advertisement video frame image processing thread, performs analysis based on the complexity of advertisement text in advertisement sensitive words, obtains the complexity of advertisement text based on advertisement text edge features, and considers the interference of radicals composed of multiple edges on it, based on which the obtained complexity of advertisement text is corrected, and the reliability of the obtained complexity of advertisement text is increased, thereby indirectly affecting the reconstruction times of advertisement sensitive word trie tree by analyzing the strokes of corresponding advertisement text, avoiding the problem that the corresponding advertisement text in new advertisement sensitive words is difficult to recognize in complex cases, and at the same time avoiding the situation that the advertisement sensitive words are inaccurately recognized due to symbols or other irrelevant words that deliberately separate advertisement sensitive words, and improving the recognition rate of advertisement sensitive words with new structures; the present application takes into account advertisement sensitive words The structure of the trie tree affects the efficiency of identifying sensitive advertising words, and the structural complexity of the trie tree for sensitive advertising words is mined based on this. The greater the structural complexity of the trie tree for sensitive advertising words, the more situations it takes into account for identifying sensitive advertising words, which means that the trie tree for sensitive advertising words does not need to be reconstructed multiple times, thereby reducing the number of reconstructions of the trie tree for sensitive advertising words, more accurately identifying sensitive advertising words, and achieving better data comparison effects. The present application limits the number of reconstructions of the trie tree for sensitive advertising words, thereby reducing the possibility of reducing the accuracy of identifying sensitive advertising words due to too many or too few reconstructions, improves the recognition of new sensitive advertising words in advertising video frame images, and reduces the possibility of misidentification. At the same time, it effectively avoids the possibility of filtering out key information, and improves the efficiency of multi-threaded processing of sensitive advertising word detection in advertising video frame images. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0050] Figure 1 A flowchart of a multi-threaded data comparison method provided in this application;

[0051] Figure 2 This is a diagram of the trie tree for advertising sensitive words;

[0052] Figure 3 Reconstruct a schematic diagram of the advertising sensitive word trie tree at the second level;

[0053] Figure 4 Reconstruct a schematic diagram of the advertising sensitive word trie tree at the third level;

[0054] Figure 5 This is an example diagram of the trie tree for sensitive advertising words;

[0055] Figure 6 For example, the trie tree of advertising sensitive words is reconstructed once at the second level;

[0056] Figure 7 For example, the trie tree of advertising sensitive words is reconstructed twice at the second and third levels;

[0057] Figure 8 Construct a flow chart for the metric of number of reconstructions. DETAILED DESCRIPTION

[0058] In order to further explain the technical means and effects adopted by the present application to achieve the predetermined invention purpose, the following is a detailed description of a multi-threaded data comparison method and system proposed in the present application, its specific implementation method, structure, features and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0059] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.

[0060] The following is a detailed description of a multi-threaded data comparison method and system provided by the present application in conjunction with the accompanying drawings.

[0061] An embodiment of the present application provides a multi-threaded data comparison method and system.

[0062] Specifically, the following multi-threaded data comparison method is provided, please refer to Figure 1 , the method comprises the following steps:

[0063] Step S001, obtaining an advertisement video frame image output by a multi-thread processing system, obtaining an advertisement sensitive word trie tree of each advertisement sensitive word in an advertisement sensitive word library, and using character recognition technology to recognize advertisement text in the advertisement video frame image.

[0064] The present application aims to realize multi-threaded processing of the advertising video files input in the advertising risk control, identify new advertising sensitive words in the advertising video frame images, and thus achieve efficient multi-threaded data comparison effect.

[0065] The present application obtains the advertising video file and analyzes the advertising video frame image, which is obtained using the existing algorithm. It should be noted that the present application is based on a multi-threaded processing system for analysis, that is, multiple advertising video frame images can be obtained and analyzed synchronously at the same time, that is, the advertising video image processing process of each frame corresponds to a processing thread.

[0066] In one embodiment of the present application, the advertising video file is input into a multi-threaded processing system, the advertising video file transmitted to the system is split into a number of advertising video frame images and enters a reading queue for queuing, and then the advertising sensitive words are judged for the advertising video frame images in the queue to achieve data comparison processing.

[0067] Furthermore, for the advertisement video frame image in one of the threads, the OCR technology is used to obtain the text in the video frame image, and the text is recorded as the advertisement text. The OCR technology is a well-known technology and will not be described in detail.

[0068] In the data comparison process, this embodiment obtains an advertisement sensitive word library, which contains advertisement sensitive words and their advertisement sensitive word trie tree, to implement a data screening and judgment process in the data comparison process.

[0069] Step S002, performing data comparison on the advertisement text in the advertisement video frame image based on the advertisement sensitive word trie tree, wherein the data comparison process includes the following steps:

[0070] Since some new advertising sensitive words may appear in the process of comparing the data in the acquired advertising video frame images, by constructing the advertising sensitive word trie tree in the advertising sensitive word library, the advertising sensitive word trie tree is reconstructed in combination with the reconstruction times when the data comparison is unsuccessful, thereby completing the comparison of the advertising video frame images. The specific process of determining the reconstruction times is as follows:

[0071] In one embodiment of the present application, since the advertising video frame images are compared using an advertising sensitive word trie tree, sometimes advertising sensitive words will add symbols or other words without contextual meaning in the middle of key words to cover up the advertising sensitive words, so that the advertising sensitive words can be self-supplied, or the advertising sensitive words can be formed by keywords. For example, the advertising sensitive word is "123" and the text is "1*3". In this case, the advertising sensitive word can be thought of through association. Therefore, in the process of constructing the advertising sensitive word library, the constructed advertising sensitive word Trie tree needs to be modified.

[0072] In one embodiment of the present application, the schematic diagram of the advertisement sensitive word trie tree is as follows: Figure 2 As shown, the advertising sensitive word trie tree is reconstructed once at the second level. Figure 3shown.

[0073] It should be noted that in Figure 3 In the second layer, add a child node s, point all nodes in the previous layer of the child node s to the child node s, and point the child node s to all nodes in the next layer. That is, when reconstructing the dictionary tree, add a wildcard s that can match all forms of characters. For example, the sensitive word for an advertisement is "1234", and the text to be compared is "1*234". At this time, use Figure 2 When the advertising sensitive word trie tree is compared with the advertising sensitive word trie tree, the advertising sensitive word cannot be identified.

[0074] Therefore, this embodiment adds a universal match item s as an extension of the advertising sensitive word tree. In the case of 1 matching, the text "*" cannot find a matching item in the child node of 1 in the trie tree of the advertising sensitive word "1234". Therefore, the trie tree is reconstructed at this time, and a universal match item "s" is added so that the text "*" can be matched with it. The child nodes of the universal match item are the child node of 1 in the advertising sensitive word trie tree and all the child nodes of the next layer, that is, Figure 3 shown.

[0075] It should be noted that if the matching text is "12*34", when "2" in the text matches the "2" node in the trie tree, there is no child node that can be matched, then the universal matching item "s" in the corresponding reconstructed advertising sensitive word trie tree is added to the second layer of the trie tree, and the child nodes of the universal matching item "s" are all the child nodes of the third and fourth layers.

[0076] In one embodiment of the present application, the advertisement sensitive word trie tree is reconstructed once at the third level as shown in the following diagram: Figure 4 shown.

[0077] It should be noted that in Figure 4 That is, add a child node s in the third layer, point all nodes in the previous layer where the child node s is located to the child node s, and point the child node s to all nodes in the next layer. Figure 2 , Figure 3 , Figure 4 These are all for the convenience of display. They are not complete trie trees of sensitive advertising words and are for reference only. There is also a root node above node 1, but only one branch node is analyzed here.

[0078] It should be noted that reconstructing the advertising sensitive word trie tree according to the above method can improve the recognition rate of advertising sensitive words with new structures. However, the number of reconstructions of the advertising sensitive word tree also needs to be limited. That is, too many reconstructions of the advertising sensitive word trie tree will reduce the recognition accuracy of advertising sensitive words, and may filter out useful information during recognition and filtering. Too few reconstructions may lead to a decline in the recognition rate of new advertising sensitive words. Therefore, it is necessary to further analyze the advertising sensitive words so that each advertising sensitive word trie tree has a limited number of reconstructions, ensuring accurate recognition of advertising sensitive words while avoiding filtering out key information.

[0079] Based on this, in this embodiment, an analysis is performed according to the word characteristics of advertising sensitive words to obtain the number of reconstructions of the advertising sensitive word trie tree corresponding to the advertising sensitive words. The calculation method of the number of reconstructions of the advertising sensitive word trie tree is as follows:

[0080] In the first step, each advertising text in the advertising video frame image is used to construct an advertising text image; an edge detection algorithm is used to obtain the edge lines in the advertising text image; based on the number of corner points on the edge lines and the positional distance distribution between the edge lines, the advertising text structure complexity of each advertising text is determined; the length of the pinyin syllables of each advertising text is used as the advertising text pinyin syllable complexity of the corresponding advertising text; based on the advertising text structure complexity and the advertising text pinyin syllable complexity of each advertising text, the advertising text complexity of each advertising text is determined.

[0081] Preferably, in an embodiment of the present application, since some advertising texts can be split, for example, the character "好" can be split into two characters "女" and "子", this embodiment obtains the complexity of the advertising text based on this feature. The specific method for determining the complexity of each advertising text includes:

[0082] For splittable advertising texts, there are obvious discontinuous strokes between the advertising texts. By analyzing the strokes of the corresponding advertising texts, it can indirectly affect the number of reconstructions of the advertising sensitive word trie tree, avoiding the problem that it is not easy to recognize in the case of complex advertising texts in new advertising sensitive words. In an embodiment of the present application, each advertising text in the advertising video frame image is used to obtain an advertising text image. For sensitive advertising texts, they can be represented in the image to analyze their stroke edge information. The calculation method for obtaining the advertising text complexity by calculating the relationship between the strokes is as follows:

[0083]

[0084] Among them, It represents the complexity of each advertising text, r represents the number of edge lines in the advertising text image, which is obtained by using the edge detection algorithm on the advertising text image. When the number of edge lines is 1, it means that the corresponding advertising text complexity is low; when it is not equal to 1, the position information of different edge lines is analyzed to obtain the advertising text structure complexity p based on the edge lines and the advertising text pinyin syllable complexity Hv.

[0085] In one embodiment of the present application, the Canny operator edge detection algorithm is used to obtain the stroke edges of the advertising text. The Canny operator edge detection algorithm is a well-known technology and will not be described in detail. In other embodiments of the present application, the detection of the stroke edges of the advertising text can be achieved by methods such as the Sobel operator and the Prewitt operator.

[0086] It should be noted that, when the structural complexity p of the advertisement text of the edge position information required is larger, and the number of corresponding edge lines is larger, or the pinyin syllable complexity Hv of the advertisement text is larger, it means that the complexity of the advertisement text currently analyzed is higher, which is used to characterize the complexity of the advertisement text in the advertisement sensitive words, thereby indirectly affecting the number of reconstruction times of the advertisement sensitive word trie tree according to the structural characteristics of the advertisement text.

[0087] In one embodiment of the present application, the method for obtaining the structural complexity p of the advertisement text is to use the shape context algorithm to obtain the corresponding similarity of the edge lines obtained from the advertisement text. The shape context algorithm is a well-known technology and will not be described in detail. By analyzing the similarity between different edge lines and combining the analysis of the edge complexity of the advertisement text, the advertisement text structural complexity index of each advertisement text is jointly constructed.

[0088] The method for determining the complexity of the advertisement text structure includes:

[0089]

[0090] Wherein, p represents the complexity of the advertisement text structure of each advertisement text, norm represents the normalization function, H represents the advertisement text complexity correction coefficient of each advertisement text, r represents the number of edge lines in the advertisement text image, represents the edge complexity of the i-th edge line, Indicates the maximum similarity between the ith edge line and all other remaining edge lines. In other embodiments of the present application, other similarity analysis methods may be used to calculate the similarity between edge lines.

[0091] It should be noted that the greater the complexity of the edge line in the desired advertising text, the The larger the value, the smaller the similarity between the corresponding edge lines. The smaller it is, the more complex the edge line is and the lower the degree of repetition with other edge lines, that is, the greater the structural complexity of the advertising text; the structural complexity of the current advertising text is corrected by combining the advertising text complexity correction coefficient to obtain the structural complexity of the advertising text.

[0092] It should be noted that L represents the edge complexity of the edge line. Since some advertising texts may be detected as connected through the conversion of advertising text graphics, in this embodiment, further complexity analysis is performed on a single edge. In an embodiment of the present application, due to different corner point information on the edge line and the line segments between corner points may also be quite different in terms of the writing of text strokes, by using the harris corner detection algorithm on the obtained edge line, the harris corner detection algorithm is a well-known technology and will not be elaborated here. Other embodiments of the present application can use other corner detection methods or other methods for dividing the edge line into segments for analysis.

[0093] Furthermore, the corner points on the edge line are calculated through the corner detection algorithm, and taking the corner points as the division points, the obtained edge line is divided into edge segments, and the edge segments are linearly fitted to obtain edge line segments. The number of edge line segments obtained after division according to the corner points is denoted as N, and the similarity between the divided edge line segments obtained according to the division result is analyzed, so as to calculate its complexity:

[0094]

[0095] Among them, represents the edge complexity of the i-th edge line, represents the number of corner points of the i-th edge line, represents the number of clustering clusters obtained by clustering the slopes of all edge line segments in the i-th edge line. Among them, in an embodiment of the present application, the DBSCAN clustering algorithm is used for clustering, and the least squares method is used for linear fitting of the edge segments. The DBSCAN clustering algorithm and the least squares method are both well-known technologies and will not be elaborated here.

[0096] It should be noted that when the number of corner points on the edge line to be obtained is more, and the number of types of slopes of the corresponding divided edge line segments is also more, it indicates that the edge complexity of the current edge line is greater, and there may be multiple turns on the edge line, corresponding to the variable strokes of the advertising text structure, that is, it indicates that the edge strokes of the advertising text are more complex.

[0097] Furthermore, in order to avoid certain radicals such as "灬" from causing the complexity of the advertising text containing this radical to be too large during the calculation process according to the above method, it is necessary to correct the complexity of the advertising text that may contain these radicals. Among them, the radical correction method in this embodiment is obtained by calculating the azimuth similarity and position distance similarity of the edge line.

[0098] In one embodiment of the present application, the method for calculating the orientation similarity is to obtain the longest edge line among all edge lines of the advertising text, use the center point of its minimum fitting circle as the anchor point, obtain the distance from the center of gravity of other edge lines to the anchor point, and cluster the distance from the center of gravity of each edge line to the anchor point, the angle to the anchor point, and the length of each edge line to obtain edge line clusters, wherein the angle is the angle between the line connecting the center of gravity of each edge line to the anchor point and the horizontal right direction, wherein the clustering algorithm uses the DBSCAN clustering algorithm, which is a well-known technology and will not be described in detail. Furthermore, by analyzing the difference between the number of edge line clusters obtained and the number of edge lines, as well as the correlation between different edge line clusters, the corresponding correction method is as follows:

[0099]

[0100] Among them, H represents the complexity correction coefficient of each advertisement text, norm represents the normalization function, r represents the number of edge lines in the advertisement text image, Tr represents the number of edge line clusters, Represents the average value of the absolute value of the difference between the angles of all elements in the bth edge line cluster.

[0101] It should be noted that, when the difference between the number of edge line clusters and the number of edges is greater, it means that there may be multiple small edges that are originally a radical and are mistakenly identified as multiple radical edges. At the same time, the smaller the difference in angles from each edge of the obtained cluster to the anchor point, the more evenly distributed these edges are, that is, these small edges in the same edge line cluster are more likely to be the same radical, so that the edge line division in the advertising text image is more accurate, and the advertising text complexity correction coefficient of the advertising text is smaller.

[0102] Furthermore, this embodiment analyzes the number of syllables corresponding to the pinyin of the advertising text, and takes the pinyin byte length of each advertising text as the advertising text pinyin syllable complexity Hv of the corresponding advertising text. For example, for "jing", the advertising text pinyin syllable complexity Hv of the corresponding advertising text "jing" is 4.

[0103] In the second step, the sum of the complexity of all the advertisement texts in each advertisement sensitive word is taken as the complexity corresponding to each advertisement sensitive word.

[0104] In one embodiment of the present application, the complexity of each advertisement text is analyzed to obtain the complexity of the advertisement sensitive words. The complexity determination method includes:

[0105]

[0106] Among them, Tc represents the complexity of the advertising sensitive word, c represents the number of advertising words in the advertising sensitive word, represents the advertising word complexity of the e-th advertising word in the advertising sensitive word. Thus, the complexity of the advertising sensitive word calculated according to the edge structure and pinyin syllables of the advertising word can be obtained.

[0107] Step 3: Determine the structural complexity of the advertising sensitive word trie tree based on the depth and the number of nodes of the advertising sensitive word trie tree.

[0108] Preferably, in an embodiment of the present application, since some advertising sensitive word trie trees may be divided finely enough, for example, for the advertising sensitive word "so hot", by splitting it by radicals and pinyin, the advertising sensitive word trie tree as shown in Figure 5 can be obtained.

[0109] It should be noted that Figure 5 for the advertising sensitive word trie tree of the example "so hot", if the text to be matched splits the advertising sensitive word into "good 扌 pill 灬呀", then when matching against the corresponding advertising sensitive word trie tree, the keyword cannot be recognized, and the above method needs to be used to reconstruct the advertising sensitive word trie tree.

[0110] In an embodiment of the present application, a schematic diagram of reconstructing the advertising sensitive word trie tree once at the second layer is as shown in Figure 6 as follows.

[0111] It should be noted that Figure 6 is a schematic diagram of reconstructing the advertising sensitive word trie tree of the example "so hot" once at the second layer, that is, adding a child node s at the second layer, pointing all the nodes in the upper layer of the layer where the child node s is located to the child node s, and pointing the child node s to all the nodes in the lower layer. At this time, the character "扌" is matched with "s", and there is no match for the character "丸".

[0112] Therefore, in an embodiment of the present application, another reconstruction is required. A schematic diagram of reconstructing the advertising sensitive word trie tree twice at the second and third layers is as shown in Figure 7 as follows.

[0113] It should be noted that Figure 7Schematic diagram showing the trie tree of advertising sensitive words "So hot" reconstructed twice at the second and third levels, that is, adding a child node s at the second and third levels respectively, pointing the node "good" that has been matched in the upper layer of the layer where the child node s in the second layer is located to this child node s, pointing the child node s in the second layer to all the nodes pointed to by the node "good" in the upper layer of its location layer, and at the same time pointing to all the nodes in the lower layer pointed to by all these nodes to complete one reconstruction; for the second reconstruction, the child node s in the third layer inherits all the nodes pointed to by the child node s in the upper layer, makes the pointing, and at the same time the child node s in the upper layer points to the child node s in the third layer. Then the matching can be completed, and the advertising sensitive words can be identified. In this way, the advertising sensitive words are identified by reconstructing the trie tree of advertising sensitive words twice. If the trie tree of advertising sensitive words is only the Figure 5 left branch in, three reconstructions are required to complete the recognition of the above text "hao shou wan huo ya". That is to say, the more situations considered in the construction process of the trie tree of advertising sensitive words itself, that is, the higher the complexity of the trie tree of advertising sensitive words itself, the fewer the number of reconstructions required. Therefore, based on this, a method for suppressing the number of reconstructions based on the complexity of the trie tree of advertising sensitive words is obtained:

[0114] In this embodiment, the structural complexity of the trie tree of advertising sensitive words is analyzed by analyzing the structure of the trie tree of advertising sensitive words corresponding to the advertising sensitive word library. The formula for the structural complexity is expressed as:

[0115]

[0116] where Fr represents the structural complexity of the trie tree of advertising sensitive words, t represents the depth of the trie tree of advertising sensitive words, y represents the number of nodes of the trie tree of advertising sensitive words, O represents the number of nodes of a perfect binary tree with depth t, that is, O = , represents the number of advertising words of the advertising sensitive words.

[0117] It should be noted that when the difference between the leaf nodes of the trie tree of advertising sensitive words to be obtained and the number of nodes of the perfect binary tree at its corresponding depth is smaller, that is, is closer to 1, and the difference between the depth of the corresponding trie tree of advertising sensitive words and the number of advertising words of the advertising sensitive words is larger, that is, is larger, it indicates that the structure of the corresponding trie tree of advertising sensitive words is more complex, and its structural complexity Fr is larger.

[0118] Fourth step, based on the structural complexity, correct the complexity to determine the corrected complexity of each advertising sensitive word;

[0119] Preferably, in one embodiment of the present application, since the structural complexity of the advertising sensitive word trie tree is relatively large, it takes into account more situations of advertising sensitive word recognition, which means that the advertising sensitive word trie tree does not need to be reconstructed multiple times, thereby reducing the number of reconstruction times of the advertising sensitive word trie tree. Based on this, the complexity of advertising sensitive words is corrected by the structural complexity of the advertising sensitive word trie tree constructed based on the advertising sensitive word library, and the formula for the corrected complexity of the advertising sensitive words is expressed as:

[0120]

[0121] in, It represents the complexity of the corrected advertising sensitive words, norm represents the normalization function, Tc represents the complexity of the advertising sensitive words, and Fr represents the structural complexity of the trie tree of advertising sensitive words.

[0122] It should be noted that, when the structural complexity of the desired advertising sensitive word trie tree is greater, it means that the advertising sensitive word trie tree considers more situations, and the difference between the types of expressions of the corresponding advertising sensitive words that may be omitted or the length and the length of the tree is smaller. This value is used to correct the complexity of the advertising sensitive words, so that the corrected complexity of the advertising sensitive words is smaller and the number of reconstructions is less.

[0123] The fifth step is to determine the number of reconstruction times of the advertising sensitive word trie tree based on the corrected complexity.

[0124] Preferably, in one embodiment of the present application, the method for constructing the reconstruction times of the trie tree of sensitive advertising words according to the corrected complexity of sensitive advertising words obtained by the above analysis is as follows:

[0125]

[0126] Among them, Cg represents the number of reconstructions of the advertising sensitive word trie tree, represents the upward rounding function, t represents the depth of the trie tree of advertising sensitive words, Indicates the number of ad texts containing sensitive words. Indicates the matching sensitivity coefficient. In this embodiment, the value is 1, which ensures that when the advertisement sensitive word is "123", there is also one reconstruction number. Indicates the complexity of the corrected sensitive words in the advertisement.

[0127] In one embodiment of the present application, the flowchart of constructing the index of the number of reconstructions is as follows: Figure 8 shown.

[0128] It should be noted that, when the complexity of the corrected advertising sensitive words is greater, and the difference between the depth of the corresponding advertising sensitive words trie tree and the number of advertising texts of the advertising sensitive words is greater, it means that the advertising sensitive words trie tree needs to be reconstructed more times, so that the advertising sensitive words can be identified more accurately and a better data comparison effect can be achieved.

[0129] Step S003, comparing advertisement video frames based on the advertisement sensitive word trie tree and the number of reconstructions.

[0130] The reconstruction times of each advertising sensitive word trie tree obtained in step S002 are marked in the advertising sensitive word library. The advertising video frame image is compared with each advertising sensitive word trie tree in the advertising sensitive word library. When the comparison is successful, it means that the corresponding advertising sensitive word is recognized in the advertising video frame image; when the comparison fails, the advertising sensitive word trie is reconstructed again in combination with the remaining reconstruction times, and then the comparison is continued until the comparison is successful or the reconstruction times are used up and the comparison is ended.

[0131] The reconstruction process of the advertising sensitive word trie starts from the second-level node of each advertising sensitive word trie tree, and adds a child node s at the corresponding level according to the number of reconstructions. The child node is pointed to by the node that has been successfully compared in the previous level, and the child node s points to all nodes pointed to in the previous level. Figure 3 , 4 As shown in 6, the child node s is a wildcard, that is, all characters can be matched. When the advertisement video frame image is not successfully compared in the advertisement sensitive word trie after one reconstruction, the remaining reconstruction times are used to repeat the reconstruction. The child node s added during the repeated reconstruction is added at the next layer of the child node added during the previous reconstruction, and the current child node s needs to inherit all the nodes pointed to by the upper-layer child node s, and the upper-layer child node s needs to point to the current child node.

[0132] Thus, one embodiment of the present application realizes the comparison of new advertisement sensitive words in advertisement video frame images.

[0133] Based on the same inventive concept as the above method, an embodiment of the present application also provides a multi-threaded data comparison system, including a memory, a processor, and a computer program stored in the memory and running on the processor, and when the processor executes the computer program, the steps of any one of the multi-threaded data comparison methods described above are implemented.

[0134] The various embodiments in the present application are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

[0135] It should be noted that, unless otherwise specified and limited, terms such as "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a circuit structure, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such article or device. In the absence of further restrictions, an element defined by the sentence "including one..." does not exclude the existence of other identical elements in the article or device including the element. In addition, the term "and\or" used herein includes any and all combinations of one or more related listed items.

[0136] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention invented herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art not invented by the present application.

[0137] It will be appreciated that the present application is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof.

Claims

1. A multi-threaded data comparison method, characterized in that: The method comprises the following steps: Obtain the advertisement video frame image output by the multi-thread processing system, obtain the advertisement sensitive word trie tree of each advertisement sensitive word in the advertisement sensitive word library, and use character recognition technology to recognize the advertisement text in the advertisement video frame image; The advertisement text in the advertisement video frame image is compared based on the advertisement sensitive word trie tree, and the data comparison process includes the following steps: (1) Construct an advertising text image from each advertising text in the advertising video frame image; use an edge detection algorithm to obtain edge lines in the advertising text image; (2) Determine the text structure complexity of each ad text based on the number of corner points on the edge line and the position distance distribution between the edge lines; take the pinyin syllable length of each ad text as the text pinyin syllable complexity of the corresponding ad text; determine the text complexity of each ad text based on the text structure complexity and the text pinyin syllable complexity of each ad text; take the sum of the text complexity of all ad texts in each ad sensitive word as the complexity of each ad sensitive word; (3) Determine the structural complexity of the advertising sensitive word trie tree based on the depth and number of nodes of the advertising sensitive word trie tree; modify the complexity based on the structural complexity of the advertising sensitive word trie tree to determine the modified complexity of each advertising sensitive word; determine the number of reconstructions of the advertising sensitive word trie tree based on the modified complexity; (4) Compare advertising video frames based on the trie tree of advertising sensitive words and the number of reconstructions; The method for implementing the advertisement video frame image comparison includes: Mark the reconstruction times of each advertising sensitive word trie tree in the advertising sensitive word library; Compare the advertisement video frame image with each advertisement sensitive word trie tree in the advertisement sensitive word library. When the comparison is successful, it means that the corresponding advertisement sensitive word is recognized in the advertisement video frame image. When the comparison fails, reconstruct the advertisement sensitive word trie tree again in combination with the remaining reconstruction times, and then continue to compare until the comparison is successful or the reconstruction times are used up. The reconstruction process of each advertising sensitive word trie tree is as follows: starting from the second-layer node of each advertising sensitive word trie tree, a child node is added at the corresponding layer according to the number of reconstructions, and the child node is pointed to by the node that has been matched at the previous layer of the layer where it is located, and the child node points to all nodes pointed to by the node that has been matched at the previous layer of the layer where it is located, and all nodes of the next layer pointed to by all of the nodes; if a reconstruction has been performed before each reconstruction, the current child node inherits all the nodes pointed to by the child nodes of the previous layer, and the child nodes of the previous layer point to the current child node; The sub-node can match all characters.

2. A multi-threaded data comparison method as claimed in claim 1, characterized in that: The method for determining the complexity of the advertisement text structure includes: Get the maximum similarity between each edge line and all other remaining edge lines; Determine the edge complexity of each edge line based on the number of corner points on the edge line and their distribution; Determine the advertisement text complexity correction coefficient of each advertisement text based on the position distribution difference between the edge lines; Calculating the ratio of the edge complexity of each edge line to the maximum similarity; calculating the sum of the ratios of all edge lines of each advertisement text; A normalized value of the product of the advertisement text complexity correction coefficient of each advertisement text and the sum value is calculated as the advertisement text structure complexity of each advertisement text.

3. A multi-threaded data comparison method as claimed in claim 2, characterized in that: The method for determining the edge complexity includes: Use corner detection algorithm to obtain the corner points of each edge line; Using the corner points as dividing points, each edge line is divided into edge segments, and each edge segment is fitted with a straight line to obtain each edge line segment; Calculate the slope of each edge segment, and use a clustering algorithm to cluster all the slopes on each edge line to obtain clusters; Determine edge complexity based on the number of clusters and the number of corner points; The number of clusters and the number of corner points are both positively correlated with the edge complexity.

4. A multi-threaded data comparison method as claimed in claim 2, characterized in that: The method for determining the advertisement text complexity correction coefficient includes: For the longest edge line among all the edge lines of each ad text, the center point of its minimum fitting circle is used as the anchor point; All edge lines of each advertisement text are used as inputs of the clustering algorithm, and the Euclidean distance between the distance from the center of gravity of each edge line to the anchor point, the angle from the center of gravity to the anchor point, and the length of each edge line are used as the clustering distance of the clustering algorithm, and the edge line clustering cluster is output; the angle is the angle between the line from the center of gravity of each edge line to the anchor point and the horizontal rightward direction; Calculate the average of the absolute values ​​of the differences between the angles of all elements in each edge line cluster; calculate the sum of the average values ​​of all edge line clusters, recorded as the first sum; Calculate the difference between the number of edge lines of each advertisement text and the number of edge line clusters, and calculate the sum of the difference and the number 1, which is recorded as the second sum; A normalized value of a sum of the first sum value and the second sum value is used as an advertisement text complexity correction coefficient of each advertisement text.

5. A multi-threaded data comparison method as claimed in claim 1, characterized in that: The method for determining the complexity of the advertisement text includes: When the number of edge lines of each advertisement text is 1, the number of edge lines is used as the advertisement text complexity of each advertisement text; On the contrary, the product of the number of edge lines of each advertising text and the advertising text structure complexity is calculated, recorded as the first product, the advertising text pinyin syllable complexity of each advertising text is calculated, and the maximum value of the first product and the advertising text pinyin syllable complexity is taken as the advertising text complexity of each advertising text.

6. A multi-threaded data comparison method as claimed in claim 1, characterized in that: The method for determining the structural complexity of the advertisement sensitive word trie tree includes: Get the perfect binary tree at the same depth corresponding to the trie tree of advertising sensitive words; get the number of nodes in the perfect binary tree; Calculate the difference between the depth of the trie tree of sensitive advertising words and the number of advertising words, and record it as a first difference; calculate the ratio of the number of nodes in the trie tree of sensitive advertising words to the number of nodes in the perfect binary tree, and record it as a first ratio; The product of the first difference and the first ratio is used as the structural complexity of the advertisement sensitive word trie tree.

7. A multi-threaded data comparison method as claimed in claim 1, characterized in that: The modified complexity is obtained by a normalized value of the ratio of the complexity to the structural complexity of the advertisement sensitive word trie tree.

8. A multi-threaded data comparison method as claimed in claim 6, characterized in that: The method for determining the number of reconstruction times includes: Calculating a sum of the first difference and a preset matching sensitivity coefficient; The product of the summation result and the corrected complexity of the advertising sensitive words is used as the number of reconstructions of the advertising sensitive words trie tree.

9. A multi-threaded data comparison system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of a multi-threaded data comparison method as described in any one of claims 1-8 are implemented.