Method and device for extracting license plate number from police call text based on regular expression

Through a method based on regular expressions, the license plate number in the received police text is automatically extracted, which solves the problems of high manual extraction cost and low efficiency, and achieves efficient license plate number extraction.

CN113111228BActive Publication Date: 2024-09-06BEIJING MINGYI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010306325.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-02-13
Filing Date
2020-04-17
Publication Date
2024-09-06
Estimated Expiration
2040-04-17

AI Technical Summary

Technical Problem

In the existing technology, the public security agency manually extracts the license plate number from the police text, which is costly and inefficient, and the natural language description is irregular, making the extraction difficult, relying on manual experience, and the learning cost is high.

Method used

A method based on regular expressions is used to generate candidate regular expressions through the preset license plate number category set and training samples, and match the received warning text to automatically extract the license plate number, reducing manual operation costs and increasing the extraction speed.

Benefits of technology

Automatic license plate number extraction from police text is realized, which reduces costs, increases extraction speed, reduces manual operations, and improves efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113111228B_ABST
    Figure CN113111228B_ABST
Patent Text Reader

Abstract

The disclosed embodiment discloses a method and device for extracting license plate numbers from a police call text based on regular expressions. A specific implementation of the method includes: obtaining a police call text for the license plate number to be extracted and a target license plate number category set, wherein each target license plate number category belongs to a preset license plate number category set; matching the police call text for the license plate number to be extracted with the regular expressions corresponding to each target license plate number category in the target license plate number category set, so as to extract the corresponding target license plate number from the police call text for the license plate number to be extracted. This implementation realizes the automatic extraction of license plate numbers from police call texts.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The disclosed embodiments relate to the field of computer technology, and in particular to a method and device for extracting license plate numbers from police call text based on regular expressions. Background Art

[0002] At present, the 110 police dispatchers of the public security organs will enter the police call text when receiving the call. The police handling officers will enter the police handling text after handling the call. The police call text includes the above-mentioned call text and the police handling text. In practice, the police call text often involves descriptions of various license plate numbers. Case analysts can analyze the same or similar license plate numbers that appear in each police call text based on the license plate numbers in the police call text in order to discover series of cases or related cases (for example, the same license plate number appears in multiple police call texts). However, the labor cost of manually extracting license plate numbers from police call texts is too high and relies on personal experience. Summary of the invention

[0003] The disclosed embodiments provide a method and device for extracting license plate numbers from police call text based on regular expressions.

[0004] In a first aspect, an embodiment of the present disclosure provides a method for extracting license plate numbers from police call texts based on regular expressions, the method comprising: obtaining a police call text for the license plate number to be extracted and a set of target license plate number categories, wherein each target license plate number category belongs to a preset license plate number category set; matching the police call text for the license plate number to be extracted with the regular expressions corresponding to each target license plate number category in the set of target license plate number categories to extract the corresponding target license plate number in the police call text for the license plate number to be extracted.

[0005] In some embodiments, the regular expression corresponding to each preset license plate number category in the preset license plate number category set is pre-trained through the following first training step: obtaining a training sample set and a test sample set, wherein the training sample and the test sample both include historical police call texts and annotated license plate number information, wherein the annotated license plate number information is used to characterize the license plate numbers of each preset license plate number category included in the historical police call text; for each preset license plate number category in the preset license plate number category set, performing the following first regular expression determination operation: determining the training sample whose annotated license plate number information in each training sample includes the preset license plate number category as the preset license plate number; A positive training sample set corresponding to the preset license plate number category; selecting positive training samples from the positive training sample set corresponding to the preset license plate number category to form a target number of positive training sample subsets; for each positive training sample subset in the target number of positive training sample subsets, generating a candidate regular expression corresponding to the preset license plate number category based on each positive training sample in the positive training sample subset; testing each generated candidate regular expression based on a test sample set to determine the accuracy corresponding to each generated candidate regular expression; determining the candidate regular expression with the highest accuracy among the generated candidate regular expressions as the regular expression corresponding to the preset license plate number category.

[0006] In some embodiments, selecting positive training samples from the positive training sample set corresponding to the preset license plate number category to form a target number of positive training sample subsets includes: performing a target number of positive training sample subset generation operations to generate a target number of positive training sample subsets, the positive training sample subset generation operation includes: randomly selecting N positive training samples from the positive training sample set corresponding to the preset license plate number category to form a positive training sample subset, wherein N is an integer obtained by rounding down the quotient of L divided by M, L is the number of positive samples in the positive training sample set corresponding to the preset license plate number category, and M is a positive integer greater than or equal to 2 and less than L.

[0007] In some embodiments, the regular expression corresponding to each preset license plate number category in the preset license plate number category set is pre-trained through the following second training step: obtaining a training sample set, wherein the training sample includes historical police call text and annotated license plate number information, wherein the annotated license plate number information is used to characterize the license plate numbers of each preset license plate number category included in the historical police call text; for each preset license plate number category in the preset license plate number category set, performing the following second regular expression determination operation: determining the training samples whose annotated license plate number information in each training sample includes the preset license plate number category as the positive training sample set corresponding to the preset license plate number category; based on the positive training sample set corresponding to the preset license plate number category, generating a regular expression corresponding to the preset license plate number category.

[0008] In some embodiments, the preset license plate number category set includes at least one of the following: small car license plate, large car license plate, trailer license plate, embassy and consulate car license plate, Hong Kong and Macao entry and exit license plate, training car license plate, police car license plate, and new military license plate.

