Vehicle-mounted equipment license plate recognition method based on bloom filter and related equipment
By using Bloom filter technology, license plate numbers are mapped to multiple hash locations, and disk files are accessed only when all hash location values are preset values. This solves the real-time problem of vehicle license plate recognition systems and achieves efficient license plate recognition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-10
- Publication Date
- 2026-03-13
AI Technical Summary
The existing vehicle license plate recognition system lacks real-time performance, mainly because the direct reading and matching mechanism based on disk files requires traversing the entire file, resulting in a response time of over 100 milliseconds, which makes it difficult to meet real-time requirements.
By employing Bloom filter technology, the license plate to be identified and the parameters of the Bloom filter are obtained. Multiple hash functions are used to map the license plate to the array position of the Bloom filter. The license plate blacklist file is only obtained for identification when the values of all array positions are preset values, thereby reducing disk I/O operations.
It significantly improves query efficiency, greatly shortens response time, meets real-time requirements, reduces memory usage by 98%, reduces disk I/O operations by 99.5%, and increases query speed by 125 times.
Smart Images

Figure CN121661472A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of big data processing technology, and in particular to a vehicle license plate recognition method and related equipment based on Bloom filters. Background Technology
[0002] With the rapid development of intelligent transportation systems, vehicle license plate recognition systems, as one of their core technologies, are playing an increasingly important role in modern urban management and public safety. This technology automatically reads vehicle license plate information through image processing and pattern recognition, and is widely used in scenarios such as blacklist monitoring.
[0003] Currently, a direct read and match mechanism based on disk files is generally used. Specifically, the blacklisted license plate numbers are first stored line by line in plain text format in a disk file; when license plate recognition is needed, the disk file is opened, the license plate numbers are read line by line, and a string comparison function is used for precise matching. Its core matching algorithm is a linear search, meaning the entire file content must be traversed until a match is found or the search is complete. However, because it requires traversing the entire disk file, the average response time exceeds 100 milliseconds, making it difficult to meet real-time requirements. Summary of the Invention
[0004] This application provides a vehicle license plate recognition method and related equipment based on Bloom filters, with the aim of meeting real-time requirements.
[0005] To achieve the above objectives, this application provides the following technical solution:
[0006] The first aspect of this application provides a vehicle license plate recognition method based on a Bloom filter for in-vehicle equipment, including:
[0007] Obtain the license plate to be identified and the parameters of the Bloom filter; the parameters include at least multiple hash functions;
[0008] For each of the hash functions, the license plate to be identified is calculated using the hash function to obtain the array position of the license plate to be identified in the Bloom filter;
[0009] When all array positions have preset values, retrieve the license plate blacklist file;
[0010] The blacklist file is used to identify the license plate to be identified, and the identification result of the license plate to be identified is obtained.
[0011] Optionally, before obtaining the parameters of the license plate to be identified and the Bloom filter, the process further includes:
[0012] Read all license plates from the license plate blacklist file;
[0013] Configure the parameters for the Bloom filter;
[0014] Once the parameters of the Bloom filter are configured, initialize the values of all array positions in the Bloom filter;
[0015] Once the Bloom filter is initialized, for each license plate, the hash function is used to calculate the license plate's array position in the Bloom filter.
[0016] Set the license plate's array position in the Bloom filter to a preset value.
[0017] Optionally, the parameters for configuring the Bloom filter include:
[0018] Get the total number of all license plates;
[0019] The array length is calculated based on the number of all license plates and the array length formula.
[0020] Multiple hash functions are determined based on the array length;
[0021] The parameters of the Bloom filter are constructed based on the array length and the multiple hash functions.
[0022] Optionally, the step of using the hash function to calculate the array position of the license plate to be identified in the Bloom filter includes:
[0023] Obtain the array length from the parameters of the Bloom filter;
[0024] The license plate to be identified is converted using the hash function to obtain a hash value;
[0025] The ratio between the hash value and the array length is calculated to obtain the array position of the license plate to be identified in the Bloom filter.
[0026] Optionally, after calculating the array position of the license plate to be identified in the Bloom filter using the hash function, the method further includes:
[0027] When the value of any of the array positions is not a preset value, the recognition result of the license plate to be recognized is determined to be that the license plate to be recognized is not in the blacklist.
[0028] Optionally, the step of using the blacklist file to identify the license plate to obtain the identification result includes:
[0029] Read the blacklisted license plates from the blacklist file line by line;
[0030] For each of the blacklisted license plates, the blacklisted license plate is compared with the license plate to be identified to obtain the comparison result;
[0031] The identification result of the license plate to be identified is determined based on the comparison results.
[0032] Optionally, determining the recognition result of the license plate to be identified based on the comparison result includes:
[0033] When the blacklisted license plate matches the license plate to be identified, the identification result of the license plate to be identified is determined to be that the license plate to be identified is in the blacklist;
[0034] When the license plate in the blacklist does not match the license plate to be identified, the identification result of the license plate to be identified is determined to be that the license plate to be identified is not in the blacklist.
[0035] A second aspect of this application provides a vehicle license plate recognition device based on a Bloom filter, comprising:
[0036] An acquisition unit is used to acquire the license plate to be identified and the parameters of the Bloom filter; the parameters include at least a plurality of hash functions;
[0037] The calculation unit is used to calculate the license plate to be identified using the hash function for each of the hash functions, so as to obtain the array position of the license plate to be identified in the Bloom filter;
[0038] The file acquisition unit is used to acquire the license plate blacklist file when all array positions have preset values;
[0039] The identification unit is used to identify the license plate to be identified using the blacklist file, and obtain the identification result of the license plate to be identified.
[0040] A third aspect of this application provides a computer device, including: a processor and a memory, the processor and the memory being connected via a bus; wherein, the processor is used to call and execute a program stored in the memory; the memory is used to store the program, the program being used to implement the vehicle license plate recognition method based on a Bloom filter provided in the first aspect of this application.
[0041] The fourth aspect of this application provides a storage medium storing computer-executable instructions for executing the vehicle license plate recognition method based on a Bloom filter provided in the first aspect of this application.
[0042] The technical solution provided in this application obtains parameters of the license plate to be identified and a Bloom filter. The parameters include at least multiple hash functions. For each hash function, the license plate to be identified is calculated using the hash function to obtain the array position of the license plate in the Bloom filter. When the values of all array positions are preset values, a license plate blacklist file is obtained. The license plate to be identified is then identified using the blacklist file to obtain the identification result. By using a Bloom filter, the license plate number is mapped to multiple hash positions. Disk files are only accessed when the values of all hash positions are preset values, thus effectively reducing disk I / O operations. The design of the Bloom filter ensures that only a small amount of hash calculation is required for each query, significantly improving query efficiency and greatly shortening response time, thereby meeting real-time requirements. Attached Figure Description
[0043] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0044] Figure 1 A flowchart illustrating a vehicle license plate recognition method based on a Bloom filter, provided in this application embodiment;
[0045] Figure 2 A schematic diagram illustrating the array positions of license plates provided in an embodiment of this application;
[0046] Figure 3 A schematic diagram illustrating another array position of license plates provided in an embodiment of this application;
[0047] Figure 4 A schematic diagram of a vehicle-mounted license plate recognition system provided in an embodiment of this application;
[0048] Figure 5 A schematic diagram of the architecture of a vehicle license plate recognition device based on a Bloom filter is provided for an embodiment of this application;
[0049] Figure 6 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0050] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0051] In this application, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0052] like Figure 1 The flowchart shown is a method for vehicle license plate recognition based on a Bloom filter provided in an embodiment of this application, including the following steps:
[0053] S101: Obtain the parameters of the license plate to be identified and the Bloom filter.
[0054] The parameters include at least multiple hash functions (e.g., 7 hash functions), bit array length (e.g., 12Mb, or 12,000,000 megabits), expected false positive rate (e.g., 0.5%), number of supported elements (e.g., number of license plates, or 1 million), and actual memory usage (e.g., 1.25MB, which is the bit array length divided by 8 to get the byte size).
[0055] Specifically, the formula for calculating the expected false positive rate in a Bloom filter is shown in formula (1).
[0056] (1)
[0057] In formula (1), p is the expected false positive rate, k is the number of hash functions, n is the number of elements, i.e. the number of license plates, and m is the length of the bit array.
[0058] It's worth noting that the advantages of a Bloom filter lie in its efficient storage and query performance. First, it stores only bit information; each license plate occupies only 7 bits, instead of storing the entire string, significantly saving memory. Second, the array is compact; for example, a 12-megabit bit array can represent 12 million distinct positions. Furthermore, Bloom filters avoid duplicate storage, preventing multiple license plates from mapping to the same position, further saving storage space. During queries, Bloom filters are extremely fast. They require only 7 hash calculations, eliminating the need to traverse all 1 million license plates, greatly reducing query time. Since bitwise operations are very fast, simply checking whether the array position's value is 0 or 1 is extremely quick. Additionally, memory locality of access also improves query speed, as the array positions are stored contiguously, increasing cache hit rate and further accelerating the query process.
[0059] Optionally, before step S101, the license plate numbers in the blacklist file need to be loaded into the Bloom filter so that the Bloom filter can be used for preliminary screening of the license plates in the blacklist. Therefore, another embodiment of this application provides a method for storing blacklisted license plates using a Bloom filter, including processes A1 to A5.
[0060] A1: Read all license plates from the license plate blacklist file.
[0061] A2: Parameters for configuring the Bloom filter.
[0062] The parameters of a Bloom filter include at least a hash function and an array length.
[0063] Optionally, in another embodiment of this application, the specific implementation of process A2 includes processes B1 to B4.
[0064] B1: Get the total number of all license plates.
[0065] B2: Calculate the array length based on the number of all license plates and the array length formula.
[0066] Specifically, the array length formula is m = -n * ln(p) / (ln(2)^2), where n = 1 million, p is approximately 0.5%, and rounding down gives m = 12,000,000 bits.
[0067] In addition, the array length can be adjusted to a multiple of 8 to improve memory access efficiency.
[0068] B3: Determine multiple hash functions based on array length.
[0069] Understandably, determining the number of hash functions based on the array length means selecting the optimal number of hash functions to ensure that the false positive rate of the Bloom filter is as low as possible.
[0070] Specifically, the form of determining multiple hash functions based on the array length is: k = (m / n) * ln(2). Where k is the number of hash functions.
[0071] B4: Parameters for constructing a Bloom filter based on array length and multiple hash functions.
[0072] A3: After the parameters of the Bloom filter are configured, initialize the values of all array positions in the Bloom filter.
[0073] It is understandable that initializing the values of all array positions in the Bloom filter means setting all array positions to 0.
[0074] For example, when initializing the values at all array positions in a Bloom filter, the initialized array positions are: [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0..]. All array positions have a value of 0.
[0075] A4: After the Bloom filter is initialized, for each license plate, a hash function is used to calculate the license plate's position in the Bloom filter array.
[0076] Specifically, the license plate is converted using a hash function to obtain the corresponding hash value. The ratio between the hash value and the array length is calculated to obtain the array position of the license plate in the Bloom filter.
[0077] For example, if the license plate is XA12345, the number of hash functions is 7, and the array length is 12,000,000, the license plate is processed using 7 hash functions to obtain the corresponding hash value. The ratio of the hash value to the array length is then calculated to obtain the array position of the license plate in the Bloom filter, as shown below:
[0078] hash1("XA12345") → Hash value: 0x1A2B3C4D → Array position: 0x1A2B3C4D%12000000=12345;
[0079] hash2("XA12345") → Hash value: 0x5E6F7A8B → Array position: 0x5E6F7A8B%12000000=23456;
[0080] hash3("XA12345") → Hash value: 0x9C8D7E6F → Array position: 0x9C8D7E6F%12000000=34567;
[0081] hash4("XA12345") → Hash value: 0x4B3A2C1D → Array position: 0x4B3A2C1D%12000000=45678;
[0082] hash5("XA12345") → Hash value: 0x8F7E6D5C → Array position: 0x8F7E6D5C%12000000=56789;
[0083] hash6("XA12345") → Hash value: 0x2A1B3C4D → Array position: 0x2A1B3C4D%12000000=67890;
[0084] hash7("XA12345") → Hash value: 0x6E5F4D3C → Array position: 0x6E5F4D3C%12000000=78901.
[0085] For example, if the license plate is X67890, seven hash functions are used to convert the license plate to obtain its hash value. The ratio between the hash value and the array length is then calculated to determine the license plate's array position in the Bloom filter, as shown below:
[0086] hash1("XB67890") → Hash value: 0x2B3C4D5E → Array position: 0x2B3C4D5E%12000000=11111;
[0087] hash2("XB67890") → Hash value: 0x6F7A8B9C → Array position: 0x6F7A8B9C%12000000=22222;
[0088] hash3("XB67890") → Hash value: 0x1D2E3F4A → Array position: 0x1D2E3F4A%12000000=33333;
[0089] hash4("XB67890") → Hash value: 0x5C6D7E8F → Array position: 0x5C6D7E8F%12000000=44444;
[0090] hash5("XB67890") → Hash value: 0x9A8B7C6D → Array position: 0x9A8B7C6D%12000000=55555;
[0091] hash6("XB67890") → Hash value: 0x3C4D5E6F → Array position: 0x3C4D5E6F%12000000=66666;
[0092] hash7("XB67890") → Hash value: 0x7E8F9A0B → Array position: 0x7E8F9A0B%12000000=78901.
[0093] A5: Sets the position of the license plate in the Bloom filter to the preset value.
[0094] Optional, the default value includes, but is not limited to, 1.
[0095] For example, the license plate XA12345 calculates the array positions as 12345, 23456, 34567, 45678, 56789, 67890, and 78901. Setting the value of each array position to 1, as shown... Figure 2 As shown.
[0096] For example, the calculated array positions for license plate X67890 are 11111, 22222, 33333, 44444, 55555, 66666, and 78901. Setting the value of each array position to 1, as shown... Figure 3 As shown.
[0097] In some examples, hash collisions may occur when a low-probability event occurs, meaning different license plates yield the same hash value after hash calculation. This situation is called a hash collision. In a Bloom filter, when multiple hash functions map to the same location, the same location will be repeatedly marked as 1. To reduce the probability of false positives caused by hash collisions, we used seven different hash functions to calculate the license plate number, thereby generating multiple distinct locations and reducing the probability of collisions.
[0098] It should be noted that after processing all license plates, for example, 1 million license plates, the array positions become [1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0,1..]. In a scenario with 1 million license plates and a 0.5% false positive rate, approximately 47% of the positions in the final generated array will be set to 1.
[0099] It is important to emphasize that this application uses `std::vector` to store array positions, with each array position occupying only 1 bit, thus saving significant memory space. In terms of memory management, a memory fragmentation control strategy is employed to avoid frequent allocation of numerous small objects, thereby effectively reducing memory fragmentation. Simultaneously, cache friendliness is considered in the design, with array positions stored contiguously to improve CPU cache hit rate, further optimizing performance. Furthermore, real-time memory usage monitoring is implemented, effectively preventing memory leaks and ensuring long-term stable operation.
[0100] S102: For each hash function, use the hash function to calculate the array position of the license plate to be identified in the Bloom filter.
[0101] For example, if the license plate to be identified is A12345, there are 7 hash functions. For each hash function, the license plate is calculated to obtain the array position of the license plate in the Bloom filter as follows: hash1("XA12345")=12345, hash2("XA12345")=23456, hash3("XA12345")=34567, hash4("XA12345")=45678, hash5("XA12345")=56789, hash6("XA12345")=67890 and hash7("XA12345")=78901.
[0102] Optionally, in another embodiment of this application, the specific implementation of using a hash function to calculate the license plate to be identified in step S102 to obtain the array position of the license plate to be identified in the Bloom filter includes processes C1 to C3.
[0103] C1: Get the array length from the parameters of the Bloom filter.
[0104] C2: Use a hash function to convert the license plate to be identified and obtain the hash value.
[0105] Understandably, a hash function acts like a numbering machine, converting any input (such as a license plate) into a number within a fixed range. In this application, a hash function can be used to convert an input of arbitrary length into a 32-bit integer (such as 0x1A2B3C4D), i.e., a hash value.
[0106] C3: Calculate the ratio between the hash value and the array length to obtain the array position of the license plate to be identified in the Bloom filter.
[0107] It is understandable that calculating the ratio between the hash value and the array length, that is, using the hash value to the array length range, yields the array position in the Bloom filter.
[0108] Optionally, after step S102, the method further includes:
[0109] If the value at any array position is not a preset value, the recognition result of the license plate to be recognized is determined to be that the license plate to be recognized is not in the blacklist.
[0110] S103: When all array positions have the preset value, obtain the license plate blacklist file.
[0111] For example, check the values at array positions 12345, 23456, 34567, 45678, 56789, 67890, and 78901 to determine whether the values at those array positions are preset values.
[0112] Understandably, when all array positions have the preset values, a secondary confirmation via disk is required, i.e., obtaining the license plate blacklist file (such as blacklist.txt).
[0113] S104: Use the blacklist file to identify the license plate to obtain the identification result of the license plate to be identified.
[0114] The identification result of the license plate to be identified includes whether the license plate to be identified is in the blacklist or not.
[0115] Optionally, in another embodiment of this application, the specific implementation of step S104 includes processes D1 to D3.
[0116] D1: Read the blacklisted license plates line by line from the blacklist file.
[0117] D2: For each blacklisted license plate, compare the blacklisted license plate with the license plate to be identified to obtain the comparison result.
[0118] Understandably, a blacklisted license plate is read from the blacklist file, and then compared with the license plate to be identified to obtain the comparison result.
[0119] D3: Determine the recognition result of the license plate to be identified based on the comparison results.
[0120] Optionally, the specific implementation process for determining the identification result of the license plate to be identified based on the comparison result is as follows: when the license plate in the blacklist is consistent with the license plate to be identified, the identification result of the license plate to be identified is determined to be that the license plate to be identified is in the blacklist; when the license plate in the blacklist is inconsistent with the license plate to be identified, the identification result of the license plate to be identified is determined to be that the license plate to be identified is not in the blacklist.
[0121] In some examples, based on actual code implementation and testing, this application demonstrates significant performance advantages. Regarding memory usage, the traditional solution requires 70MB of memory to process 1 million license plate records, while the solution in this application requires only 1.25MB, saving 67.5MB of memory and reducing memory usage by 98%. In terms of query speed, the average query time for the traditional disk solution is 100 milliseconds, and for the traditional memory solution it is 10 milliseconds, while the average query time for the solution in this application is only 0.8 milliseconds, representing a 125-fold improvement over the disk solution and a 12.5-fold improvement over the memory solution. Regarding disk I / O, the traditional solution requires disk access for every query, while the solution in this application requires disk access for only 0.5% of queries, reducing disk I / O operations by 99.5%. These data demonstrate that this invention has significant advantages in memory saving, query speed, and disk I / O optimization.
[0122] It can be seen that the traditional solution requires about 70MB of memory to identify whether a license plate belongs to the blacklist, while this solution uses a Bloom filter and only requires 1.25MB. The memory usage is reduced from 70MB to 1.25MB, saving about 98% of the memory space. This enables low-end embedded devices to support blacklist databases of millions of entries, while freeing up a lot of memory resources for other system functions.
[0123] In terms of query speed, the traditional disk solution takes about 10ms to read, and the pure memory solution also takes about 10ms. However, the Bloom filter takes only 0.8ms to read, which is about 125 times faster than the disk solution and about 12.5 times faster than the pure memory solution. Moreover, it only requires 7 hash calculations to complete the initial screening.
[0124] Furthermore, traditional disk solutions require disk access every time license plate recognition is performed, while the Bloom filter solution only accesses the disk when all values at the corresponding positions in the array are preset values. This reduces disk I / O operations from 100% to 0.5%, reducing disk access by approximately 99.5% and significantly extending the lifespan of the disk hardware.
[0125] To better illustrate Figure 1 For the content shown, please refer to [link / reference]. Figure 4The diagram illustrates a vehicle license plate recognition system for an in-vehicle device. This system includes a data preprocessing module, a Bloom filter module, a secondary verification module, and a result output module. The data preprocessing module preprocesses all license plates in a blacklist file, setting the values at the corresponding array positions of the license plates to 1, thus obtaining a processed Bloom filter. The Bloom filter module performs initial screening of the license plates to be recognized, including using a hash function to transform the license plates and obtain their array positions within the Bloom filter. When all values at the array positions of the license plates to be recognized are 1, the secondary verification module re-identifies the license plates to obtain the recognition result. The result output module then provides feedback on the recognition result.
[0126] In summary, by using a Bloom filter to map license plate numbers to multiple hash locations, disk file access is only required when all hash locations match a preset value, effectively reducing disk I / O operations. The design of the Bloom filter ensures that each query requires only a small amount of hash calculation, significantly improving query efficiency and drastically reducing response time, thus meeting real-time requirements.
[0127] like Figure 5 The diagram shown is an architectural schematic of a vehicle license plate recognition device based on a Bloom filter provided in an embodiment of this application. The recognition device includes: an acquisition unit 100, a calculation unit 200, a file acquisition unit 300, and a recognition unit 400.
[0128] The acquisition unit 100 is used to acquire the license plate to be identified and the parameters of the Bloom filter; the parameters include at least multiple hash functions.
[0129] The calculation unit 200 is used to calculate the array position of the license plate to be identified in the Bloom filter for each hash function.
[0130] The computing unit 200 includes:
[0131] The length retrieval sub-unit is used to obtain the array length from the parameters of the Bloom filter.
[0132] The transformation subunit is used to transform the license plate to be identified using a hash function to obtain a hash value.
[0133] The calculation subunit is used to calculate the ratio between the hash value and the array length to obtain the array position of the license plate to be identified in the Bloom filter.
[0134] The file acquisition unit 300 is used to acquire the license plate blacklist file when all array positions have preset values.
[0135] The recognition unit 400 is used to recognize the license plate to be recognized using a blacklist file and obtain the recognition result of the license plate to be recognized.
[0136] The identification unit 400 includes:
[0137] The read sub-unit is used to read the blacklisted license plates line by line from the blacklist file.
[0138] The comparison sub-unit is used to compare each blacklisted license plate with the license plate to be identified and obtain the comparison result.
[0139] The determination sub-unit is used to determine the recognition result of the license plate to be identified based on the comparison result.
[0140] The specific function of the determination sub-unit is as follows: when the license plate in the blacklist matches the license plate to be identified, the identification result of the license plate to be identified is that the license plate to be identified is in the blacklist; when the license plate in the blacklist does not match the license plate to be identified, the identification result of the license plate to be identified is that the license plate to be identified is not in the blacklist.
[0141] In summary, by using a Bloom filter to map license plate numbers to multiple hash locations, disk file access is only required when all hash locations match a preset value, effectively reducing disk I / O operations. The design of the Bloom filter ensures that each query requires only a small amount of hash calculation, significantly improving query efficiency and drastically reducing response time, thus meeting real-time requirements.
[0142] Combination Figure 5 The identification device also includes, as shown, the following:
[0143] The reading unit is used to read all license plates from the license plate blacklist file.
[0144] The configuration unit is used to configure the parameters of the Bloom filter.
[0145] The configuration unit is specifically used for: obtaining the number of all license plates; calculating the array length based on the number of all license plates and the array length formula; determining multiple hash functions based on the array length; and constructing the parameters of the Bloom filter based on the array length and the multiple hash functions.
[0146] The initialization unit is used to initialize the values of all array positions in the Bloom filter after the parameters of the Bloom filter have been configured.
[0147] The location calculation unit is used to calculate the position of each license plate in the Bloom filter array by using a hash function after the Bloom filter is initialized.
[0148] The setting unit is used to set the array position of the license plate in the Bloom filter to a preset value.
[0149] Combination Figure 5 The identification device, as shown, further includes a determining unit, used to determine that the identification result of the license plate to be identified is that the license plate to be identified is not in the blacklist when the value of any array position is not a preset value.
[0150] Another embodiment of this application provides an electronic device, such as... Figure 6 As shown, it includes: memory 601 and processor 602.
[0151] The memory 601 is used to store the program.
[0152] The processor 602 is used to execute a program, which, when executed, is specifically used to implement a vehicle license plate recognition method based on a Bloom filter provided in any of the above embodiments.
[0153] The electronic devices mentioned in this article can be servers, PCs, tablets, mobile phones, ECUs (Electronic Control Units), VCUs (Vehicle Control Units), MCUs (Micro Controller Units), HCUs (Hybrid Control Units), etc.
[0154] Another embodiment of this application provides a computer storage medium for storing a computer program, which, when executed, implements a vehicle license plate recognition method based on a Bloom filter as provided in any of the above embodiments.
[0155] Computer storage media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0156] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. In particular, for system or system embodiments, since they are fundamentally similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. Components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0157] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0158] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A vehicle license plate recognition method based on a Bloom filter for in-vehicle equipment, characterized in that, include: Obtain the parameters of the license plate to be identified and the Bloom filter; The parameters include at least a number of hash functions; For each of the hash functions, the license plate to be identified is calculated using the hash function to obtain the array position of the license plate to be identified in the Bloom filter; When all array positions have preset values, retrieve the license plate blacklist file; The blacklist file is used to identify the license plate to be identified, and the identification result of the license plate to be identified is obtained.
2. The method according to claim 1, characterized in that, Before obtaining the parameters of the license plate to be identified and the Bloom filter, the process also includes: Read all license plates from the license plate blacklist file; Configure the parameters for the Bloom filter; Once the parameters of the Bloom filter are configured, initialize the values of all array positions in the Bloom filter; Once the Bloom filter is initialized, for each license plate, the hash function is used to calculate the license plate's array position in the Bloom filter. Set the license plate's array position in the Bloom filter to a preset value.
3. The method according to claim 2, characterized in that, The parameters for configuring the Bloom filter include: Get the total number of all license plates; The array length is calculated based on the number of all license plates and the array length formula. Multiple hash functions are determined based on the array length; The parameters of the Bloom filter are constructed based on the array length and the multiple hash functions.
4. The method according to claim 1, characterized in that, The step of using the hash function to calculate the array position of the license plate to be identified in the Bloom filter includes: Obtain the array length from the parameters of the Bloom filter; The license plate to be identified is converted using the hash function to obtain a hash value; The ratio between the hash value and the array length is calculated to obtain the array position of the license plate to be identified in the Bloom filter.
5. The method according to claim 1, characterized in that, After calculating the array position of the license plate in the Bloom filter using the hash function, the method further includes: When the value of any of the array positions is not a preset value, the recognition result of the license plate to be recognized is determined to be that the license plate to be recognized is not in the blacklist.
6. The method according to claim 1, characterized in that, The step of using the blacklist file to identify the license plate to obtain the identification result includes: Read the blacklisted license plates from the blacklist file line by line; For each of the blacklisted license plates, the blacklisted license plate is compared with the license plate to be identified to obtain the comparison result; The identification result of the license plate to be identified is determined based on the comparison results.
7. The method according to claim 1, characterized in that, The step of determining the recognition result of the license plate to be identified based on the comparison result includes: When the blacklisted license plate matches the license plate to be identified, the identification result of the license plate to be identified is determined to be that the license plate to be identified is in the blacklist; When the license plate in the blacklist does not match the license plate to be identified, the identification result of the license plate to be identified is determined to be that the license plate to be identified is not in the blacklist.
8. A vehicle license plate recognition device based on a Bloom filter, characterized in that, include: The acquisition unit is used to acquire the license plate to be identified and the parameters of the Bloom filter; The parameters include at least a number of hash functions; The calculation unit is used to calculate the license plate to be identified using the hash function for each of the hash functions, so as to obtain the array position of the license plate to be identified in the Bloom filter; The file acquisition unit is used to acquire the license plate blacklist file when all array positions have preset values; The identification unit is used to identify the license plate to be identified using the blacklist file, and obtain the identification result of the license plate to be identified.
9. A computer device, characterized in that, include: A processor and a memory are connected via a bus; wherein the processor is used to call and execute a program stored in the memory; The memory is used to store a program for implementing the vehicle license plate recognition method based on a Bloom filter as described in any one of claims 1-7.
10. A storage medium, characterized in that, The storage medium stores computer-executable instructions for performing the vehicle license plate recognition method based on a Bloom filter as described in any one of claims 1-7.