Ear tag identification method and device, computer device and storage medium
By constructing a historical ear tag database and utilizing hash buckets and Bloom filters, the problem of disordered ear tag numbers in agricultural insurance was solved, achieving efficient and accurate ear tag number recognition, reducing recognition costs, and improving system reliability.
Patent Information
- Application Number
- CN202411515316.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-10-25
AI Technical Summary
In the field of agricultural insurance, the disordered ear tag numbers make it difficult to identify ear-tagged animals such as pigs, cattle, and sheep. Existing biometric identification methods are inefficient and costly, affecting the efficiency of the underwriting process and risk control.
A historical ear tag library is built. Through Spark data cleaning and grouping management, hash buckets are generated and streaming computation is performed using Bloom filters to quickly and accurately identify ear tag numbers.
It improves the efficiency and accuracy of ear tag recognition, reduces the possibility of mismatches, lowers recognition costs, and enhances the security and reliability of the system.
Smart Images

Figure CN119624664B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and is applied in the financial field, particularly to an ear tag identification method, device, computer equipment, and storage medium. Background Technology
[0002] In the financial insurance sector, for agricultural insurance policies involving pigs, cattle, and sheep with ear tags, the common practice for insurance agents is to collect the ear tags from farmers and upload them to the underwriting system. However, due to the disorganized nature of ear tags across different regions, identifying these ear-tagged animals has always been a challenge in agricultural insurance. This has rendered ear tagging a largely ineffective biometric method. For insurance companies, finding a way to effectively identify the insured using these physical identifiers is crucial for cost savings and risk management in the underwriting process.
[0003] Therefore, there is an urgent need for an ear tag identification method that can quickly and accurately identify whether the current ear tag is insured based on the insured ear tag. Summary of the Invention
[0004] This application provides an ear tag identification method, apparatus, computer equipment, and storage medium, aiming to solve the problem of identifying ear-tagged objects such as pigs, cattle, and sheep by ear tags due to the chaotic and disordered nature of ear tags in various locations, which has always been a difficult problem in the field of agricultural insurance.
[0005] Firstly, this application provides an ear tag identification method, including:
[0006] Obtain historical ear tag insurance data that has already been purchased, and construct a historical ear tag database based on the historical ear tag insurance data; wherein, the historical insurance data includes historical ear tag numbers and the historical ear tag features corresponding to the historical ear tag numbers;
[0007] The historical ear tag features are grouped to obtain multiple ear tag groups and the corresponding identification information for each ear tag group;
[0008] Generate a hash bucket corresponding to each ear tag group, wherein the identification information of the hash bucket is the identification information of the ear tag group; add the historical ear tag number corresponding to each historical ear tag feature in the ear tag group to the hash bucket corresponding to the ear tag group; and generate a Bloom filter based on the multiple hash buckets that have been added.
[0009] Obtain the ear tag number to be identified and the ear tag feature corresponding to the ear tag number, and match the ear tag feature with the identification information corresponding to each hash bucket to determine the target hash bucket corresponding to the ear tag number;
[0010] The ear tag number is input into the Bloom filter, which performs streaming computation on the ear tag number and each of the historical ear tags in the target hash bucket to obtain the computation result corresponding to the ear tag number, and completes the identification of the ear tag number based on the computation result.
[0011] In some embodiments, obtaining the ear tag number to be identified and the ear tag feature corresponding to the ear tag number includes: obtaining an insured ear tag number segment to be identified; obtaining multiple insured identifiers in a preset agricultural insurance database; matching each insured identifier with the insured ear tag number segment to generate multiple insured markers in the insured ear tag number segment based on the successfully matched insured identifiers; splitting the insured ear tag number segment according to the insured markers to obtain multiple ear tag numbers; and generating the ear tag feature corresponding to the ear tag number based on the insured marker corresponding to the ear tag number.
[0012] In some embodiments, after the identification of the ear tag number is completed based on the calculation result, the method further includes: parsing the calculation result to obtain the historical ear tag number corresponding to the ear tag number; obtaining a plurality of first associated ear tag numbers corresponding to the historical ear tag number; obtaining a plurality of second associated ear tag numbers corresponding to the ear tag number; matching the first associated ear tag number with the second associated ear tag number; and generating a warning message if the first associated ear tag number fails to match the second associated ear tag number.
[0013] For example, matching the first associated ear tag number with the second associated ear tag number includes: generating the distribution pattern according to the order of the multiple first associated ear tag numbers and their corresponding sequences; matching the multiple second associated ear tag numbers according to the distribution pattern, so as to determine that the first associated ear tag number and the second associated ear tag number fail to match when the second associated ear tag number does not conform to the distribution pattern.
[0014] In some embodiments, grouping multiple historical ear tag features to obtain multiple ear tag groups and identification information corresponding to each ear tag group includes: obtaining multiple insurance dimensions from a preset agricultural insurance database; generating an initial ear tag group corresponding to each insurance dimension; performing feature matching between each insurance dimension and each historical ear tag feature; adding the successfully matched historical ear tag features to the initial ear tag group corresponding to the insurance dimension to obtain multiple ear tag groups; and using the insurance dimension corresponding to the ear tag group as the identification information.
[0015] In some embodiments, generating a Bloom filter based on the added plurality of hash buckets includes: obtaining an initial Bloom filter based on the plurality of hash buckets; initializing the bit array of the initial Bloom filter to set all bits of the Bloom filter to 0; obtaining the hash value of each historical ear tag in each hash bucket; and setting the corresponding bit of each hash value in the bit array to 1 in the initial Bloom filter to obtain the Bloom filter.
[0016] In some embodiments, constructing a historical ear tag library based on the historical ear tag insurance data includes: performing Spark data cleaning on the historical ear tag data; wherein, the Spark data cleaning includes data deduplication, missing value handling, data transformation, outlier detection, and data formatting; and constructing the historical ear tag library based on the cleaned historical ear tag data.
[0017] Secondly, this application provides an ear tag identification device, comprising:
[0018] The data acquisition unit is used to acquire historical ear tag insurance data that has been insured, and to construct a historical ear tag database based on the historical ear tag insurance data; wherein, the historical insurance data includes historical ear tag numbers and historical ear tag features corresponding to the historical ear tag numbers;
[0019] The feature grouping unit is used to group multiple historical ear tag features to obtain multiple ear tag groups and the identification information corresponding to each ear tag group;
[0020] A Bloom generation unit is used to generate a hash bucket corresponding to each ear tag group, wherein the identification information of the hash bucket is the identification information of the ear tag group, and to add the historical ear tag number corresponding to each historical ear tag feature in the ear tag group to the hash bucket corresponding to the ear tag group, and to generate a Bloom filter based on the multiple hash buckets that have been added;
[0021] The target determination unit is used to obtain the ear tag number to be identified and the ear tag feature corresponding to the ear tag number, and to match the ear tag feature with the identification information corresponding to each hash bucket to determine the target hash bucket corresponding to the ear tag number;
[0022] The identification completion unit is used to input the ear tag number into the Bloom filter. The Bloom filter performs streaming calculation on the ear tag number and each of the historical ear tags in the target hash bucket to obtain the calculation result corresponding to the ear tag number, and completes the identification of the ear tag number based on the calculation result.
[0023] Thirdly, this application also provides a computer device, comprising:
[0024] Memory and processor;
[0025] The memory is used to store computer programs;
[0026] The processor is configured to execute the computer program and, when executing the computer program, implement the steps of the ear tag recognition method as described in the first aspect above.
[0027] Fourthly, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to implement the steps of the ear tag recognition method described in the first aspect above.
[0028] This application discloses an ear tag number recognition method, apparatus, computer equipment, and storage medium. It involves acquiring historical ear tag insurance data and constructing a historical ear tag library containing historical ear tag numbers and their corresponding features. The historical ear tag features are grouped to generate multiple ear tag groups, and each ear tag group is assigned corresponding identification information. A hash bucket is generated for each ear tag group, with the hash bucket's identification information matching that of the ear tag group. The ear tag number corresponding to each historical ear tag feature in the ear tag group is added to the corresponding hash bucket. A Bloom filter is generated based on these hash buckets. The ear tag number to be identified and its corresponding ear tag features are obtained. The ear tag features are matched with the identification information of each hash bucket to determine the target hash bucket corresponding to the ear tag number to be identified. The ear tag number to be identified is input into the Bloom filter, and the Bloom filter performs streaming computation on each historical ear tag number in the target hash bucket. The ear tag number to be identified is then identified based on the computation result.
[0029] By leveraging the efficiency of Bloom filters, streaming computing accelerates the ear tag identification process. Simultaneously, grouping ear tag features and generating hash buckets improves feature matching accuracy and reduces the possibility of false matches. Furthermore, existing historical ear tag insurance data is fully utilized to construct a rich historical ear tag database, providing data support for the identification process. Managing ear tag data through grouping and hash buckets makes ear tag management more organized and convenient. This method is applicable to the identification of ear-tagged objects such as pigs, cattle, and sheep, and is particularly suitable for the agricultural insurance field.
[0030] In summary, the proposed ear tag identification method achieves efficient and accurate ear tag identification by constructing a historical ear tag database, grouping and managing historical ear tag features, and utilizing hash buckets and Bloom filters. This provides a reliable technical means for the agricultural insurance field and solves the identification problem caused by the disordered nature of ear tag numbers.
[0031] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0032] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0033] Figure 1 This is a schematic flowchart illustrating the steps of an ear tag identification method provided in an embodiment of this application;
[0034] Figure 2 This is a schematic flowchart illustrating the steps of a Bloom filter generation method provided in an embodiment of this application;
[0035] Figure 3 This is a schematic flowchart illustrating the steps of a method for generating early warning information according to an embodiment of this application;
[0036] Figure 4 This is a schematic diagram of the structure of an ear tag identification device provided in an embodiment of this application;
[0037] Figure 5 This is a schematic block diagram of the structure of a computer device provided in an embodiment of this application.
[0038] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Detailed Implementation
[0039] 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, 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.
[0040] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0041] It should be understood that, in order to clearly describe the technical solutions of the embodiments of the present invention, the terms "first" and "second" are used in the embodiments of the present invention to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" are not necessarily different.
[0042] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0043] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0044] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0045] In the financial insurance sector, for agricultural insurance policies involving pigs, cattle, and sheep with ear tags, the common practice for insurance agents is to collect the ear tags from farmers and upload them to the underwriting system. However, due to the disorganized nature of ear tags across different regions, identifying these ear-tagged animals has always been a challenge in agricultural insurance. This has rendered ear tagging a largely ineffective biometric method. For insurance companies, finding a way to effectively identify the insured using these physical identifiers is crucial for cost savings and risk management in the underwriting process.
[0046] Therefore, there is an urgent need for an ear tag identification method that can quickly and accurately identify whether the current ear tag is insured based on the insured ear tag.
[0047] To resolve the above issues, please refer to [link / reference]. Figure 1 , Figure 1 This is a schematic flowchart of an ear tag identification method provided in one embodiment of this application. The ear tag identification method can be implemented by a computer device, which can be deployed on a single server or a server cluster. It can also be deployed on a handheld terminal, laptop, wearable device, or robot, etc.
[0048] To solve the above problem, please refer to Figure 1 Specifically, such as Figure 1 As shown, the provided ear tag identification method includes steps S101 to S105. Details are as follows:
[0049] Step S101. Obtain historical ear tag insurance data that has been insured, and construct a historical ear tag database based on the historical ear tag insurance data; wherein, the historical insurance data includes historical ear tag numbers and the historical ear tag features corresponding to the historical ear tag numbers.
[0050] Specifically, this involves collecting and building a database containing historical ear tag numbers and their corresponding characteristics—a historical ear tag database. This historical data may include ear tag numbers, associated animal characteristics, insurance details, and other information. Establishing a foundational database provides data support for subsequent identification and matching processes. Analysis of historical data can reveal patterns between ear tag numbers and characteristics, improving identification accuracy.
[0051] In some embodiments, constructing a historical ear tag library based on historical ear tag insurance data includes: performing Spark data cleaning on the historical ear tag data; wherein, Spark data cleaning includes data deduplication, missing value handling, data transformation, outlier detection, and data formatting; and constructing a historical ear tag library based on the cleaned historical ear tag data.
[0052] Spark technology is used to deduplicate historical ear tag data, removing duplicate ear tag records to ensure that each ear tag number is unique in the historical dataset. The specific steps using Spark are as follows:
[0053] Missing value handling: Identifying and handling missing values in data can be done by filling in default values, estimating missing values, or deleting missing data records to ensure data integrity.
[0054] Data conversion: Converting historical ear tag data into a unified format and standard ensures consistency in subsequent processing and analysis. For example, standardizing date formats or converting values in different units to a unified unit.
[0055] Outlier detection: Identifying outliers in the data, such as data errors or values outside the reasonable range, and performing necessary corrections or deletions to maintain the credibility and accuracy of the data.
[0056] Data formatting: The cleaned data is formatted into a predefined structure for easier storage and retrieval. For example, ear tags and corresponding insurance information are formatted into standardized formats such as JSON or CSV.
[0057] Based on the cleaned historical ear tag data, a structured historical ear tag database is constructed. This database can be stored using relational databases (such as MySQL), non-relational databases (such as MongoDB), or distributed storage systems (such as Hadoop HDFS). The cleaned data is systematically stored in the historical ear tag database, ensuring orderly storage and fast retrieval.
[0058] In summary, by deduplicating data, handling missing values, and detecting outliers, the accuracy and reliability of the data are effectively improved, ensuring the high quality of the data in the historical ear tag database. Data transformation and formatting steps ensure that all data conforms to a unified standard and format, guaranteeing data consistency and standardization, facilitating subsequent processing and analysis. Using Spark for data cleaning fully leverages its distributed computing capabilities, improving the processing efficiency and speed of large-scale historical ear tag data, making it suitable for handling massive datasets. Building a historical ear tag database systematically stores the cleaned, high-quality data, facilitating rapid querying and analysis, and supporting subsequent business needs. Establishing a historical ear tag database provides a reliable data foundation for subsequent ear tag number matching, Bloom filter generation, and other related operations, ensuring the stable operation of the entire system.
[0059] The above embodiments describe in detail the process of cleaning historical ear tag data and building a historical ear tag database. Efficient data cleaning is performed using Spark technology to ensure high data quality and consistency. Simultaneously, the cleaned data is systematically stored in the historical ear tag database, providing a solid data foundation for subsequent operations.
[0060] Step S102. Group the multiple historical ear tag features to obtain multiple ear tag groups and the corresponding identification information for each ear tag group.
[0061] Specifically, ear tag numbers are grouped based on historical ear tag characteristics (such as shape, color, and location) to generate multiple ear tag groups. Each ear tag group is bound to unique identification information. This initial classification and grouping of data facilitates faster and more accurate matching of ear tag characteristics in subsequent steps. This reduces complexity by simplifying the complex dataset into several easily processed subsets.
[0062] Step S103. Generate a hash bucket corresponding to each ear tag group. The identifier information of the hash bucket is the identifier information of the ear tag group. Add the historical ear tag number corresponding to each historical ear tag feature in the ear tag group to the hash bucket corresponding to the ear tag group. Generate a Bloom filter based on the multiple hash buckets that have been added.
[0063] Specifically, a corresponding hash bucket is created for each ear tag group, with the hash bucket's identification information matching that of the ear tag group. The ear tag number corresponding to each historical ear tag feature is added to the corresponding hash bucket. A Bloom filter is built based on the hash buckets for fast data querying and filtering. Leveraging the efficient lookup and matching capabilities of hash and Bloom filters improves the speed and accuracy of subsequent matching and identification, while reducing memory usage and query time, thus adapting to the needs of large-scale data processing.
[0064] In some embodiments, multiple historical ear tag features are grouped to obtain multiple ear tag groups and identification information corresponding to each ear tag group, including: obtaining multiple insurance dimensions from a preset agricultural insurance database; generating an initial ear tag group corresponding to each insurance dimension; performing feature matching between each insurance dimension and each historical ear tag feature; adding the successfully matched historical ear tag features to the initial ear tag group corresponding to the insurance dimension to obtain multiple ear tag groups; and using the insurance dimension corresponding to the ear tag group as identification information.
[0065] First, multiple insurance dimensions are extracted from a pre-defined agricultural insurance database. These dimensions can be different standards or attributes used to classify and organize ear tag data, such as region, animal breed, and insurance date. Utilizing these dimensions provides a structured and ordered classification standard, making ear tag feature grouping more systematic and organized. This improves the flexibility and accuracy of subsequent matching and processing.
[0066] Then, based on the obtained insurance dimensions, initial ear tag groups are generated for each insurance dimension. These initial ear tag groups are empty and await subsequent grouping. For example, if the insurance dimension is species, corresponding "pig ear tag group," "cow ear tag group," etc., are generated (it can also combine region and species, or only include species; it can be set arbitrarily according to needs). This establishes a basic data framework, providing structural support for subsequent classification and addition of ear tag numbers based on features. It improves the system's scalability and adaptability, contributing to data management and query efficiency.
[0067] Next, feature matching is performed between each insurance dimension and each historical ear tag feature. Based on the matching results, the successfully matched historical ear tag features are added to the initial ear tag group corresponding to the respective insurance dimension.
[0068] Accurately classifying ear tag features into the corresponding ear tag groups for each insurance dimension ensures the precision and rationality of data distribution. Grouped data is easier to manage and query, reduces data clutter, and improves the accuracy of subsequent data processing.
[0069] Finally, the insurance coverage dimension of each ear tag group is used as its identification information for subsequent hash bucket generation and data matching. Clear and concise identification information provides a clear reference for the subsequent generation of hash buckets and the construction of Bloom filters, facilitating rapid lookup and identification. This provides a basis for efficient access to hash buckets, making data grouping and subsequent matching processes more efficient.
[0070] In summary, grouping historical ear tag features using insurance coverage dimensions makes the grouping more scientific and reasonable, improving accuracy and efficiency. Providing a more systematic and structured data management approach makes ear tag data processing more orderly, laying a solid foundation for subsequent operations. Grouped ear tag feature matching is more efficient, and with the use of identification information, specific data can be quickly located and retrieved, improving query and matching efficiency. Using insurance coverage dimensions for grouping and identification makes the system more flexible and convenient in expanding and adapting to new data and features, exhibiting stronger scalability. Effective management and matching of ear tag features prevents data corruption and tampering, improving system security and reliability. Grouping through specific insurance coverage dimensions and feature matching systematically categorizes and identifies ear tag features, making the entire ear tag identification system more efficient and reliable.
[0071] In some embodiments, such as Figure 2 The process of generating a Bloom filter based on the added hash buckets is shown, including steps S103a to S103c.
[0072] Step S103a. Obtain the initial Bloom filter based on multiple hash buckets; initialize the bit array of the initial Bloom filter to set all bits of the Bloom filter to 0.
[0073] The initial Bloom filter is obtained from multiple hash buckets. This involves creating an initial Bloom filter object and allocating the necessary space for its bit array. The bit array of the initial Bloom filter is initialized by setting all bits to 0.
[0074] In summary, initializing the Bloom filter ensures that all bits are in their initial state. This prevents any raw or random data from affecting the filter's accuracy. Setting all bits to 0 provides a clean starting point, ensuring that the Bloom filter correctly reflects the distribution of hash values in subsequent steps.
[0075] Step S103b. Obtain the hash value of each historical ear tag in each hash bucket.
[0076] Each historical ear tag is retrieved by traversing each hash bucket. A hash function is then used to calculate the hash value for each historical ear tag. Depending on specific needs, multiple hash functions may be used to increase the accuracy of the filter. The hash value of each historical ear tag provides key input data to the Bloom filter. These hash values are used to update the bit array of the Bloom filter. Utilizing multiple hash functions (if used) can reduce the false positive rate of the Bloom filter and improve matching accuracy.
[0077] Step S103c. In the initial Bloom filter, set the corresponding bit in the bit array for each hash value to 1 to obtain the Bloom filter.
[0078] In the initial Bloom filter, the corresponding bit in the bit array is set to 1 based on the acquired hash value. Each hash value corresponds to one or more bits in the Bloom filter, and the hash value is used to change the state of a specific bit in the bit array. By progressively updating the Bloom filter, it reflects the hash value information of all historical ear tag numbers. Through the setting of these bits, the existence of multiple ear tag numbers can be effectively represented. The Bloom filter is built in a relatively efficient manner, occupies less storage space, and can quickly determine whether a certain ear tag number may exist in a known hash bucket.
[0079] In summary, the overall beneficial effects of the provided generative Bloom filter include:
[0080] 1. Efficient data query: Bloom filters quickly determine the existence of an element by using hash functions and bit arrays, greatly improving query efficiency.
[0081] 2. Saves storage space: Using a bit array instead of storing all historical ear tags reduces memory usage.
[0082] 3. Reduced computational complexity: Initializing and updating Bloom filters has low computational complexity, making it suitable for large-scale data processing.
[0083] 4. Improve system security: Bloom filters can reduce system query requests for non-existent ear tags, reduce erroneous operations, and improve overall system security.
[0084] 5. Reduce false positive rate: The use of multiple hash functions can reduce the false positive results of Bloom filters to a certain extent and improve the reliability of the filtering effect.
[0085] Through steps S103a to S103c, the Bloom filter can effectively work with the ear tag identification system to provide efficient query and matching support, and ensure the high performance and reliability of the method.
[0086] Step S104. Obtain the ear tag number to be identified and the ear tag feature corresponding to the ear tag number. Match the ear tag feature with the identifier information corresponding to each hash bucket to determine the target hash bucket corresponding to the ear tag number.
[0087] Specifically, the method involves acquiring the ear tag number to be identified and its corresponding ear tag features. By matching the ear tag features with the identifier information of each hash bucket, the target hash bucket to which the ear tag number belongs is determined. This provides a fast method for filtering and locating ear tag features, narrowing the matching range and improving matching efficiency. It ensures that subsequent steps perform streaming computation and matching within a more precise range.
[0088] Step S105. Input the ear tag number into the Bloom filter. The Bloom filter performs streaming computation on the ear tag number and each historical ear tag number in the target hash bucket to obtain the computation result corresponding to the ear tag number. The ear tag number is identified based on the computation result.
[0089] Specifically, the ear tag number to be identified is input into a Bloom filter. The Bloom filter performs streaming computation on the ear tag number and compares it with each historical ear tag number in the target hash bucket. The identification result is confirmed based on the computation result. Utilizing streaming computation (such as flip computation) ensures efficient processing of large-scale matching tasks, enabling fast and accurate ear tag identification. The Bloom filter itself has efficient query characteristics, further improving identification speed and accuracy while reducing false identifications.
[0090] In summary, the proposed method, from historical data acquisition, feature grouping, hash allocation to final streaming computation and recognition, combines these elements to form an efficient and accurate ear tag identification method. This method can effectively solve the problem of disordered ear tag numbers in the agricultural insurance field, providing a stable and reliable identification mechanism.
[0091] In some embodiments, obtaining the ear tag number to be identified and the ear tag feature corresponding to the ear tag number includes: obtaining the insured ear tag number segment to be identified; obtaining multiple insured identifiers in a preset agricultural insurance database; matching each insured identifier with the insured ear tag number segment to generate multiple insured markers in the insured ear tag number segment based on the successfully matched insured identifiers; splitting the insured ear tag number segment according to the insured markers to obtain multiple ear tag numbers; and generating the ear tag feature corresponding to the ear tag number based on the insured marker corresponding to the ear tag number.
[0092] In some embodiments, such as Figure 3 As shown, after the ear tag identification is completed based on the calculation results, steps S106 to S108 are also included.
[0093] Step S106. Analyze the calculation results and obtain the historical ear tag number corresponding to the ear tag number; obtain multiple first associated ear tag numbers corresponding to the historical ear tag number.
[0094] By analyzing the recognition calculation results, historical ear tag numbers corresponding to the ear tag number to be identified are obtained. Multiple first-related ear tag numbers corresponding to this historical ear tag number are retrieved from the historical ear tag database. These related ear tag numbers may originate from other animals in the same batch of insurance, or may be related ear tag numbers determined based on certain specific association rules. By obtaining a set of related ear tag numbers, further batch verification can be performed based on the recognition. This provides necessary data support for subsequent difference comparison and anomaly detection, ensuring the consistency and integrity of the batch data.
[0095] Step S107. Obtain multiple second associated ear tags corresponding to the ear tag number, and match the first associated ear tag number with the second associated ear tag number.
[0096] Multiple second associated ear tags corresponding to the ear tag number to be identified are obtained from real-time acquired or pre-stored data. These ear tags are similar to the first associated ear tag number and may originate from field records or dynamic data collection. The first associated ear tag number is matched with the second associated ear tag number, and their consistency and validity are compared. By matching the two sets of associated ear tag numbers, the legality and consistency of the ear tag number to be identified are further verified, preventing the transfer or tampering of some or individual ear tags. This provides a redundant verification mechanism, increasing the reliability of the identification process and its fraud prevention capabilities.
[0097] Step S108. If the first associated ear tag number fails to match the second associated ear tag number, generate an early warning message.
[0098] The system determines the matching result between the first and second associated ear tag numbers. If the match fails, an early warning message is generated, indicating potential anomalies or risks. This early warning mechanism helps detect and address anomalies early, preventing fraud and enabling timely measures to protect the interests of insurance companies and the legitimate rights of farmers. It provides an automated monitoring and early warning system, reducing labor costs and improving management efficiency.
[0099] Steps S106 to S108 add a layer of security and verification mechanism to ear tag identification by matching and comparing associated ear tag numbers. This mechanism helps prevent farmers from transferring individual or partial ear tag numbers to others, thereby ensuring the integrity and consistency of data for each batch of insured animals. In the field of agricultural insurance, this batch verification method effectively reduces risk and improves the reliability and trustworthiness of the system.
[0100] For example, matching the first associated ear tag number with the second associated ear tag number includes: generating a distribution pattern based on multiple first associated ear tag numbers and the order of the corresponding first associated ear tag numbers; matching multiple second associated ear tag numbers according to the distribution pattern, so as to determine that the first associated ear tag number and the second associated ear tag number fail to match when the second associated ear tag number does not conform to the distribution pattern.
[0101] First, multiple first-association eartags acquired from historical data are analyzed to study and determine their obvious distribution patterns. These patterns can be based on the eartag order, numbering rules, adjacency relationships, etc. For example, if the eartags are numbered according to a specific pattern, such as consecutive numbering, specific intervals, or other specific arrangement rules, this pattern will be extracted and recorded. By studying and capturing the distribution patterns of the first-association eartags, a unique feature model specific to this batch of eartags is constructed, providing a clear reference standard for subsequent matching. This enhances the recognition system's understanding of eartag relationships and overall structure, improving the accuracy of matching and verification.
[0102] Then, the ear tag number to be identified and its associated second-related ear tag number are obtained. Based on the distribution pattern extracted in the first step, these ear tag numbers to be identified are matched and verified. The second-related ear tag numbers are analyzed and arranged in the same order or rule to check whether they conform to the previously determined distribution pattern.
[0103] By utilizing known distribution patterns for matching, the system ensures that newly acquired ear tag numbers are arranged and distributed in the expected manner. If they do not conform to the pattern, anomalies can be quickly identified. Through rigorous pattern matching, the consistency and authenticity of the data are reinforced, reducing identification errors caused by rule avoidance.
[0104] Finally, evaluate whether the distribution pattern of the second associated ear tag number matches that of the first associated ear tag number. If any deviation or anomaly is found, immediately determine that the match has failed. Based on this matching result, perform corresponding operations, such as generating an early warning message.
[0105] Through a systematic matching mechanism, the legitimacy and consistency of ear tag numbers are quickly and accurately determined. When a match fails, a timely warning is generated, providing an early error detection and correction mechanism to prevent potential errors from flowing into subsequent processes.
[0106] Furthermore, by capturing and applying the distribution patterns of ear tags, the system ensures that the matching process strictly adheres to the expected arrangement and distribution patterns, thereby improving data consistency and integrity. By mapping the second associated ear tag to a known distribution pattern, anomalies can be quickly detected and matching failures identified, thus improving the system's efficiency in finding and handling potential problems. This further prevents the transfer or tampering of individual or partial ear tags, ensuring the integrity of ear tags for each batch of insured animals and the reliability of their correspondence. When a match fails, an early warning message is automatically generated, promptly notifying relevant personnel to take appropriate measures, thereby improving management efficiency and reducing human intervention. In conjunction with the above embodiments, the provided ear tag identification method introduces a more detailed and rigorous mechanism in the matching and verification process, enhancing the reliability and security of the overall identification system.
[0107] Please see Figure 4 As shown, Figure 4 This is a schematic diagram of the structure of the ear tag recognition device 200 provided in the embodiments of this application. The ear tag recognition device 200 is used to perform the steps of the ear tag recognition method shown in the above embodiments. The ear tag recognition device 200 can be a single server or a server cluster, or the ear tag recognition device 200 can be a terminal, such as a handheld terminal, a laptop computer, a wearable device, or a robot.
[0108] like Figure 4 As shown, the ear tag identification device 200 includes:
[0109] The data acquisition unit 201 is used to acquire historical ear tag insurance data that has been insured, and to construct a historical ear tag database based on the historical ear tag insurance data; wherein, the historical insurance data includes historical ear tag numbers and historical ear tag features corresponding to the historical ear tag numbers;
[0110] The feature grouping unit 202 is used to group multiple historical ear tag features to obtain multiple ear tag groups and the identification information corresponding to each ear tag group;
[0111] Bloom generation unit 203 is used to generate a hash bucket corresponding to each ear tag group, wherein the identification information of the hash bucket is the identification information of the ear tag group, and to add the historical ear tag number corresponding to each historical ear tag feature in the ear tag group to the hash bucket corresponding to the ear tag group, and to generate a Bloom filter based on the multiple hash buckets that have been added;
[0112] The target determination unit 204 is used to obtain the ear tag number to be identified and the ear tag feature corresponding to the ear tag number, and to determine the target hash bucket corresponding to the ear tag number by matching the ear tag feature with the identification information corresponding to each hash bucket.
[0113] The identification completion unit 205 is used to input the ear tag number into the Bloom filter. The Bloom filter performs streaming calculation on the ear tag number and each of the historical ear tags in the target hash bucket to obtain the calculation result corresponding to the ear tag number, and completes the identification of the ear tag number based on the calculation result.
[0114] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the ear tag identification device and each module described above can be referred to the corresponding process in the ear tag identification method embodiments described above, and will not be repeated here.
[0115] The aforementioned ear tag identification method can be implemented as a computer program, which can, for example, Figure 4 It runs on the device shown.
[0116] Please see Figure 5 , Figure 5 This is a schematic block diagram of the structure of a computer device provided in an embodiment of this application. The computer device includes a processor, a memory, and a network interface connected via a device bus, wherein the memory may include a storage medium and internal memory.
[0117] The storage medium may store operating devices and computer programs. The computer program includes program instructions that, when executed, cause the processor to perform any ear tag recognition method.
[0118] The processor provides computing and control capabilities, supporting the operation of the entire computer device.
[0119] Internal memory provides an environment for the execution of computer programs stored in non-volatile storage media. When executed by a processor, the computer program can enable the processor to perform any ear tag recognition method.
[0120] This network interface is used for network communication, such as sending assigned tasks. Those skilled in the art will understand that... Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the terminal to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0121] It should be understood that the processor can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, a general-purpose processor can be a microprocessor or any conventional processor.
[0122] In one embodiment, the processor is configured to run a computer program stored in memory to perform the following steps:
[0123] Obtain historical ear tag insurance data that has already been purchased, and construct a historical ear tag database based on the historical ear tag insurance data; wherein, the historical insurance data includes historical ear tag numbers and the historical ear tag features corresponding to the historical ear tag numbers;
[0124] The historical ear tag features are grouped to obtain multiple ear tag groups and the corresponding identification information for each ear tag group;
[0125] Generate a hash bucket corresponding to each ear tag group, wherein the identification information of the hash bucket is the identification information of the ear tag group; add the historical ear tag number corresponding to each historical ear tag feature in the ear tag group to the hash bucket corresponding to the ear tag group; and generate a Bloom filter based on the multiple hash buckets that have been added.
[0126] Obtain the ear tag number to be identified and the ear tag feature corresponding to the ear tag number, and match the ear tag feature with the identification information corresponding to each hash bucket to determine the target hash bucket corresponding to the ear tag number;
[0127] The ear tag number is input into the Bloom filter, which performs streaming computation on the ear tag number and each of the historical ear tags in the target hash bucket to obtain the computation result corresponding to the ear tag number, and completes the identification of the ear tag number based on the computation result.
[0128] In some embodiments, obtaining the ear tag number to be identified and the ear tag feature corresponding to the ear tag number includes: obtaining an insured ear tag number segment to be identified; obtaining multiple insured identifiers in a preset agricultural insurance database; matching each insured identifier with the insured ear tag number segment to generate multiple insured markers in the insured ear tag number segment based on the successfully matched insured identifiers; splitting the insured ear tag number segment according to the insured markers to obtain multiple ear tag numbers; and generating the ear tag feature corresponding to the ear tag number based on the insured marker corresponding to the ear tag number.
[0129] In some embodiments, after the identification of the ear tag number is completed based on the calculation result, the method further includes: parsing the calculation result to obtain the historical ear tag number corresponding to the ear tag number; obtaining a plurality of first associated ear tag numbers corresponding to the historical ear tag number; obtaining a plurality of second associated ear tag numbers corresponding to the ear tag number; matching the first associated ear tag number with the second associated ear tag number; and generating a warning message if the first associated ear tag number fails to match the second associated ear tag number.
[0130] For example, matching the first associated ear tag number with the second associated ear tag number includes: generating the distribution pattern according to the order of the multiple first associated ear tag numbers and their corresponding sequences; matching the multiple second associated ear tag numbers according to the distribution pattern, so as to determine that the first associated ear tag number and the second associated ear tag number fail to match when the second associated ear tag number does not conform to the distribution pattern.
[0131] In some embodiments, grouping multiple historical ear tag features to obtain multiple ear tag groups and identification information corresponding to each ear tag group includes: obtaining multiple insurance dimensions from a preset agricultural insurance database; generating an initial ear tag group corresponding to each insurance dimension; performing feature matching between each insurance dimension and each historical ear tag feature; adding the successfully matched historical ear tag features to the initial ear tag group corresponding to the insurance dimension to obtain multiple ear tag groups; and using the insurance dimension corresponding to the ear tag group as the identification information.
[0132] In some embodiments, generating a Bloom filter based on the added plurality of hash buckets includes: obtaining an initial Bloom filter based on the plurality of hash buckets; initializing the bit array of the initial Bloom filter to set all bits of the Bloom filter to 0; obtaining the hash value of each historical ear tag in each hash bucket; and setting the corresponding bit of each hash value in the bit array to 1 in the initial Bloom filter to obtain the Bloom filter.
[0133] In some embodiments, constructing a historical ear tag library based on the historical ear tag insurance data includes: performing Spark data cleaning on the historical ear tag data; wherein, the Spark data cleaning includes data deduplication, missing value handling, data transformation, outlier detection, and data formatting; and constructing the historical ear tag library based on the cleaned historical ear tag data.
[0134] The embodiments of this application also provide a computer-readable storage medium storing a computer program, the computer program including program instructions, and the processor executing the program instructions to implement the steps of the ear tag recognition method provided in the above embodiments of this application.
[0135] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiments, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, SmartMedia Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the computer device.
[0136] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for identifying ear tags, characterized in that, include: Obtain historical ear tag insurance data that has already been purchased, and construct a historical ear tag database based on the historical ear tag insurance data; wherein, the historical ear tag insurance data includes historical ear tag numbers and the historical ear tag features corresponding to the historical ear tag numbers; The historical ear tag features are grouped to obtain multiple ear tag groups and the corresponding identification information for each ear tag group; Generate a hash bucket corresponding to each ear tag group, wherein the identification information of the hash bucket is the identification information of the ear tag group; add the historical ear tag number corresponding to each historical ear tag feature in the ear tag group to the hash bucket corresponding to the ear tag group; and generate a Bloom filter based on the multiple hash buckets that have been added. Obtain the ear tag number to be identified and the ear tag feature corresponding to the ear tag number, and match the ear tag feature with the identification information corresponding to each hash bucket to determine the target hash bucket corresponding to the ear tag number; The ear tag number is input into the Bloom filter. The Bloom filter performs streaming computation on the ear tag number and each historical ear tag number in the target hash bucket to obtain the computation result corresponding to the ear tag number. The ear tag number is identified based on the computation result. After identifying the ear tag number based on the computation result, the method further includes: parsing the computation result to obtain the historical ear tag number corresponding to the ear tag number; obtaining multiple first associated ear tag numbers corresponding to the historical ear tag number; obtaining multiple second associated ear tag numbers corresponding to the ear tag number; and performing a hash function on the first associated ear tag number and the second associated ear tag number. The matching process includes generating a distribution pattern based on multiple first associated ear tag numbers and their corresponding order; matching multiple second associated ear tag numbers according to the distribution pattern, so as to determine that the first associated ear tag number and the second associated ear tag number fail to match when the second associated ear tag number does not conform to the distribution pattern; the first associated ear tag number comes from other animals insured in the same batch, or is an associated ear tag number determined based on certain specific association rules; the second associated ear tag number comes from field records or dynamic data collection; if the first associated ear tag number and the second associated ear tag number fail to match, an early warning message is generated.
2. The method according to claim 1, characterized in that, The step of obtaining the ear tag number to be identified and the ear tag feature corresponding to the ear tag number includes: Obtain the insured ear tag number range to be identified; Retrieve multiple underwriting identifiers from a pre-defined agricultural insurance database; Each of the underwriting identifiers is matched with the underwriting ear tag number segment to generate multiple underwriting tags in the underwriting ear tag number segment based on the successfully matched underwriting identifiers; The insured ear tag number segment is split according to the insured mark to obtain multiple ear tag numbers; The ear tag feature corresponding to the ear tag number is generated based on the underwriting mark corresponding to the ear tag number.
3. The method according to claim 1, characterized in that, The step of grouping multiple historical ear tag features to obtain multiple ear tag groups and the corresponding identifier information for each ear tag group includes: Retrieve multiple insurance dimensions from a pre-set agricultural insurance database; Generate an initial ear tag group corresponding to each of the aforementioned insurance dimensions; Feature matching is performed between each of the aforementioned insurance dimensions and each of the aforementioned historical ear tag features; The successfully matched historical ear tag features are added to the initial ear tag group corresponding to the insurance dimension, and multiple ear tag groups are obtained; the insurance dimension corresponding to the ear tag group is used as the identification information.
4. The method according to claim 1, characterized in that, The step of generating a Bloom filter based on the added hash buckets includes: The initial Bloom filter is obtained from the multiple hash buckets; Initialize the bit array of the initial Bloom filter to set all bits of the Bloom filter to 0; Obtain the hash value of each of the historical ear tags in each of the hash buckets; In the initial Bloom filter, the corresponding bit of each hash value in the bit array is set to 1 to obtain the Bloom filter.
5. The method according to claim 1, characterized in that, The step of constructing a historical ear tag database based on the historical ear tag insurance data includes: The historical ear tag insurance data is cleaned using Spark data cleaning; wherein, Spark data cleaning includes data deduplication, missing value handling, data transformation, outlier detection, and data formatting; The historical ear tag database is constructed based on the cleaned historical ear tag insurance data.
6. An ear tag identification device, characterized in that, include: The data acquisition unit is used to acquire historical ear tag insurance data that has been insured, and to construct a historical ear tag database based on the historical ear tag insurance data; wherein, the historical ear tag insurance data includes historical ear tag numbers and historical ear tag features corresponding to the historical ear tag numbers; The feature grouping unit is used to group multiple historical ear tag features to obtain multiple ear tag groups and the identification information corresponding to each ear tag group; A Bloom generation unit is used to generate a hash bucket corresponding to each ear tag group, wherein the identification information of the hash bucket is the identification information of the ear tag group, and to add the historical ear tag number corresponding to each historical ear tag feature in the ear tag group to the hash bucket corresponding to the ear tag group, and to generate a Bloom filter based on the multiple hash buckets that have been added; The target determination unit is used to obtain the ear tag number to be identified and the ear tag feature corresponding to the ear tag number, and to match the ear tag feature with the identification information corresponding to each hash bucket to determine the target hash bucket corresponding to the ear tag number; The identification completion unit is used to input the ear tag number into the Bloom filter. The Bloom filter performs streaming computation on the ear tag number and each historical ear tag number in the target hash bucket to obtain the calculation result corresponding to the ear tag number. Based on the calculation result, the identification of the ear tag number is completed. After the identification of the ear tag number is completed based on the calculation result, the unit further includes: parsing the calculation result to obtain the historical ear tag number corresponding to the ear tag number; obtaining multiple first associated ear tag numbers corresponding to the historical ear tag number; obtaining multiple second associated ear tag numbers corresponding to the ear tag number; and matching the first associated ear tag number with the second associated ear tag number. The tag matching process includes generating a distribution pattern based on multiple first associated ear tag numbers and their corresponding order; matching multiple second associated ear tag numbers according to the distribution pattern, so as to determine that the first associated ear tag number and the second associated ear tag number fail to match when the second associated ear tag number does not conform to the distribution pattern; the first associated ear tag number comes from other animals insured in the same batch, or is an associated ear tag number determined based on certain specific association rules; the second associated ear tag number comes from field records or dynamic data collection; if the first associated ear tag number and the second associated ear tag number fail to match, an early warning message is generated.
7. A computer device, characterized in that, The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is configured to execute the computer program and, in executing the computer program, implement the method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to implement the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Hash connection method, computing node, storage medium and program product
CN115062027A
Data acquisition method, device and equipment and computer readable storage medium
CN118132554A