[0009] In the second aspect, an embodiment of the present disclosure provides a device for extracting license plate numbers from police call texts based on regular expressions, the device comprising: an acquisition unit, configured to acquire the police call text for the license plate number to be extracted and a set of target license plate number categories, wherein each target license plate number category belongs to a preset license plate number category set; an extraction unit, configured to match the police call text for the license plate number to be extracted with the regular expressions corresponding to each target license plate number category in the set of target license plate number categories, so as to extract the corresponding target license plate number in the police call text for the license plate number to be extracted.

[0010] In some embodiments, the regular expression corresponding to each preset license plate number category in the preset license plate number category set is pre-trained through the following first training step: obtaining a training sample set and a test sample set, wherein the training sample and the test sample both include historical police call texts and annotated license plate number information, wherein the annotated license plate number information is used to characterize the license plate numbers of each preset license plate number category included in the historical police call text; for each preset license plate number category in the preset license plate number category set, performing the following first regular expression determination operation: determining the training sample whose annotated license plate number information in each training sample includes the preset license plate number category as the preset license plate number; A positive training sample set corresponding to the preset license plate number category; selecting positive training samples from the positive training sample set corresponding to the preset license plate number category to form a target number of positive training sample subsets; for each positive training sample subset in the target number of positive training sample subsets, generating a candidate regular expression corresponding to the preset license plate number category based on each positive training sample in the positive training sample subset; testing each generated candidate regular expression based on a test sample set to determine the accuracy corresponding to each generated candidate regular expression; determining the candidate regular expression with the highest accuracy among the generated candidate regular expressions as the regular expression corresponding to the preset license plate number category.

[0011] In some embodiments, selecting positive training samples from the positive training sample set corresponding to the preset license plate number category to form a target number of positive training sample subsets includes: performing a target number of positive training sample subset generation operations to generate a target number of positive training sample subsets, the positive training sample subset generation operation includes: randomly selecting N positive training samples from the positive training sample set corresponding to the preset license plate number category to form a positive training sample subset, wherein N is an integer obtained by rounding down the quotient of L divided by M, L is the number of positive samples in the positive training sample set corresponding to the preset license plate number category, and M is a positive integer greater than or equal to 2 and less than L.

[0012] In some embodiments, the regular expression corresponding to each preset license plate number category in the preset license plate number category set is pre-trained through the following second training step: obtaining a training sample set, wherein the training sample includes historical police call text and annotated license plate number information, wherein the annotated license plate number information is used to characterize the license plate numbers of each preset license plate number category included in the historical police call text; for each preset license plate number category in the preset license plate number category set, performing the following second regular expression determination operation: determining the training samples whose annotated license plate number information in each training sample includes the preset license plate number category as the positive training sample set corresponding to the preset license plate number category; based on the positive training sample set corresponding to the preset license plate number category, generating a regular expression corresponding to the preset license plate number category.

[0013] In some embodiments, the preset license plate number category set includes at least one of the following: small car license plate, large car license plate, trailer license plate, embassy and consulate car license plate, Hong Kong and Macao entry and exit license plate, training car license plate, police car license plate, and new military license plate.

[0014] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner in the first aspect.

[0015] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by one or more processors, implements the method described in any implementation manner in the first aspect.

[0016] In the prior art, license plate numbers are generally extracted manually from police call texts, which may have the following problems: (1) There are a large number of police call texts from history that have not had their license plate numbers extracted, and as time goes by, police officers enter a large number of new police call texts every day, resulting in a large amount of data to be extracted from the police call texts, and the manpower and time costs required for manual extraction are too high; (2) Most police call texts are described in natural language, and the expression is highly colloquial and irregular, making it difficult to manually extract license plate numbers; (3) There are many types of license plate numbers, and the methods for extracting license plate numbers of different types are different, relying on manual experience, that is, the learning cost of the manual extraction process is high.

[0017] The embodiments of the present disclosure provide a method and device for extracting license plate numbers from police call texts based on regular expressions. By matching the police call texts for the license plate numbers to be extracted with the regular expressions corresponding to the target license plate number categories in the target license plate number category set, the license plate numbers of the corresponding target license plate number categories in the police call texts for the license plate numbers to be extracted are extracted, thereby effectively utilizing the regular expressions corresponding to each target license plate number category, realizing automatic extraction of license plate numbers from police call texts without manual operation, reducing the cost of extracting license plate numbers from police call texts, and improving the speed of extracting license plate numbers from police call texts. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Other features, objects and advantages of the present disclosure will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:

[0019] Figure 1 is an exemplary system architecture diagram in which an embodiment of the present disclosure may be applied;

[0020] Figure 2 It is a flowchart of an embodiment of a method for extracting license plate numbers from police call texts based on regular expressions according to the present disclosure;

[0021] Figure 3 is a flowchart of an embodiment of a first training step according to the present disclosure;

[0022] Figure 4 is a flowchart of an embodiment of the second training step according to the present disclosure;

[0023] Figure 5 It is a structural schematic diagram of an embodiment of a device for extracting license plate numbers from police call texts based on regular expressions according to the present disclosure;

[0024] Figure 6 It is a schematic diagram of the structure of a computer system suitable for implementing the electronic device of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0025] The present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.

[0026] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0027] Figure 1 An exemplary system architecture 100 is shown to which an embodiment of the method for extracting license plate numbers from police call texts based on regular expressions or an apparatus for extracting license plate numbers from police call texts based on regular expressions of the present disclosure can be applied.

[0028] like Figure 1 As shown, system architecture 100 may include terminal device 101, network 102 and server 103. Network 102 is used to provide a medium for a communication link between terminal device 101 and server 103. Network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables.

[0029] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as alarm record applications, alarm text license plate number extraction applications, web browser applications, etc.

[0030] The terminal device 101 can be hardware or software. When the terminal device 101 is hardware, it can be various electronic devices with a display screen and supporting text input, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, etc. When the terminal device 101 is software, it can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, used to provide a service for extracting license plate numbers from police texts), or it can be implemented as a single software or software module. No specific limitation is made here.

[0031] The server 103 may be a server providing various services, such as a backend server providing license plate number extraction for the alarm text sent by the terminal device 101. The backend server may analyze the received alarm text and feed back the processing result (such as license plate number) to the terminal device.

[0032] In some cases, the method for extracting license plate numbers from police call texts based on regular expressions provided in the embodiments of the present disclosure can be performed jointly by the terminal device 101 and the server 103. For example, the step of "obtaining the police call text for the license plate number to be extracted and the target license plate number category set" can be performed by the terminal device 101, and the remaining steps can be performed by the server 103. The present disclosure does not limit this. Accordingly, the apparatus for extracting license plate numbers from police call texts based on regular expressions can also be respectively set in the terminal device 101 and the server 103.

[0033] In some cases, the method for extracting license plate numbers from police call texts based on regular expressions provided in the embodiments of the present disclosure may be executed by the server 103. Accordingly, the device for extracting license plate numbers from police call texts based on regular expressions may also be provided in the server 103. In this case, the system architecture 100 may not include the terminal device 101.

[0034] In some cases, the method for extracting license plate numbers from police call texts based on regular expressions provided in the embodiments of the present disclosure may be executed by the terminal device 101. Accordingly, the apparatus for extracting license plate numbers from police call texts based on regular expressions may also be provided in the terminal device 101. In this case, the system architecture 100 may not include the server 103.

[0035] It should be noted that the server 103 can be hardware or software. When the server 103 is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server 103 is software, it can be implemented as multiple software or software modules (for example, for providing a service for extracting license plate numbers from police texts), or it can be implemented as a single software or software module. No specific limitation is made here.

[0036] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0037] Continue to refer Figure 2 , which shows a process 200 of an embodiment of a method for extracting license plate numbers from police text based on regular expressions according to the present disclosure. The method for extracting license plate numbers from police text based on regular expressions comprises the following steps:

[0038] Step 201, obtaining the alarm text of the license plate number to be extracted and the target license plate number category set.

[0039] In this embodiment, the execution body of the method for extracting license plate numbers from police call text based on regular expressions (for example, Figure 1The server shown in the figure can obtain the locally stored vehicle license plate number to be extracted and the target vehicle license plate number category set, or the execution subject can also remotely obtain the vehicle license plate number from other electronic devices (for example, Figure 1 The terminal device shown in the figure) obtains the alarm processing text of the license plate number to be extracted and the target license plate number category set.

[0040] Here, the license plate number alarm text to be extracted can be text data compiled by the police receiver according to the content of the alarm call or text data compiled by the police officer according to the alarm process. The license plate number alarm text to be extracted can also be an alarm text received from the terminal device and input by the user in an alarm application installed on the terminal device or a web page with an alarm function.

[0041] Here, the target license plate number category set is used to indicate each license plate number category to be extracted from the license plate number to be extracted alarm reception text, and each target license plate number category in the target license plate number category set belongs to a preset license plate number category set.

[0042] In some optional implementations, the preset license plate number category set may be manually formulated by a technician based on the license plate number categories that may appear in the police call text and the importance of each license plate number category for case analysis and association.

[0043] In some optional implementations, the preset license plate number category set may include at least one of the following: small car license plate, large car license plate, trailer license plate, embassy and consulate car license plate, Hong Kong and Macao entry and exit license plates, training car license plates, police car license plates, and new military license plates.

[0044] Step 202, matching the license plate number to be extracted alarm text with the regular expressions corresponding to the target license plate number categories in the target license plate number category set, to extract the corresponding target license plate number in the license plate number to be extracted alarm text.

[0045] In this embodiment, a regular expression is a logical formula for string operations, that is, a "regular string" is formed by using some pre-defined specific characters and the combination of these specific characters. This "regular string" is used to express a filtering logic for the string. Given a regular expression and another string, it can be determined whether the given string matches the filtering logic of the regular expression, and by giving a regular expression, a specific part that is desired to be extracted can be obtained from the string. Therefore, the above execution subject (for example, Figure 1The server shown in the figure can match the license plate number to be extracted with the regular expression corresponding to the target license plate number category for each target license plate number category in the target license plate number category set, so as to extract the corresponding target license plate number in the license plate number to be extracted. How to determine whether a regular expression matches another string, and how to extract the part to be extracted by a regular expression are existing technologies widely studied and applied in this field, and will not be described in detail here.

[0046] In some optional implementations, the regular expression corresponding to each preset license plate number category in the preset license plate number category set may be a logical formula for string operations developed by technicians based on statistical analysis of the license plate number parts of the preset license plate number category in a large number of historical police call texts that include license plate numbers of the preset license plate number category, and for extracting license plate numbers of the preset license plate number category.

[0047] In some optional implementations, the regular expression corresponding to each preset license plate number category in the preset license plate number category set may also be expressed as follows: Figure 3 The first training step shown is pre-trained. Please refer to Figure 3 , Figure 3 A process 300 of an embodiment of a first training step according to the present disclosure is shown. The process 300 of the first training step may include the following steps:

[0048] Step 301: Obtain a training sample set and a test sample set.

[0049] Here, the execution subject of the first training step can be the same as the execution subject of the above-mentioned method for extracting license plate numbers from police call texts based on regular expressions. In this way, after the execution subject of the first training step obtains the regular expressions corresponding to each preset license plate number category in the preset license plate number category set through training, the regular expressions corresponding to each preset license plate number category in the preset license plate number category set can be stored locally in the above-mentioned execution subject, and the regular expressions corresponding to each preset license plate number category in the preset license plate number category set obtained through the above-mentioned training can be read during the execution of the above-mentioned method for extracting license plate numbers from police call texts based on regular expressions.

[0050] Here, the execution entity of the first training step can also be different from the execution entity of the above-mentioned method for extracting license plate numbers from police call handling texts based on regular expressions. In this way, after the execution entity of the first training step obtains the regular expressions corresponding to each preset license plate number category in the preset license plate number category set through training, it can send the regular expressions corresponding to each preset license plate number category in the preset license plate number category set to the execution entity of the above-mentioned method for extracting license plate numbers from police call handling texts based on regular expressions. In this way, the execution entity of the above-mentioned method for extracting license plate numbers from police call handling texts based on regular expressions can read the regular expressions corresponding to each preset license plate number category in the preset license plate number category set received from the execution entity of the first training step during the process of executing the above-mentioned method for extracting license plate numbers from police call handling texts based on regular expressions.

[0051] Here, the execution entity of the first training step can first obtain a training sample set and a test sample set. Among them, both the training samples and the test samples include historical police call handling texts and corresponding labeled license plate number information, where the labeled license plate number information is used to represent the license plate numbers of each preset license plate number category included in the historical police call handling text. It should be noted that in practice, the police call handling text may include license plate numbers of more than one preset license plate number category. Therefore, the labeled license plate number information included in the training samples and the test samples can also be at least one.

[0052] Here, the labeled license plate number information can include a preset license plate number category, as well as a start position and an end position, and is used to represent that the content between the start position and the end position of the historical police call handling text in the training sample is the license plate number of the preset license plate number category. For the convenience of understanding, the following is an example. For example, the training sample can include the historical police call handling text "A reported that a black large truck with a license plate number of 'Beijing AXXXXX trailer' of type AA hit the highway guardrail, causing the next three cars to rear-end, with serious losses. One of the cars, a white car with a license plate number of 'Beijing BYYYYY', was severely damaged." The above historical police call handling text can correspond to two pieces of labeled license plate number information. One is: preset license plate number category - trailer license plate, start position - 31 (note, here one Chinese character and Chinese punctuation occupy two characters, and numbers and English letters occupy one character), end position - 41; the other is: preset license plate number category - small car license plate, start position - 124, end position - 131. The above two pieces of labeled license plate number information are used to represent that between the 31st character and the 41st character in the historical police call handling text "A black large truck with a license plate number of 'Beijing AXXXXX trailer' hit the highway guardrail, causing the next three cars to rear-end, with serious losses. One of the cars, a white car with a license plate number of 'Beijing BYYYYY', was severely damaged." is the license plate number of the trailer license plate category, and between the 124th character and the 131st character is the license plate number of the small car license plate category.

[0053] Here, the labeled license plate number information in the training samples and the test samples may be obtained by manually labeling the corresponding historical police call handling texts.

[0054] In practice, in order to improve the matching degree of the regular expression corresponding to each preset license plate number category in the preset license plate number category set obtained by training to the preset license plate number, the historical police call texts in the training samples and test samples obtained here may not include invalid police call texts. For example, some police call texts do not include any license plate number and have no value in actually extracting the license plate number. Such police call texts can be considered invalid police call texts.

[0055] In some optional implementations, for each preset license plate number category in a preset license plate number category set, the ratio of the number of positive samples and the number of negative samples corresponding to the preset license plate number category in the training sample set may be within a first preset ratio range, that is, there cannot be too many positive samples and too few negative samples, or there cannot be too many negative samples and too few positive samples. As an example, the first preset ratio range may be between greater than or equal to 0.6 and less than or equal to 1.6. Among them, the positive samples corresponding to the preset license plate number category in the training sample set are the training samples whose license plate number information is annotated in each training sample of the training sample set and includes the preset license plate number category, and correspondingly, the negative samples corresponding to the preset license plate number category are the training samples whose license plate number information is annotated in each training sample of the training sample set and does not include the preset license plate number category.

[0056] In some optional implementations, for each preset license plate number category in the preset license plate number category set, the ratio of the number of positive samples and the number of negative samples corresponding to the preset license plate number category in the test sample set may be within a second preset ratio range, that is, there cannot be too many positive samples and too few negative samples, or there cannot be too many negative samples and too few positive samples. As an example, the second preset ratio range may be between greater than or equal to 0.6 and less than or equal to 1.6. Among them, the positive samples corresponding to the preset license plate number category in the test sample set are the test samples of the preset license plate number category whose labeled license plate number information is included in each test sample of the test sample set, and correspondingly, the negative samples corresponding to the preset license plate number category are the test samples of the preset license plate number category whose labeled license plate number information is not included in each test sample of the test sample set.

[0057] In some optional implementations, for each preset license plate number category in the preset license plate number category set, the ratio between the number of positive samples corresponding to the preset license plate number category in the training sample set and the number of positive samples corresponding to the preset license plate number category in the test sample set can be within a third preset ratio range. Here, generally speaking, the number of positive samples corresponding to the preset license plate number category in the training sample set is greater than the number of positive samples corresponding to the preset license plate number category in the test sample set, because a large number of positive samples are used for training and a small number of positive samples are used for testing, which is consistent with reducing the total number of samples required to a greater extent, thereby reducing the labor cost of annotating training samples and test samples.

[0058] Step 302: For each preset license plate number category in the preset license plate number category set, perform a first regular expression determination operation.

[0059] Here, the first regular expression determination operation may include the following steps 3021 to 3025:

[0060] Step 3021: determine the training samples whose license plate number information is marked including the preset license plate number category in each training sample as the positive training sample set corresponding to the preset license plate number category.

[0061] For ease of understanding, it is assumed that the preset license plate number category set includes {"small car license plate", "trailer license plate", "training car license plate"}, and the training sample set is as shown in Table 1. The sample number of the training sample and the corresponding annotated license plate number information are shown, but the specific content of the historical police call handling text is omitted.

[0062] It can be seen from Table 1 that the positive training sample set corresponding to the preset license plate number category of "small car license plate" in the training sample set may include: sample 1, sample 2, sample 4 and sample 7, the positive training sample set corresponding to the preset license plate number category of "trailer license plate" in the training sample set may include: sample 1, sample 2, sample 3, sample 4, sample 5 and sample 6, and the positive training sample set corresponding to the preset license plate number category of "training car license plate" in the training sample set may include: sample 1 and sample 3.

[0063] Table 1

[0064]

[0065] Step 3022: Select positive training samples from the positive training sample set corresponding to the preset license plate number category to form a target number of positive training sample subsets.

[0066] After obtaining the positive training sample set corresponding to the preset license plate number category in step 3021, the execution subject of the first training step can select positive training samples from the positive training sample set corresponding to the preset license plate number category to form a target number of positive training sample subsets. Here, the target number can be pre-set, and the target number can also be determined by receiving user input via the interface provided in the above execution subject.

[0067] In some optional implementations, step 3022 may be performed as follows:

[0068] Perform the target number of positive training sample subset generation operations to generate the target number of positive training sample subsets. The positive training sample subset generation operation includes: randomly selecting N positive training samples from the positive training sample set corresponding to the preset license plate number category to form a positive training sample subset, wherein N is an integer obtained by rounding down the quotient of L divided by M, L is the number of positive samples in the positive training sample set corresponding to the preset license plate number category, and M is a positive integer greater than or equal to 2 and less than L. For example, for example, the positive training sample set corresponding to the preset license plate number category includes 76 positive training samples, the target number is 4, M is 3, L is 76, and N is a positive integer 25 obtained by rounding down the quotient of 76 divided by 3. Here, the following operation is performed 4 times: randomly selecting 25 positive training samples from the positive training sample set including 76 positive training samples to form a positive training sample subset, and finally 4 positive training sample subsets are obtained, each positive training sample subset includes 25 positive training samples.

[0069] In some optional implementations, step 3022 may also be performed as follows:

[0070] The positive training sample set corresponding to the preset license plate number category is divided into a target number of positive training sample subsets, wherein the number of positive training samples in each subset is as close as possible. Specifically, assuming that the positive training sample set corresponding to the preset license plate number category includes L positive training samples, the target number is T, Q is a positive integer obtained by rounding down the quotient of L divided by T, and R is the remainder of L divided by T, then when R is zero, the positive training sample set corresponding to the preset license plate number category can be evenly divided into T positive training sample subsets, and the number of positive training samples in each positive training sample subset is Q. When R is greater than zero, the positive training sample set corresponding to the preset license plate number category can be evenly divided into T positive training sample subsets, wherein T-1 positive training sample subsets include Q positive training samples, and another positive training sample subset includes Q+R positive training samples.

[0071] Step 3023: For each of the target number of positive training sample subsets, generate a candidate regular expression corresponding to the preset license plate number category based on the positive training samples in this positive training sample subset.

[0072] After step 3022, positive training samples have been selected from the positive training sample set corresponding to the preset license plate number category to form the target number of positive training sample subsets. Here, the execution entity of the first training step can, for each of the target number of positive training sample subsets generated above, generate a candidate regular expression corresponding to the preset license plate number category based on the positive training samples in this positive training sample subset in various implementation manners. Specifically, for each positive training sample in this positive training sample subset, the license plate number of the preset license plate number category in the historical police contact text of this positive training sample can be obtained according to the start position and end position in the labeled license plate number information including the preset license plate number category among the labeled license plate number information of each positive training sample. Then, based on the preset license plate numbers obtained for the positive training samples in this positive training sample subset, a candidate regular expression corresponding to the preset license plate number category is generated. It should be noted that various implementation manners can be adopted to generate a regular expression based on at least one text. For example, the target repeated content can be used as the content in the regular expression, and the target variable content is represented by a wildcard in the regular expression, where the repetition ratio of the target repeated content in at least one text is greater than or equal to a preset ratio, and the repetition ratio of the target variable content in at least one text is less than the above preset ratio. As an example, the regular expression generated for the preset license plate number category of trailer license plates can be: _______gua, where _ is a wildcard for any character, that is, it means that the license plate numbers of the trailer license plate category include 9 digits, where the first 7 digits are any characters and the last two digits are "gua".

[0073] After step 3023, up to the target number of candidate regular expressions corresponding to the preset license plate number category can be generated.

[0074] Step 3024: Test each of the generated candidate regular expressions based on the test sample set to determine the accuracy rate corresponding to each generated candidate regular expression.

[0075] Specifically, the execution subject of the first training step can perform the following accuracy determination operation for each candidate regular expression generated in step 3023: First, for each test sample in the test sample set obtained in step 301, determine whether the historical police text in the test sample matches the candidate regular expression; if it is determined to be matched, it indicates that the historical police text in the test sample includes the license plate number of the preset license plate number category, and then further determine whether the annotated license plate number information in the test sample includes the preset license plate number category. If it is determined to be included, it is determined that the test sample is a positive sample relative to the candidate regular expression, and if it is determined not to be included, it is determined that the test sample is a negative sample relative to the candidate regular expression. Finally, the ratio of the number of test samples in the test sample set that are positive samples relative to the candidate regular expression divided by the total number of test samples in the test sample set is determined as the accuracy corresponding to the candidate regular expression.

[0076] Step 3025: determine the candidate regular expression with the highest accuracy among the generated candidate regular expressions as the regular expression corresponding to the preset license plate number category.

[0077] In some optional implementations, the regular expression corresponding to each preset license plate number category in the preset license plate number category set may also be expressed as follows: Figure 4 The second training step shown is pre-trained. Please refer to Figure 4 , Figure 4 A process 400 of an embodiment of a second training step according to the present disclosure is shown. The process 400 of the second training step may include the following steps:

[0078] Step 401: Obtain a training sample set.

[0079] Here, the execution subject of the second training step can be specifically referred to Figure 3 The relevant description of step 301 in the embodiment shown is not repeated here. In addition, for a detailed description of how to obtain a training sample set and training samples, please refer to Figure 3 The relevant description in step 301 in the illustrated embodiment will not be repeated here.

[0080] Step 402: For each preset license plate number category in the preset license plate number category set, perform a second regular expression determination operation.

[0081] Here, the second regular expression determination operation includes the following steps 4021 to 4022:

[0082] Step 4021: determine the training samples whose license plate number information is marked including the preset license plate number category in each training sample as the positive training sample set corresponding to the preset license plate number category.

[0083] Here, the specific operation of sub-step 4021 and the technical effect it brings are the same as Figure 3 The corresponding descriptions in step 3021 in the illustrated embodiment are basically the same and will not be repeated here.

[0084] Step 4022: Based on the positive training sample set corresponding to the preset license plate number category, generate a regular expression corresponding to the preset license plate number category.

[0085] Specifically, the execution subject of the second training step can first obtain the preset license plate number in the historical police call handling text of the positive training sample according to the starting position and the ending position of the labeled license plate number information of each labeled license plate number information of the positive training sample, including the preset license plate number category. Then, based on the preset license plate number obtained for each positive training sample in the positive training sample set corresponding to the preset license plate number category, a regular expression corresponding to the preset license plate number category is generated. It should be noted that various implementation methods can be used to generate a regular expression based on at least one text.

[0086] According to the regular expressions corresponding to each preset license plate number category in the preset license plate number category set obtained by training in the second training step shown in the above process 400, the regular expressions corresponding to the preset license plate number category are obtained by training with the training sample set, and the manual cost of generating the regular expressions corresponding to the preset license plate number category is reduced. According to the regular expressions corresponding to each preset license plate number category in the preset license plate number category set obtained by training in the first training step shown in the above process 300, the target number of candidate regular expressions are obtained by training with the training sample set, and the generated candidate regular expressions are tested with the test sample set, and the candidate regular expression with the highest accuracy is selected as the regular expression corresponding to the preset license plate number category. In addition to automatically generating the regular expressions corresponding to the preset license plate number category, the expression matching degree of the regular expression to the license plate number of the preset license plate number category can be improved because it has been tested with the test sample set.

[0087] The method provided by the above-mentioned embodiment of the present disclosure realizes automatic extraction of license plate numbers from police response texts by utilizing the regular expression corresponding to each target license plate number, without the need for manual operation, thereby reducing the cost of extracting license plate numbers from police response texts and improving the speed of extracting license plate numbers from police response texts.

[0088] Further references Figure 5As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a device for extracting license plate numbers from police text based on regular expressions. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0089] like Figure 5 As shown, the regular expression-based alarm text license plate number extraction device 500 of this embodiment includes: an acquisition unit 501 and an extraction unit 502. The acquisition unit 501 is configured to acquire the alarm text of the license plate number to be extracted and the target license plate number category set, wherein each of the above target license plate number categories belongs to the preset license plate number category set; and the extraction unit 502 is configured to match the above license plate number alarm text to be extracted with the regular expression corresponding to each target license plate number category in the above target license plate number category set, so as to extract the corresponding target license plate number in the above license plate number alarm text to be extracted.

[0090] In this embodiment, the specific processing of the acquisition unit 501 and the extraction unit 502 of the regular expression-based police text license plate number extraction device 500 and the technical effects thereof can be referred to in Figure 2 The relevant descriptions of step 201 and step 202 in the corresponding embodiment are not repeated here.

[0091] In some optional implementations of the present embodiment, the regular expression corresponding to each preset license plate number category in the above-mentioned preset license plate number category set may be pre-trained through the following first training step: obtaining a training sample set and a test sample set, wherein the training sample and the test sample both include historical police call texts and annotated license plate number information, wherein the annotated license plate number information is used to characterize the license plate numbers of each preset license plate number category included in the historical police call text; for each preset license plate number category in the above-mentioned preset license plate number category set, performing the following first regular expression determination operation: confirming the training samples whose annotated license plate number information includes the preset license plate number category in each of the above-mentioned training samples The method comprises the following steps: determining a positive training sample set corresponding to the preset license plate number category; selecting positive training samples from the positive training sample set corresponding to the preset license plate number category to form a target number of positive training sample subsets; for each positive training sample subset in the target number of positive training sample subsets, generating a candidate regular expression corresponding to the preset license plate number category based on each positive training sample in the positive training sample subset; testing each generated candidate regular expression based on the above-mentioned test sample set to determine the accuracy corresponding to each generated candidate regular expression; and determining the candidate regular expression with the highest accuracy among the generated candidate regular expressions as the regular expression corresponding to the preset license plate number category.

[0092] In some optional implementations of the present embodiment, the selecting of positive training samples from the positive training sample set corresponding to the preset license plate number category to form a target number of positive training sample subsets may include: performing the target number of positive training sample subset generation operations to generate the target number of positive training sample subsets, the positive training sample subset generation operation including: randomly selecting N positive training samples from the positive training sample set corresponding to the preset license plate number category to form a positive training sample subset, wherein the N is an integer obtained by rounding down the quotient of L divided by M, the L is the number of positive samples in the positive training sample set corresponding to the preset license plate number category, and the M is a positive integer greater than or equal to 2 and less than the L.

[0093] In some optional implementations of the present embodiment, the regular expression corresponding to each preset license plate number category in the above-mentioned preset license plate number category set may be pre-trained through the following second training step: obtaining a training sample set, wherein the training sample includes historical police call texts and annotated license plate number information, wherein the annotated license plate number information is used to characterize the license plate numbers of each of the above-mentioned preset license plate number categories included in the historical police call texts; for each preset license plate number category in the above-mentioned preset license plate number category set, performing the following second regular expression determination operation: determining the training samples whose annotated license plate number information in each of the above-mentioned training samples includes the preset license plate number category as the positive training sample set corresponding to the preset license plate number category; and generating a regular expression corresponding to the preset license plate number category based on the positive training sample set corresponding to the preset license plate number category.

[0094] In some optional implementations of this embodiment, the above-mentioned preset license plate number category set may include at least one of the following: small car license plate, large car license plate, trailer license plate, embassy and consulate car license plate, Hong Kong and Macao entry and exit license plate, training car license plate, police car license plate, and new military license plate.

[0095] It should be noted that the implementation details and technical effects of each unit in the regular expression-based police call text license plate number extraction device provided in the embodiment of the present disclosure can be referred to the description of other embodiments in the present disclosure, and will not be repeated here.

[0096] Reference below Figure 6 , which shows a schematic diagram of the structure of a computer system 600 suitable for implementing an electronic device of an embodiment of the present disclosure. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0097] like Figure 6As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage part 608 to the random access memory (RAM) 603. Various programs and data required for the operation of the system 600 are also stored in the RAM 603. The CPU 601, the ROM 602 and the RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0098] The following components are connected to the I / O interface 605: an input section 606 including a touch screen, a handwriting tablet, a keyboard, or a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet.

[0099] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609. When the computer program is executed by the central processing unit (CPU) 601, the above functions defined in the method of the present disclosure are executed. It should be noted that the computer-readable medium described in the present disclosure can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, device, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0100] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0101] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0102] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes an acquisition unit and an extraction unit. The names of these units do not constitute a limitation on the units themselves in some cases, for example, the acquisition unit may also be described as "a unit for acquiring the alarm text of the license plate number to be extracted and the target license plate number category set".

[0103] As another aspect, the present disclosure also provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by the device, the device: obtains the to-be-extracted license plate number alarm reception text and the target license plate number category set, wherein each of the above target license plate number categories belongs to a preset license plate number category set; matches the to-be-extracted license plate number alarm reception text with the regular expressions corresponding to each target license plate number category in the above target license plate number category set, so as to extract the corresponding target license plate number in the to-be-extracted license plate number alarm reception text.

[0104] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present disclosure is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other.

Claims

1. A method for extracting license plate numbers from police call text based on regular expressions, comprising: Obtaining the alarm text of the license plate number to be extracted and the target license plate number category set, wherein each of the target license plate number categories belongs to a preset license plate number category set; Matching the to-be-extracted license plate number alarm text with the regular expressions corresponding to the target license plate number categories in the target license plate number category set to extract the corresponding target license plate number in the to-be-extracted license plate number alarm text; The regular expression corresponding to each preset license plate number category in the preset license plate number category set is pre-trained through the following first training step: A training sample set and a test sample set are obtained, wherein both the training sample and the test sample include historical alarm texts and annotated license plate number information, wherein the annotated license plate number information is used to characterize the license plate numbers of each of the preset license plate number categories included in the historical alarm texts; the training sample and the test sample include at least one annotated license plate number information; the annotated license plate number information includes a preset license plate number category and a starting position and an ending position, and is used to characterize that the content between the starting position and the ending position of the historical alarm text in the training sample is a license plate number of the preset license plate number category; the historical alarm texts in the training sample and the test sample do not include invalid alarm texts, and alarm texts that do not include any license plate number are considered invalid alarm texts; For each preset license plate number category in the preset license plate number category set, the following first regular expression determination operation is performed: the training samples whose license plate number information is annotated in each of the training samples and includes the preset license plate number category are determined as the positive training sample set corresponding to the preset license plate number category; positive training samples are selected from the positive training sample set corresponding to the preset license plate number category to form a target number of positive training sample subsets; for each positive training sample subset in the target number of positive training sample subsets, a candidate regular expression corresponding to the preset license plate number category is generated based on each positive training sample in the positive training sample subset; each generated candidate regular expression is tested based on the test sample set to determine the accuracy corresponding to each generated candidate regular expression; and the candidate regular expression with the highest accuracy among the generated candidate regular expressions is determined as the regular expression corresponding to the preset license plate number category; Among them, for each preset license plate number category in the preset license plate number category set, the ratio of the number of positive samples and the number of negative samples corresponding to the preset license plate number category in the training sample set is within a first preset ratio range, and the first preset ratio range is between greater than or equal to 0.6 and less than or equal to 1.6; the ratio of the number of positive samples and the number of negative samples corresponding to the preset license plate number category in the test sample set is within a second preset ratio range, and the second preset ratio range is between greater than or equal to 0.6 and less than or equal to 1.6; the number of positive samples corresponding to the preset license plate number category in the training sample set is greater than the number of positive samples corresponding to the preset license plate number category in the test sample set; The step of selecting positive training samples from the positive training sample set corresponding to the preset license plate number category to form a target number of positive training sample subsets includes: Executing the target number of positive training sample subset generation operations to generate the target number of positive training sample subsets, the positive training sample subset generation operation comprising: randomly selecting N positive training samples from the positive training sample set corresponding to the preset license plate number category to form a positive training sample subset, wherein N is an integer obtained by rounding down the quotient of L divided by M, L is the number of positive samples in the positive training sample set corresponding to the preset license plate number category, and M is a positive integer greater than or equal to 2 and less than L; The generating of a candidate regular expression corresponding to the preset license plate number category based on each positive training sample in the positive training sample subset includes: First, for each positive training sample in the positive training sample subset, the license plate number of the preset license plate number category in the historical police call text of the positive training sample is obtained according to the starting position and the ending position in the labeled license plate number information of each labeled license plate number information of the positive training sample, including the labeled license plate number category; then, based on the preset license plate number obtained for each positive training sample in the positive training sample subset, a candidate regular expression corresponding to the preset license plate number category is generated, wherein the target repeated content is used as the content in the regular expression, and the target variable content is represented by a wildcard in the regular expression, wherein the repetition ratio of the target repeated content in at least one text is greater than or equal to the preset ratio, and the repetition ratio of the target variable content in at least one text is less than the above preset ratio; The preset license plate number category set includes at least one of the following: small car license plate, large car license plate, trailer license plate, embassy and consulate car license plate, Hong Kong and Macao entry and exit license plate, training car license plate, police car license plate, and new military license plate.

2. A device for extracting license plate numbers from police text based on regular expressions, comprising: An acquisition unit is configured to acquire the alarm text of the license plate number to be extracted and a target license plate number category set, wherein each of the target license plate number categories belongs to a preset license plate number category set; An extraction unit is configured to match the to-be-extracted license plate number alarm text with regular expressions corresponding to each target license plate number category in the target license plate number category set, so as to extract the corresponding target license plate number in the to-be-extracted license plate number alarm text; The regular expression corresponding to each preset license plate number category in the preset license plate number category set is pre-trained through the following first training step: A training sample set and a test sample set are obtained, wherein both the training sample and the test sample include historical alarm texts and annotated license plate number information, wherein the annotated license plate number information is used to characterize the license plate numbers of each of the preset license plate number categories included in the historical alarm texts; the training sample and the test sample include at least one annotated license plate number information; the annotated license plate number information includes a preset license plate number category and a starting position and an ending position, and is used to characterize that the content between the starting position and the ending position of the historical alarm text in the training sample is a license plate number of the preset license plate number category; the historical alarm texts in the training sample and the test sample do not include invalid alarm texts, and alarm texts that do not include any license plate number are considered invalid alarm texts; For each preset license plate number category in the preset license plate number category set, the following first regular expression determination operation is performed: the training samples whose license plate number information is annotated in each of the training samples and includes the preset license plate number category are determined as the positive training sample set corresponding to the preset license plate number category; positive training samples are selected from the positive training sample set corresponding to the preset license plate number category to form a target number of positive training sample subsets; for each positive training sample subset in the target number of positive training sample subsets, a candidate regular expression corresponding to the preset license plate number category is generated based on each positive training sample in the positive training sample subset; each generated candidate regular expression is tested based on the test sample set to determine the accuracy corresponding to each generated candidate regular expression; and the candidate regular expression with the highest accuracy among the generated candidate regular expressions is determined as the regular expression corresponding to the preset license plate number category; Among them, for each preset license plate number category in the preset license plate number category set, the ratio of the number of positive samples and the number of negative samples corresponding to the preset license plate number category in the training sample set is within a first preset ratio range, and the first preset ratio range is between greater than or equal to 0.6 and less than or equal to 1.6; the ratio of the number of positive samples and the number of negative samples corresponding to the preset license plate number category in the test sample set is within a second preset ratio range, and the second preset ratio range is between greater than or equal to 0.6 and less than or equal to 1.6; the number of positive samples corresponding to the preset license plate number category in the training sample set is greater than the number of positive samples corresponding to the preset license plate number category in the test sample set; The step of selecting positive training samples from the positive training sample set corresponding to the preset license plate number category to form a target number of positive training sample subsets includes: Executing the target number of positive training sample subset generation operations to generate the target number of positive training sample subsets, the positive training sample subset generation operation comprising: randomly selecting N positive training samples from the positive training sample set corresponding to the preset license plate number category to form a positive training sample subset, wherein N is an integer obtained by rounding down the quotient of L divided by M, L is the number of positive samples in the positive training sample set corresponding to the preset license plate number category, and M is a positive integer greater than or equal to 2 and less than L; The generating of a candidate regular expression corresponding to the preset license plate number category based on each positive training sample in the positive training sample subset includes: First, for each positive training sample in the positive training sample subset, the license plate number of the preset license plate number category in the historical police call text of the positive training sample is obtained according to the starting position and the ending position in the labeled license plate number information of each labeled license plate number information of the positive training sample, including the labeled license plate number category; then, based on the preset license plate number obtained for each positive training sample in the positive training sample subset, a candidate regular expression corresponding to the preset license plate number category is generated, wherein the target repeated content is used as the content in the regular expression, and the target variable content is represented by a wildcard in the regular expression, wherein the repetition ratio of the target repeated content in at least one text is greater than or equal to the preset ratio, and the repetition ratio of the target variable content in at least one text is less than the above preset ratio; The preset license plate number category set includes at least one of the following: small car license plate, large car license plate, trailer license plate, embassy and consulate car license plate, Hong Kong and Macao entry and exit license plate, training car license plate, police car license plate, and new military license plate.

3. An electronic device, comprising: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method as claimed in claim 1 .

4. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to claim 1 is implemented.