An agricultural product one-to-one code anti-counterfeiting analysis method and system
By using a dynamic salt value mechanism and multi-dimensional verification of hash value comparison, the problem of easy copying and counterfeiting of one-item-one-code labels for agricultural products has been solved, thus realizing the authenticity and anti-counterfeiting reliability of agricultural product traceability information.
Patent Information
- Application Number
- CN202611292702.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-25
- Publication Date
- 2026-11-20
AI Technical Summary
The existing one-item-one-code labels for agricultural products are easily copied and counterfeited, and the lack of dynamic monitoring of the scanning process results in insufficient reliability of anti-counterfeiting measures and an inability to effectively guarantee the authenticity of traceability information.
A dynamic salt value mechanism is used to calculate the hash value. Combined with geographical location, scanning time and mobile device identification, multi-dimensional verification is performed to generate a QR code and compare the hash value. The scanning behavior is dynamically monitored to ensure the authenticity of the traceability information.
It achieves precise anti-counterfeiting with one code for each agricultural product, improves the reliability of anti-counterfeiting, ensures the authenticity of traceability information, and prevents QR codes from being tampered with or scanned abnormally.
Smart Images

Figure CN123140977A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of agricultural product anti-counterfeiting and traceability technology, and in particular to an anti-counterfeiting analysis method and system for agricultural products with one code per item. Background Technology
[0002] With the continuous development of the agricultural product market, consumers' demand for the quality, safety, and traceability of agricultural products is increasing. One item, one code technology has been widely used in the field of agricultural product anti-counterfeiting because it can realize personalized identification and traceability of agricultural products.
[0003] However, current technologies still have significant shortcomings: First, traditional anti-counterfeiting labels and existing one-item-one-code labels are easily copied and counterfeited, making it difficult to achieve precise anti-counterfeiting with "one item, one certificate," and failing to effectively guarantee the authenticity of traceability information; second, existing technologies lack dynamic monitoring of the scanning process, making it impossible to verify and identify cases of QR code tampering or abnormal scanning through scan data verification, resulting in insufficient anti-counterfeiting reliability. Therefore, there is an urgent need for a one-item-one-code anti-counterfeiting analysis method and system for agricultural products that can achieve precise anti-counterfeiting and dynamic monitoring. Summary of the Invention
[0004] To help overcome the shortcomings of existing technologies, such as the ease with which agricultural product unique code labels can be copied and counterfeited, and the lack of dynamic scanning monitoring leading to insufficient anti-counterfeiting reliability, this application provides an anti-counterfeiting analysis method and system for agricultural product unique codes.
[0005] Firstly, this application provides a method for anti-counterfeiting analysis of agricultural products with a unique code, which adopts the following technical solution: A method for anti-counterfeiting analysis of agricultural products with unique codes for each item includes: Obtain the unique traceability code corresponding to each agricultural product in the traceability batch, obtain the dynamic salt value bound to the traceability code, and calculate the first hash value by combining the traceability code and the dynamic salt value; The traceability code is generated into a QR code and associated with the traceability information of the agricultural product; When a mobile device scans the QR code, the geographical location, scanning time, and mobile device identifier of the scanning time are extracted, and the geographical location, scanning time, and mobile device identifier are combined into the second anti-counterfeiting data. Obtain the dynamic salt value, and calculate the second hash value by combining the second anti-counterfeiting data with the dynamic salt value; Determine whether the second hash value is consistent with the first hash value; If the second hash value matches the first hash value, the scan record is stored in the database, and the tracing information is returned to the mobile device. If the second hash value is inconsistent with the first hash value, the geographical location in the second anti-counterfeiting data is compared with the preset authorized area associated with the traceability code to obtain the location comparison result. At the same time, the scanning time is compared with the valid time window associated with the traceability code to obtain the time comparison result. At the same time, the mobile device identifier is compared with the list of authorized devices associated with the traceability code to obtain the device comparison result. Based on the combined status of the location comparison result, the time comparison result, and the device comparison result, determine whether to return the traceability information to the mobile terminal.
[0006] Optionally, after the step of finding that the second hash value matches the first hash value, the method further includes: Obtain the cumulative number of scans of the traceability code before this scan, and determine whether the cumulative number of scans is zero; If the cumulative number of scans is zero, the geographical location at the time of the current scan is stored as the initial anchor point of the traceability code; If the cumulative number of scans is not zero, then calculate the offset distance between the geographical location at the time of the current scan and the initial anchor point location; Determine whether the offset distance exceeds a preset reasonable offset distance; If the offset distance does not exceed the preset reasonable offset distance, the scan record is stored normally. If the offset distance exceeds the preset reasonable offset distance, then obtain all historical offset records of the traceability code within the preset historical time period; Based on all the historical offset records, determine whether the geographical location change of the traceability code presents a continuous linear trajectory; If a continuous linear trajectory is observed, the current offset is marked as a normal migration, and the initial anchor point position is updated to the current position. If a continuous linear trajectory is not presented, the traceability code will be marked as a geographical anomaly, and the return of traceability information will be suspended until the management terminal manually cancels it.
[0007] Optionally, after marking the traceability code as a geographic anomaly, the method further includes: Obtain the traceability batch identifier associated with the traceability code, and determine whether there are other associated traceability codes in the traceability batch that are also marked as geographical anomalies. If there are no other related source codes that are also marked as geographically anomalous, then only the current source code will be kept in a geographically anomalous state. If there are other related source codes that are also marked as geographic anomalies, then it is further determined whether the abnormal geographical locations of all the related source codes of geographic anomalies constitute a spatial clustered distribution. If a spatial cluster distribution is formed, it is determined that the traceability batch has a concentrated geographical anomaly, and batch locking is performed on all traceability codes in the traceability batch. If it does not constitute a spatial clustered distribution, it is judged as an individual geographical anomaly, and the geographical anomaly status is maintained only for the current tracing code.
[0008] Optionally, after storing the scan records in the database and returning the traceability information to the mobile device, the method further includes: Extract all scan records of the same geographic location within a preset statistical period from the database, and count the number of different mobile device identifiers corresponding to the geographic location based on all scan records; Determine whether the number of different mobile device identifiers exceeds a preset popularity threshold; If the preset heat threshold is not exceeded, continue monitoring subsequent scan records; If the preset popularity threshold is exceeded, the geographical location will be marked as a consumer hotspot area; The agricultural product variety with the most scans within the aforementioned consumer hotspot area is identified, and this agricultural product variety is associated with the aforementioned consumer hotspot area. Determine whether the agricultural product variety is consistent with the historical preferred varieties in the aforementioned consumption hotspot areas; If there is a discrepancy, a variety preference migration report is generated and pushed to the manufacturer's management backend.
[0009] Optionally, after generating the variety preference migration report and pushing the variety preference migration report to the manufacturer management backend, the method further includes: Receive the response instruction returned by the manufacturer's management backend, and determine the type of the response instruction; If the type of the response instruction is an inventory adjustment instruction, then the target variety and the target adjustment quantity are extracted from the response instruction, wherein the target variety is the currently preferred variety or the historically preferred variety; Based on the target variety, query the traceability batch information corresponding to the target variety, and extract the current remaining inventory from the traceability batch information; Determine whether the target adjustment quantity is less than or equal to the current remaining inventory quantity; If the target adjustment quantity is less than or equal to the current remaining inventory, then the inventory adjustment instruction is executed to transfer the products corresponding to the target adjustment quantity to the consumer hotspot area; If the target adjustment quantity is greater than the current remaining inventory, an insufficient inventory alarm is generated, and the insufficient inventory alarm, together with the current remaining inventory, is returned to the manufacturer's management backend. If the type of the response instruction is a marketing push instruction, then extract the push content template and the upper limit of the push frequency from the response instruction; Obtain the set of mobile device identifiers that have scanned the historical preferred products within the preset statistical period in the consumer hotspot area; Based on the upper limit of push frequency, the push content template is pushed to each mobile device in the set of mobile device identifiers, and the push content template contains a link to the traceability information of the currently preferred variety; Record the push time and target audience for each push, and associate the push time with the scan increment of the currently preferred product in the consumer hotspot area within a subsequent preset time period to generate a push effect evaluation report.
[0010] Optionally, after the statement that the second hash value is inconsistent with the first hash value, the method further includes: The second anti-counterfeiting data is compared field by field with the original anti-counterfeiting data corresponding to the first hash value to identify the difference fields; Determine whether the difference field is only the scan time field; If only the scan time field is available, then obtain the direction of the deviation between the scan time and the effective time window; If the deviation direction is that the scanning time is earlier than the start time of the effective time window, and the deviation duration is less than the preset early tolerance duration, then traceability information is returned to the mobile terminal, and this scan is marked as an early scan. If the deviation direction is that the scan time is later than the end time of the valid time window, then the source information will not be returned; If the difference fields are not limited to the scan time field, then it is further determined whether the difference fields include the geographic location field; If the location field is included and the deviation value of the location field is less than the preset location tolerance deviation, the source information is returned to the mobile device, and this scan is marked as a location fine-tuning scan. If the QR code contains a geographic location field and the deviation value of the geographic location field is greater than or equal to the preset location tolerance deviation, then the source information will be refused and the QR code will be marked as having an abnormal location.
[0011] Optionally, determining whether to return the tracing information to the mobile terminal based on the combined state of the location comparison result, the time comparison result, and the device comparison result includes: If the location comparison result is that the geographical location is within the preset authorized area, the time comparison result is that the scanning time is within the effective time window, and the device comparison result is that the mobile device identifier is within the authorized device list, then the traceability information is returned to the mobile device. If the location comparison result is that the geographical location is within the preset authorized area, the time comparison result is that the scanning time is within the effective time window, but the device comparison result is that the mobile device identifier is not in the authorized device list, then a simplified version of the traceability information is returned to the mobile device, and the mobile device identifier is added to the list to be reviewed. If the location comparison result indicates that the geographical location is within the preset authorized area, but the time comparison result indicates that the scanning time is earlier than the start time of the effective time window, then the source tracing information is returned to the mobile terminal, and this scan is marked as an early scan record; If the location comparison result indicates that the geographical location is within the preset authorized area, but the time comparison result indicates that the scanning time is later than the end time of the valid time window, then the traceability information will be refused and the QR code will be marked as expired. If the location comparison result is that the geographical location is not located within the preset authorized area, and the time comparison result is that the scanning time is within the effective time window, then it is further determined whether the geographical location is within the radiation range of the preset logistics path associated with the traceability code; If the geographical location is within the coverage area of the preset logistics route, the traceability information is returned to the mobile terminal, and this scan is marked as a scan during logistics. If the geographical location is not within the coverage area of the preset logistics route, the traceability information will be refused and the QR code will be marked as having an abnormal location.
[0012] Optionally, after adding the mobile device identifier to the list to be reviewed, the method further includes: Obtain the cumulative number of times the mobile device identifier appears in the list to be reviewed, and determine whether the cumulative number of appearances exceeds the preset number of times to be reviewed; If the cumulative number of occurrences does not exceed the preset review tolerance number, then the mobile device identifier remains in the list of devices to be reviewed; If the cumulative number of occurrences exceeds the preset tolerance limit, the mobile device identifier will be moved to the preset malicious device blacklist. After the mobile device identifier is added to the preset malicious device blacklist, when a scanning request initiated by the mobile device identifier is received again, the source tracing information is directly rejected and the hash value comparison step is no longer executed. Every preset unblocking period, the mobile device identifier is removed from the preset malicious device blacklist, and the cumulative occurrence count is reset.
[0013] Optionally, after marking the QR code as having an abnormal location, the method further includes: Obtain the number of all QR codes marked as having abnormal locations in the traceability batch associated with the QR code, and determine whether the proportion of the number to the total number of QR codes in the traceability batch exceeds a preset batch abnormality proportion. If the ratio does not exceed the preset batch abnormal ratio, then only the current QR code's position abnormal state is maintained; If the ratio exceeds the preset batch abnormal ratio, then batch locking is performed on all QR codes in the traceability batch that are in a normal state, and the return of traceability information is prohibited. Extract the abnormal geographical locations of all abnormal QR codes in the traceability batch, and determine whether the abnormal geographical locations are all located in the same unauthorized area; If all the abnormal geographical locations are located in the same unauthorized area, a cross-selling warning report will be generated and pushed to the management terminal; If the abnormal geographical locations are scattered across multiple unauthorized areas, a batch of abnormal alarms will be generated and pushed to the management terminal.
[0014] Secondly, this application also discloses an anti-counterfeiting analysis system for agricultural products with a unique code, which adopts the following technical solution: A unique anti-counterfeiting analysis system for agricultural products, comprising: The traceability code hash module is used to obtain the unique traceability code corresponding to each agricultural product in the traceability batch, obtain the dynamic salt value bound to the traceability code, and calculate the first hash value by combining the traceability code and the dynamic salt value. A QR code generation module is used to generate a QR code from the traceability code and associate it with the traceability information of the agricultural product; The scanning data extraction module is used to extract the geographical location, scanning time and mobile device identifier at the scanning time when the mobile device scans the QR code, and combine the geographical location, scanning time and mobile device identifier into second anti-counterfeiting data; The second hash calculation module is used to obtain the dynamic salt value, and calculate the second hash value by combining the second anti-counterfeiting data with the dynamic salt value. The hash comparison module is used to determine whether the second hash value is consistent with the first hash value; If the second hash value matches the first hash value, the normal processing module stores the scan record in the database and returns the tracing information to the mobile terminal. If the second hash value is inconsistent with the first hash value, the three-factor comparison module is used to compare the geographical location in the second anti-counterfeiting data with the preset authorized area associated with the traceability code to obtain the location comparison result, compare the scanning time with the effective time window associated with the traceability code to obtain the time comparison result, and compare the mobile device identifier with the list of authorized devices associated with the traceability code to obtain the device comparison result. The response decision module is used to determine whether to return the traceability information to the mobile terminal based on the combined status of the location comparison result, the time comparison result, and the device comparison result.
[0015] In summary, this application includes the following beneficial technical effects: By calculating the first hash value of the unique traceability code of agricultural products and the second hash value of the second anti-counterfeiting data formed by the combination of geographical location, scanning time and mobile device identifier extracted during scanning, a double hash comparison is performed. At the same time, multi-dimensional verification of the three elements of location, time and device is combined, which effectively solves the defects of existing technologies such as the easy copying and counterfeiting of one-item-one-code labels for agricultural products and the lack of dynamic scanning monitoring leading to insufficient anti-counterfeiting reliability. It realizes accurate anti-counterfeiting of "static labeling + dynamic scanning", ensures the authenticity of traceability information, and significantly improves the anti-counterfeiting reliability of one-item-one-code for agricultural products. Attached Figure Description
[0016] Figure 1 This is a flowchart of the main process of an anti-counterfeiting analysis method for one item, one code for agricultural products according to an embodiment of this application; Figure 2 This is a block diagram of an anti-counterfeiting analysis system for agricultural products with one code per item, according to an embodiment of this application.
[0017] Explanation of reference numerals in the attached figures: 1. Traceability code hash module; 2. QR code generation module; 3. Scan data extraction module; 4. Second hash calculation module; 5. Hash comparison module; 6. Normal processing module; 7. Three-factor comparison module; 8. Response decision module. Detailed Implementation
[0018] Firstly, this application discloses a method for anti-counterfeiting analysis of agricultural products with unique codes for each item.
[0019] Reference Figure 1 A method for anti-counterfeiting analysis of agricultural products with unique codes, comprising steps S101 to S108: Step S101: Obtain the unique traceability code corresponding to each agricultural product in the traceability batch, obtain the dynamic salt value bound to the traceability code, and calculate the first hash value by combining the traceability code and the dynamic salt value.
[0020] Specifically, a traceability batch refers to a batch of agricultural products produced under the same production cycle, the same production environment, and the same processing standards. Each traceability batch is assigned a unique batch identifier to link all agricultural products within that batch. The unique traceability code is a unique, non-repeatable identifier assigned to each agricultural product. It can be generated using a UUID (Universally Unique Identifier) or a custom coding rule to ensure that each agricultural product has its own exclusive "ID card" and avoid confusion with other agricultural products.
[0021] To enhance anti-counterfeiting security and prevent brute-force attacks on hash values, this embodiment introduces a dynamic salt mechanism. This dynamic salt is a randomly generated 16-bit string, bound to the traceability code and stored on the blockchain node, ensuring the immutability of the association between the salt and the traceability code. The hash operation uses the SM3 national cryptographic hash algorithm to encrypt the combination of the traceability code and the salt, resulting in a fixed-length first hash value. The SM3 national cryptographic hash algorithm is irreversible and unique; different input data (different traceability codes or salt values) will generate different first hash values, while the same input data will generate the same first hash value. Subsequent hash value comparisons can verify the integrity and authenticity of the traceability code, preventing tampering. Simultaneously, the dynamic salt mechanism ensures that even if two agricultural products have the same traceability code (which is practically impossible), the randomness of the salt value will result in different first hash values, further enhancing anti-counterfeiting strength. Furthermore, the salt value is only stored and accessed on the server side, dynamically issued by the server during scanning, effectively preventing brute-force attacks or replay attacks.
[0022] Step S102: Generate a QR code from the traceability code and associate it with the traceability information of the agricultural product.
[0023] Specifically, a QR code generation tool is used to convert the unique traceability code of each agricultural product into a scannable QR code. QR codes are characterized by their ability to store large amounts of information, ease of scanning, and durability, facilitating quick information access for consumers and relevant personnel. To further enhance anti-counterfeiting capabilities, physical anti-counterfeiting features are added to the existing digital anti-counterfeiting measures. A 3D micro-embossed structure with a depth of 20-50μm is pressed onto the surface of the QR code label, containing manufacturer identification invisible to the naked eye. The QR code border is printed with thermochromic ink, revealing a hidden pattern in environments above 38℃ for rapid visual identification. Simultaneously, a handheld Raman spectrometer is incorporated to analyze characteristic spectral peaks of the label substrate (such as 1080cm⁻¹). -1The physical authenticity is verified by using PET characteristic peaks, achieving a fusion of physical and chemical labels for anti-counterfeiting. Traceability information refers to relevant data on agricultural products throughout the entire process from production to distribution, including but not limited to information on farmers, planting / breeding time, fertilization / pesticide use records, processing information, testing reports, transportation routes, and warehousing information. The traceability code and traceability information are linked and stored in a database, allowing for quick retrieval of the corresponding traceability information after scanning the QR code, thus achieving full traceability of agricultural products.
[0024] Step S103: When the mobile device scans the QR code, extract the geographical location, scanning time and mobile device identifier of the scanning time, and combine the geographical location, scanning time and mobile device identifier into the second anti-counterfeiting data.
[0025] Specifically, the mobile terminal includes smartphones, tablets, and other mobile devices with scanning and location functions. When a user scans a QR code on agricultural products using mobile scanning software (such as WeChat or Alipay), the system automatically triggers a data extraction operation. The geographical location at the time of scanning is obtained through the mobile terminal's GPS positioning module, accurate to latitude and longitude, to determine whether the scanning location meets preset requirements; the scanning time is the precise time (accurate to the second) when the system receives the scanning request, used to verify whether the scanning behavior is within the valid time range; the mobile terminal device identifier refers to the mobile terminal's unique device identification code (such as IMEI code or device UUID), used to distinguish different scanning devices and identify abnormal scanning behavior (such as the same device frequently scanning multiple QR codes). The second anti-counterfeiting data is a dataset formed by combining the above three dimensions of information in a preset format, used for subsequent comparison with the original data corresponding to the traceability code, further improving the accuracy of anti-counterfeiting.
[0026] Step S104: Obtain the dynamic salt value, and calculate the second hash value by combining the second anti-counterfeiting data with the dynamic salt value.
[0027] Specifically, during scanning, the server dynamically sends a 16-bit salt value bound to the traceability code. Using the same SM3 national cryptographic hash algorithm as in step S101, the second anti-counterfeiting data and the dynamically sent salt value are encrypted to obtain the second hash value. Since the second anti-counterfeiting data contains three dynamically changing pieces of information—geographical location, scanning time, and device fingerprint—and although the salt value sent for each scan is bound to the traceability code, it needs to be dynamically retrieved by the server, the combination of the second anti-counterfeiting data and the salt value generated for each scan is likely to be different, resulting in a different second hash value. By comparing it with the first hash value, it is possible to quickly determine whether the anti-counterfeiting data scanned this time matches the original data corresponding to the traceability code, initially identifying abnormal scans while avoiding the risk of a single hash value being easily cracked by brute force.
[0028] Step S105: Determine whether the second hash value is consistent with the first hash value.
[0029] Specifically, hash value comparison is one of the core steps in anti-counterfeiting verification. The system compares the second hash value calculated in step S104 with the first hash value calculated in step S101 bit by bit. If they match, it means that the second anti-counterfeiting data and dynamic salt value of this scan match the original anti-counterfeiting data (the traceability code itself, the salt value, and the associated basic verification information) corresponding to the traceability code, and the scanning behavior is initially judged to be normal. If they do not match, it means that there is an anomaly in the second anti-counterfeiting data or salt value of this scan (it may be that the QR code has been tampered with, the scanning device is abnormal, or the scanning location or time is abnormal, etc.), and further multi-dimensional verification is needed to determine whether it is a malicious scan or an abnormal situation.
[0030] Step S106: If the second hash value matches the first hash value, the scan record is stored in the database and the traceability information is returned to the mobile device.
[0031] Specifically, when the second hash value matches the first hash value, it indicates that the scan was successful. The system will store the complete record of this scan (including traceability code, scan time, geographical location, mobile device identifier, hash value comparison result, salt value information, etc.) in the database for subsequent traceability queries and data statistics. Simultaneously, the system returns complete traceability information for the agricultural product to the user through mobile scanning software, including data from the entire process of production, processing, and transportation, allowing users to intuitively understand the quality and safety of the agricultural product and achieve "scan to verify, consume with confidence."
[0032] Step S107: If the second hash value is inconsistent with the first hash value, the geographical location in the second anti-counterfeiting data is compared with the preset authorized area associated with the traceability code to obtain the location comparison result. At the same time, the scanning time is compared with the valid time window associated with the traceability code to obtain the time comparison result. At the same time, the mobile device identifier is compared with the list of authorized devices associated with the traceability code to obtain the device comparison result.
[0033] Specifically, when hash values do not match, further verification using three elements—location, time, and device—is required to rule out non-malicious anomalies (such as location deviation or time error) and identify malicious forgery or theft. The preset authorized area refers to the area where the agricultural product corresponding to the traceability code is allowed to be scanned. This is preset by the manufacturer or management based on the agricultural product's circulation range (such as sales area or storage area), usually defined by latitude and longitude. The valid time window refers to the valid scanning period for the QR code corresponding to the traceability code. This is preset by the management based on the agricultural product's shelf life and circulation cycle (e.g., valid for 3 months from the time the agricultural product leaves the warehouse). The authorized device list refers to the set of mobile device identifiers allowed to scan the traceability code and obtain complete traceability information. This is mainly used for scanning verification by specific groups such as distributors and regulatory personnel. Ordinary consumers' devices are usually not in this list, but this does not affect the acquisition of basic traceability information. Location comparison results, time comparison results, and device comparison results are all "compliant" or "non-compliant," used for subsequent decisions on whether to return traceability information.
[0034] Step S108: Based on the combined status of location comparison results, time comparison results, and device comparison results, determine whether to return traceability information to the mobile terminal.
[0035] Specifically, different combinations of the three-factor comparison results correspond to different scanning scenarios. The system determines whether to return traceability information, and whether to return complete or simplified traceability information, based on preset rules. At the same time, it marks abnormal situations for subsequent processing by the management end. For example, if the scanning location and time meet the requirements, but the device is not in the authorized list, simplified traceability information (with some sensitive data hidden) can be returned. If the location, time, and device all do not meet the requirements, the traceability information will not be returned, and it will be marked as an abnormal scan to prevent the forgery of QR codes from obtaining traceability information.
[0036] In one embodiment of this example, step S106 further includes steps S201 to S209 after the second hash value matches the first hash value: Step S201: Obtain the cumulative number of scans of the traceability code before this scan, and determine whether the cumulative number of scans is zero.
[0037] Specifically, the cumulative scan count refers to the total number of times the QR code corresponding to the traceability code has been scanned by a mobile device since its generation. This data is stored in a database and is automatically accumulated after each scan. Determining whether the cumulative scan count is zero mainly involves distinguishing between first-time scans and non-first-time scans. First-time scans typically correspond to consumers' first query for agricultural product traceability information, while non-first-time scans may indicate duplicate queries, abnormal transfers, etc., requiring further verification of the rationality of the scanning behavior.
[0038] Step S202: If the cumulative number of scans is zero, then store the geographical location at the time of this scan as the initial anchor point of the traceability code.
[0039] Specifically, the initial anchor point refers to the geographical location of the agricultural product when it is first scanned, serving as a benchmark for subsequent judgment of the agricultural product's circulation trajectory. Since the normal circulation of agricultural products involves continuous geographical location changes (such as from storage location to sales location), the initial scan location is usually the first circulation node of the agricultural product (such as supermarkets or farmers' markets). Storing the initial anchor point location allows for subsequent comparison of the locations at different scan times to identify whether the agricultural product has experienced abnormal circulation (such as cross-regional sales or theft).
[0040] Step S203: If the cumulative number of scans is not zero, calculate the offset distance between the geographical location at the time of the current scan and the initial anchor point.
[0041] Specifically, the offset distance refers to the straight-line distance between the current scanned geographical location and the initial anchor point, calculated using latitude and longitude coordinates (using the Haversine formula to calculate the straight-line distance between two points on the Earth's surface based on their latitude and longitude). The offset distance is used to determine whether the circulation of agricultural products is within a reasonable range. For example, the offset distance is usually small for circulation between supermarkets within the same city. If the offset distance is too large (e.g., scanning from Beijing and then scanning again in Guangzhou within a short period), an anomaly may exist. In this embodiment, an offset distance of 50km is set as the critical value. If the offset distance is <50km, it is considered normal circulation; if the offset distance is ≥50km, further analysis of trajectory characteristics is required to construct a spatial-temporal-density three-dimensional anomaly identification model to accurately determine the anomaly type.
[0042] Step S204: Determine whether the offset distance exceeds the preset reasonable offset distance.
[0043] Specifically, the preset reasonable offset distance is a distance threshold set by the management end based on the circulation characteristics of agricultural products (e.g., 50 kilometers within a city, 300 kilometers across cities). The reasonable offset distance can be flexibly adjusted for different categories and circulation ranges of agricultural products. Determining whether the offset distance exceeds this threshold is to initially screen out agricultural products with abnormal circulation. If it does not exceed the threshold, it is considered to be in normal circulation; if it exceeds the threshold, the rationality of the circulation trajectory needs to be further verified.
[0044] Step S205: If the offset distance does not exceed the preset reasonable offset distance, then the scan record is stored normally.
[0045] Specifically, when the offset distance is within a reasonable range, it indicates that the circulation of agricultural products is in line with expectations (such as consumers querying different locations within the same city, or agricultural products circulating along normal circulation paths). The system stores the scan record (including scan time, geographical location, equipment identification, etc.) in the database according to the normal process, and updates the cumulative number of scans for the traceability code, without affecting the return of subsequent traceability information.
[0046] Step S206: If the offset distance exceeds the preset reasonable offset distance, then obtain all historical offset records of the traceability code within the preset historical time period.
[0047] Specifically, the preset historical time period refers to a fixed period of time (such as 7 days or 15 days) prior to this scan. The historical offset record refers to data such as the offset distance and scan time of the geographical location of the traceability code from the initial anchor point during each scan within this period. Obtaining the historical offset record is to analyze the geographical location change trajectory of agricultural products, distinguish between "normal migration" and "abnormal jumps," avoid misjudging abnormalities due to single positioning errors or accidental situations, and, combined with density analysis, accurately identify abnormal situations such as cross-regional sales.
[0048] Step S207: Determine whether the change in the geographical location of the traceability code presents a continuous linear trajectory based on all historical offset records.
[0049] Specifically, a continuous linear trajectory refers to the gradual migration trend of agricultural products' geographical location, conforming to normal logistics flow patterns (e.g., from city A to city B, and then to city C, with the scanning time for each location increasing sequentially and the offset distance gradually changing). By sorting the geographical locations in historical offset records by scanning time and analyzing the trend of coordinate changes, if a continuous linear trajectory is observed, it indicates that the agricultural products are in a normal flow state; if the geographical location suddenly jumps (e.g., jumping from city A to city C in a short period of time without any scanning records in city B in between), it is considered a non-continuous linear trajectory, which may indicate an anomaly, requiring further calculation of anomaly density.
[0050] Step S208: If a continuous linear trajectory is presented, mark this offset as a normal migration and update the initial anchor point position to the current position.
[0051] Specifically, if the change in geographical location shows a continuous linear trajectory, it indicates that agricultural products are circulating normally (e.g., transported from the production area to the sales area via logistics, and scanned multiple times along the way). This offset is normal and is marked as "normal migration". At the same time, the initial anchor point position is updated to the geographical location of this scan to adapt to the changes in the circulation of agricultural products. Subsequent scans will use the new anchor point position to calculate the offset distance, ensuring the accuracy of the circulation trajectory judgment.
[0052] Step S209: If a continuous linear trajectory is not presented, the traceability code is marked as a geographical anomaly, and the return of traceability information is paused until the management terminal manually cancels it.
[0053] Specifically, if the geographical location change does not show a continuous linear trajectory, it indicates that there may be an anomaly in the agricultural products (such as the QR code being copied and scanned in another location, or the agricultural products being stolen and circulated). In this case, the traceability code is marked as geographically abnormal, and the return of traceability information to mobile devices is suspended to prevent consumers from obtaining incorrect traceability information. At the same time, the management department is alerted to check in a timely manner. Management staff will manually verify the traceability codes with geographical anomalies. If no anomalies are confirmed, the anomaly status will be manually lifted, and the traceability information return function will be restored. If anomalies are confirmed (such as counterfeiting or theft), further processing measures will be taken (such as locking the QR code and tracing the source). When more than 15% of the traceability codes in the same batch show a non-continuous linear trajectory deviation within 24 hours, the system will automatically trigger batch locking to accurately prevent batch cross-selling or counterfeiting issues.
[0054] In one embodiment of this example, after marking the traceability code as a geographical anomaly in step S209, steps S301 to S305 are further included: Step S301: Obtain the traceability batch identifier associated with the traceability code, and determine whether there are other associated traceability codes in the traceability batch that are also marked as geographical anomalies.
[0055] Specifically, the traceability batch identifier is a unique identifier for the traceability batch to which the traceability code belongs. This identifier can be linked to the traceability codes of all agricultural products within the same batch. Determining whether other traceability codes within the same batch are marked as geographically abnormal is to distinguish between individual abnormalities and batch abnormalities. Individual abnormalities refer to an anomaly in the QR code of a single agricultural product, which may be an isolated incident. Batch abnormalities refer to anomalies in the QR codes of multiple agricultural products within the same batch, potentially indicating issues such as bulk counterfeiting or cross-regional sales within that batch. These require focused attention, especially when the abnormality rate within the same batch exceeds 15%, triggering batch locking.
[0056] Step S302: If there are no other related source codes that are also marked as geographically anomalous, then only the current source code is kept in geographically anomalous state.
[0057] Specifically, if only the current traceability code in the same batch is marked as geographically abnormal, it means that the abnormality only occurs on a single agricultural product and is an individual abnormality. In this case, only the geographically abnormal status is maintained for that traceability code, without affecting the use of other normal traceability codes in the same batch. The management only needs to check the single traceability code, thus reducing the verification cost.
[0058] Step S303: If there are other related source codes that are also marked as geographic anomalies, then further determine whether the abnormal geographical locations of all the related source codes of geographic anomalies constitute a spatial cluster distribution.
[0059] Specifically, spatial clustering distribution refers to the concentration of abnormal geographical locations of multiple geographic anomalies in the same area (such as a street or market in the same city). Cluster analysis is performed on the latitude and longitude of all abnormal geographical locations to determine if there are obvious clustering characteristics. In this embodiment, the DBSCAN clustering algorithm is used to perform cluster analysis on the latitude and longitude of all abnormal geographical locations. When the spatial cluster radius is ≤5km and the number of samples is ≥3, it is determined to be a hotspot for cross-border sales; if this condition is not met, it is considered a non-clustered distribution. If spatial clustering is formed, it indicates that the batch of agricultural products may have batch anomalies in this area (such as batch cross-border sales or batch counterfeiting); if there is no clustering, it may be an accidental superposition of multiple individual anomalies.
[0060] Step S304: If a spatial clustered distribution is formed, it is determined that there is a concentrated geographical anomaly in the traceability batch, and batch locking is performed on all traceability codes in the traceability batch.
[0061] Specifically, concentrated geographical anomalies refer to multiple agricultural products from the same batch exhibiting geographical anomalies in the same region. This is highly likely due to the batch of agricultural products being sold in bulk or counterfeited. In this case, all traceability codes for that batch are locked. After locking, the QR codes corresponding to all traceability codes are suspended from use, and scanning them will no longer return traceability information, preventing the abnormal agricultural products from continuing to circulate. At the same time, the management side initiates batch verification to trace the source of the anomaly (such as distributors selling in bulk or counterfeit dens).
[0062] Step S305: If it does not constitute a spatial clustered distribution, it is determined to be an individual geographical anomaly, and the geographical anomaly status is maintained only for the current tracing code.
[0063] Specifically, if the abnormal geographical locations of multiple abnormal traceability codes are scattered in different regions, it means that the abnormality of each abnormal traceability code is independent and belongs to individual geographical anomalies. In this case, only the geographical anomaly status is maintained for each abnormal traceability code, while other normal traceability codes in the same batch are used normally. The management end checks each abnormal traceability code separately to improve the efficiency of the check.
[0064] In one embodiment of this example, after storing the scan record in the database and returning the traceability information to the mobile terminal in step S106, steps S401 to S407 are further included: Step S401: Extract all scan records of the same geographical location within a preset statistical period from the database, and count the number of different mobile device identifiers corresponding to the geographical location based on all scan records.
[0065] Specifically, the same geographical location refers to an area with latitude and longitude errors within a preset range (e.g., within 100 meters), which can be considered the same scanning location (e.g., a supermarket or a farmers' market); the preset statistical period is a statistical time period preset by the management end (e.g., 1 day or 7 days) used to analyze the scanning data within that time period; the number of different mobile device identifiers refers to the number of different mobile devices that have scanned the QR code of agricultural products within that geographical location and that statistical period. This number reflects the popularity of agricultural product inquiries at that location. The higher the number, the higher the attention consumers pay to the traceability of agricultural products at that location, and the greater the circulation of agricultural products.
[0066] Step S402: Determine whether the number of different mobile device identifiers exceeds the preset popularity threshold.
[0067] Specifically, the preset heat threshold is a set of device quantity thresholds preset by the management system based on the circulation scale and population density of different areas (e.g., 50 devices in the city center and 20 devices in the suburbs). This threshold is used to determine whether a geographical location is a hotspot for agricultural product consumption. If the number of devices exceeds the threshold, it indicates that the location has high agricultural product consumption activity and is considered a hotspot; if it does not exceed the threshold, it is considered a normal consumption area, and monitoring can continue.
[0068] Step S403: If the preset heat threshold is not exceeded, continue monitoring subsequent scan records.
[0069] Specifically, if the number of different device identifiers in a given geographical location does not exceed the heat threshold, it indicates that the consumption activity of agricultural products in that area is generally low and there are no obvious hotspot characteristics. The system will continue to monitor subsequent scanning records in that area and update the number of device identifiers in real time until the heat threshold is reached or the statistical period ends.
[0070] Step S404: If the preset popularity threshold is exceeded, the geographical location is marked as a consumer hotspot area.
[0071] Specifically, when the number of device identifiers exceeds the popularity threshold, the geographical location is marked as a consumer hotspot area and marked in the database. At the same time, information such as the statistical period and number of devices in the hotspot area are recorded to facilitate subsequent viewing and analysis by the management end, and to provide manufacturers with market demand references.
[0072] Step S405: Obtain the agricultural product varieties with the most scans within the consumption hotspot area, and associate the agricultural product varieties with the consumption hotspot area.
[0073] Specifically, agricultural product varieties refer to different categories of agricultural products within the same batch (such as apples and pears from the same batch, or different specifications of the same category). By statistically analyzing the number of scans for each agricultural product variety across all scan records within a consumer hotspot area, the variety with the most scans is selected. This variety represents the agricultural product that consumers in that hotspot area are most interested in and prefer. Linking this variety with the consumer hotspot area allows producers to understand consumer preferences in different regions.
[0074] Step S406: Determine whether the agricultural product varieties are consistent with the historical preferred varieties in popular consumption areas.
[0075] Specifically, historically preferred varieties refer to the agricultural products most frequently scanned in a given consumption hotspot region during previous statistical periods (e.g., the past 3 months or 6 months). These varieties are stored in a database and used to compare current preferred varieties with historically preferred varieties. Determining whether the two are consistent is to identify changes in consumption preferences. If they are inconsistent, it indicates a shift in consumer preferences in the region, requiring producers to adjust their production and supply strategies.
[0076] Step S407: If there is a discrepancy, generate a variety preference migration report and push the variety preference migration report to the manufacturer management backend.
[0077] Specifically, the product preference migration report includes basic information about the consumption hotspot region, current preferred products, historical preferred products, preference change trends, and scan data statistics. This report clearly shows producers changes in consumer preferences. Pushing the report to the producer's management backend allows producers to promptly grasp changes in market demand, adjust inventory allocation and production plans (e.g., increase the output of currently preferred products and reduce the output of historically preferred products), and enhance market competitiveness. In this embodiment, a time-series-spatial fusion consumer behavior prediction model can also be constructed based on an LSTM neural network. Inputting scan data from the past 12 weeks (time-series characteristics) and regional economic indicators (spatial characteristics), it predicts changes in product demand for the next 4 weeks. When the accuracy is ≥85%, it automatically generates procurement suggestions. By predicting agricultural product preferences in consumption hotspot regions using a Long Short-Term Memory (LSTM) network, it can accurately predict future demand, providing a scientific basis for producers' procurement and production, and reducing inventory backlogs or supply shortages.
[0078] In one embodiment of this example, after generating the variety preference migration report and pushing it to the manufacturer management backend, step S407 further includes steps S501 to S510: Step S501: Receive the response instruction returned by the manufacturer's management backend and determine the type of the response instruction.
[0079] Specifically, after receiving the product preference migration report and consumption forecast results, the manufacturer's management backend generates response instructions based on the report content. These instructions are mainly divided into two types: inventory adjustment instructions and marketing push instructions. Inventory adjustment instructions are used to adjust the inventory of agricultural products in high-consumption areas to match current consumption preferences and predicted demand. Marketing push instructions are used to push marketing content to target users in response to changes in consumption preferences, thereby increasing sales of currently preferred products. After receiving the response instructions, the system first determines the instruction type and then executes the corresponding processing flow.
[0080] Step S502: If the type of the response instruction is an inventory adjustment instruction, then extract the target variety and the target adjustment quantity from the response instruction. The target variety is the current preferred variety or the historical preferred variety.
[0081] Specifically, inventory adjustment instructions include two core parameters: the target product and the target adjustment quantity. The target product is the agricultural product for which the producer needs to adjust its inventory, typically a preferred product in current consumption hotspots (requiring increased inventory) or a historically preferred product (requiring decreased inventory). The target adjustment quantity is the quantity of agricultural products the producer plans to allocate to or transfer from that consumption hotspot; a positive number indicates an increase in inventory, and a negative number indicates a decrease. The system extracts these two parameters from the instruction for subsequent inventory verification and allocation.
[0082] Step S503: Based on the target variety, query the traceability batch information corresponding to the target variety, and extract the current remaining inventory from the traceability batch information.
[0083] Specifically, the traceability batch information consists of relevant data about the traceability batch to which the target product belongs, including batch identifier, production quantity, quantity already allocated, and current remaining inventory, which is stored in the database. The system queries the corresponding traceability batch information for the target product and extracts the current remaining inventory, i.e., the quantity of the product currently available for allocation, to determine whether the target adjustment quantity is feasible.
[0084] Step S504: Determine whether the target adjustment quantity is less than or equal to the current remaining inventory.
[0085] Specifically, this judgment is used to verify the feasibility of inventory adjustment instructions. If the target adjustment quantity (when increasing inventory) is less than or equal to the current remaining inventory, it means that the inventory is sufficient and the transfer can be executed normally. If the target adjustment quantity is greater than the current remaining inventory, it means that the inventory is insufficient and cannot meet the transfer requirements. The inventory situation needs to be reported to the manufacturer.
[0086] Step S505: If the target adjustment quantity is less than or equal to the current remaining inventory, execute the inventory adjustment instruction to transfer the products corresponding to the target adjustment quantity to the consumer hotspot area.
[0087] Specifically, when inventory is sufficient, the system executes an inventory adjustment instruction, generates a transfer order, and notifies the logistics department to transfer the target quantity of the target agricultural products to the consumption hotspot area. At the same time, it updates the database with information such as the remaining inventory and the quantity already transferred for the traceability batch, ensuring that inventory data is accurate in real time and matching inventory with consumption demand.
[0088] Step S506: If the target adjustment quantity is greater than the current remaining inventory, generate an insufficient inventory alarm and return the insufficient inventory alarm along with the current remaining inventory to the manufacturer management backend.
[0089] Specifically, when inventory is insufficient, the system generates an inventory shortage alarm. The alarm information includes the target product, the target adjustment quantity, the current remaining inventory, and the quantity shortfall. The alarm information is returned to the manufacturer's management backend to remind the manufacturer to replenish inventory in a timely manner (such as arranging production or transferring from other regions) to avoid affecting the supply of popular consumption areas due to insufficient inventory. At the same time, it facilitates the manufacturer to adjust inventory adjustment instructions.
[0090] Step S507: If the type of the response instruction is a marketing push instruction, then extract the push content template and the upper limit of the push frequency from the response instruction.
[0091] Specifically, the marketing push instruction includes two core parameters: the push content template and the push frequency limit. The push content template is a marketing copy preset by the manufacturer, which includes links to traceability information of the currently preferred products, promotional activities, product features, etc., and is used to push to users. The push frequency limit refers to the maximum number of times marketing content can be pushed to the same mobile device within a preset time period (such as 1 day or 3 days) to avoid excessive pushes that may disturb users.
[0092] Step S508: Obtain the set of mobile device identifiers that have scanned historical preferred products within a preset statistical period in the consumer hotspot area.
[0093] Specifically, the device identifier set refers to the unique identifiers of all mobile devices that have scanned the QR codes of historically preferred products within the designated consumer hotspot area and a preset statistical period. These users have previously shown interest in historically preferred products in this area, indicating a certain level of interest in the region's agricultural products. Targeting them with marketing pushes can improve the accuracy and effectiveness of marketing efforts, thereby boosting sales of currently preferred products.
[0094] Step S509: Based on the upper limit of push frequency, push a push content template to each mobile device in the set of mobile device identifiers. The push content template contains a link to the traceability information of the currently preferred product.
[0095] Specifically, the system pushes marketing content templates to each device in the target device identifier set according to the maximum push frequency. Push methods can include SMS, app push, WeChat official account push, etc. The traceability information link in the push content template can guide users to scan and view the complete traceability information of their preferred product, enhancing user trust in the product and thus promoting purchase. At the same time, the system records relevant information for each push for subsequent effectiveness evaluation.
[0096] Step S510: Record the push time and target of each push, and associate the push time with the scan increment of the currently preferred varieties in the consumer hotspot area within the subsequent preset time period to generate a push effect evaluation report.
[0097] Specifically, push time refers to the precise time when each marketing content is pushed, and the push target refers to the mobile device identifier receiving the push; the subsequent preset time period refers to a fixed period of time (e.g., 7 days) after the push ends; and the scan increment refers to the difference between the number of scans of currently preferred products in the consumer hotspot area during this time period and the number of scans before the push. The system correlates push time with scan increment, analyzes the changes in the number of scans after the push, and generates a push effect evaluation report. The report includes the number of pushes, the number of push targets, scan increment, conversion rate, etc., and is pushed to the manufacturer's management backend to facilitate the manufacturer's evaluation of marketing effectiveness and optimization of subsequent marketing strategies.
[0098] In one embodiment of this example, if the second hash value is inconsistent with the first hash value in step S107, steps S601 to S608 are further included: Step S601: Compare the second anti-counterfeiting data with the original anti-counterfeiting data corresponding to the first hash value field by field to identify the difference fields.
[0099] Specifically, the original anti-counterfeiting data corresponding to the first hash value refers to the basic anti-counterfeiting data associated with the traceability code, including the traceability code itself, the preset scanning authorization area, the effective time window, the list of authorized devices, and other information. Field-by-field comparison refers to comparing the second anti-counterfeiting data (geographical location, scanning time, device identifier) with the corresponding fields in the original anti-counterfeiting data one by one to find inconsistent fields (i.e., difference fields). The number and type of difference fields determine the severity of the abnormal scan, facilitating subsequent targeted processing.
[0100] Step S602: Determine whether the difference field is only the scan time field.
[0101] Specifically, this judgment is used to distinguish the type of abnormal scan. If the only difference field is the scan time field, it means that the geographical location and device identification meet the requirements, and only the scan time is different. This may be a non-malicious anomaly such as mobile time error or the scan time being out of sync with the system time, which can be handled flexibly. If the difference field is not limited to the scan time field, it means that there is a more complex anomaly (such as abnormal geographical location or abnormal device), which requires further judgment.
[0102] Step S603: If only the scan time field is used, obtain the deviation direction between the scan time and the effective time window.
[0103] Specifically, deviations are categorized into two types: scanning time earlier than the start time of the valid time window (early scanning) and scanning time later than the end time of the valid time window (overdue scanning). Early scanning may occur when consumers obtain agricultural products and inquire about them ahead of time, which is considered a non-malicious anomaly; overdue scanning may occur when agricultural products have exceeded their shelf life or when the QR code has expired, which is considered an anomaly and requires different handling.
[0104] Step S604: If the deviation direction is that the scanning time is earlier than the start time of the effective time window, and the deviation duration is less than the preset early tolerance duration, then the traceability information is returned to the mobile terminal, and this scan is marked as an early scan.
[0105] Specifically, the preset advance tolerance period is the maximum time (e.g., 12 hours, 24 hours) allowed for early scanning as preset by the management end. This is used to tolerate early scanning caused by situations such as early delivery of goods or early access by consumers. If the deviation time of the early scan is within the tolerance range, it is considered a normal early query. The system returns complete traceability information to the mobile device and marks this scan as an "early scan," recording it in the database for subsequent statistics. If the deviation time exceeds the tolerance range, it is treated as an abnormal situation.
[0106] Step S605: If the deviation direction is that the scan time is later than the end time of the effective time window, then refuse to return the traceability information.
[0107] Specifically, the end time of the valid time window is usually linked to the shelf life and circulation cycle of agricultural products. If the scanning time is later than the end time, it means that the QR code has expired (the corresponding agricultural product may have expired or spoiled). In this case, the traceability information will not be returned to prevent consumers from obtaining the traceability information of expired agricultural products. At the same time, it reminds users that the agricultural product may have exceeded its shelf life, thus protecting consumer rights.
[0108] Step S606: If the difference field is not limited to the scan time field, then further determine whether the difference field includes the geographic location field.
[0109] Specifically, when the discrepancy field includes other fields besides the scan time, the priority is to determine whether it includes a geographic location field. This is because geographic location anomalies are usually associated with malicious activities such as QR code forgery and cross-selling, and are a key area for verification. If a geographic location field is included, the severity of the location deviation needs to be further assessed. If a geographic location field is not included, it indicates that the discrepancy field is a device identification field, and it should be handled as a device anomaly in conjunction with the device credit scoring system.
[0110] Step S607: If the location field is included and the deviation value of the location field is less than the preset location tolerance deviation, then the traceability information is returned to the mobile terminal, and this scan is marked as a location fine-tuning scan.
[0111] Specifically, the preset location tolerance deviation is the maximum allowable error in geographical location (e.g., 100 meters, 500 meters) preset by the management end. It is used to tolerate non-malicious anomalies such as GPS positioning errors on the mobile terminal and slight deviations in the scanning location (e.g., scanning at the supermarket entrance versus scanning inside the supermarket). If the location deviation value is within the tolerance range, it indicates a normal positioning error. The system returns complete traceability information to the mobile terminal and marks this scan as a "location fine-tuning scan," recording the positioning deviation to facilitate subsequent optimization of positioning accuracy.
[0112] Step S608: If the location field is included and the deviation value of the location field is greater than or equal to the preset location tolerance deviation, then the traceability information is refused to be returned and the QR code is marked as an abnormal location.
[0113] Specifically, if the location deviation exceeds the tolerance range, it indicates that the scanning location deviates too much from the preset authorized area. This may indicate abnormal situations such as the QR code being copied and scanned in a different location or agricultural products being sold illegally. In this case, the traceability information will be refused to be returned to prevent the spread of erroneous information. The QR code will be marked as having an abnormal location to remind the management to check in time and further determine whether there is any malicious behavior.
[0114] In one embodiment of this example, step S108, based on the combined state of the location comparison result, time comparison result, and device comparison result, determines whether to return traceability information to the mobile terminal, including steps S701 to S707: Step S701: If the location comparison result is that the geographical location is within the preset authorized area, the time comparison result is that the scanning time is within the valid time window, and the device comparison result is that the mobile device identifier is within the authorized device list, then the traceability information is returned to the mobile device.
[0115] Specifically, this combined state represents the ideal normal scanning state, meaning the scanning location is within the authorized range, the scanning time is within the valid window, and the scanning device is an authorized device (such as the device of a distributor or regulatory personnel). This indicates that the scanning behavior is fully compliant, and the system returns complete traceability information to the mobile terminal, including all sensitive data (such as test reports and distributor information), satisfying the query needs of authorized personnel.
[0116] Step S702: If the location comparison result is that the geographical location is within the preset authorized area, the time comparison result is that the scanning time is within the valid time window, but the device comparison result is that the mobile device identifier is not in the authorized device list, then a simplified version of the traceability information is returned to the mobile device, and the mobile device identifier is added to the list to be reviewed.
[0117] Specifically, this combined status indicates that the scanning location and time are normal, but the scanning device is an unauthorized device (such as a device used by a regular consumer). In this case, a simplified version of the traceability information is returned to the mobile device. This simplified information hides sensitive data (such as distributor information and test report details) and only displays basic traceability information (such as production time and place of origin), thus satisfying the consumer's query needs while protecting sensitive data. Simultaneously, the device identifier is added to the pending review list. The management system can subsequently verify the device's scanning behavior to determine if there are any anomalies (such as frequently scanning multiple QR codes) and, in conjunction with the device credit scoring system, conduct a dynamic credit assessment of the device.
[0118] Step S703: If the location comparison result shows that the geographical location is within the preset authorized area, but the time comparison result shows that the scanning time is earlier than the start time of the effective time window, then the traceability information is returned to the mobile terminal, and this scan is marked as an early scan record.
[0119] Specifically, this combined status indicates that the scanning location is normal, but the scanning time is ahead of schedule, which is a non-malicious anomaly (such as early delivery of logistics or early access to agricultural products by consumers). The system returns complete traceability information to the mobile terminal and marks this scan as an "early scan record", recording the early scan time and deviation duration, which is convenient for the management terminal to count the frequency of early scans and optimize the setting of the effective time window.
[0120] Step S704: If the location comparison result shows that the geographical location is within the preset authorized area, but the time comparison result shows that the scanning time is later than the end time of the valid time window, then the traceability information will not be returned and the QR code will be marked as expired.
[0121] Specifically, this status indicates that the scanning location is normal, but the scanning time has exceeded the valid window and the QR code has expired. At this time, the traceability information will not be returned to prevent consumers from obtaining the traceability information of expired agricultural products. At the same time, the QR code will be marked as "expired and invalid". The management can clean up the expired and invalid QR codes in the future to prevent them from being used maliciously.
[0122] Step S705: If the location comparison result is that the geographical location is not within the preset authorized area, and the time comparison result is that the scanning time is within the valid time window, then further determine whether the geographical location is within the radiation range of the preset logistics path associated with the traceability code.
[0123] Specifically, this status indicates that the scanning time is normal, but the scanning location is outside the authorized area. This may be because the agricultural product was scanned during the logistics process (such as during transportation or in a transit warehouse). In this case, it is necessary to further determine whether the scanning location is within the coverage area of the preset logistics route. The preset logistics route is the transportation route (such as the logistics route from the production warehouse to the sales city) preset by the management end for the agricultural product corresponding to this traceability code. The coverage area refers to a certain area around the logistics route (such as within 5 kilometers on both sides of the route) to tolerate scanning deviations during logistics.
[0124] Step S706: If the geographical location is within the coverage area of the preset logistics route, return the traceability information to the mobile terminal and mark this scan as a scan during logistics.
[0125] Specifically, if the scanning location is within the coverage area of the logistics route, it indicates that the scanning behavior occurred during the logistics process of agricultural products (such as scanning and verification by logistics personnel), which is a normal situation. The system returns complete traceability information to the mobile terminal and marks this scan as "scanning in logistics". This records the scanning situation in logistics, which makes it easier for the management to track the circulation progress of agricultural products and provides data support for supply chain optimization.
[0126] Step S707: If the geographical location is not within the coverage area of the preset logistics route, refuse to return the traceability information and mark the QR code as an abnormal location.
[0127] Specifically, if the scanning location is neither within the authorized area nor within the coverage area of the logistics route, it indicates that the scanning behavior is abnormal (such as the QR code being copied and scanned in another location, or agricultural products being sold off-site). In this case, the traceability information will not be returned to prevent the spread of erroneous information, and the QR code will be marked as having an abnormal location to remind the management to check in time and trace the source of the abnormality.
[0128] In one embodiment of this example, after adding the mobile device identifier to the list to be reviewed in step S702, the method further includes steps S801 to S805: Step S801: Obtain the cumulative number of times the mobile device identifier appears in the list of devices to be reviewed, and determine whether the cumulative number of appearances exceeds the preset number of times to be reviewed.
[0129] Specifically, the cumulative occurrence count refers to the total number of times the device identifier has been added to the pending review list. Each time the device scans an unauthorized QR code (or a QR code that does not meet the device requirements), the cumulative count is automatically incremented. The preset review tolerance count is the maximum number of abnormal occurrences allowed for the device identifier (e.g., 3 or 5 times) preset by the management end. This is used to distinguish between accidental and malicious abnormalities. If the cumulative count does not exceed the threshold, it is considered an accidental abnormality; if it exceeds the threshold, it is considered a malicious abnormality. In this embodiment, a dynamic credit scoring model can also be established based on the device's historical scanning behavior. The model includes three dimensions: scanning frequency, accuracy, and abnormality rate. The initial device credit score is 80 points. Normal scans add 0.1 points / scan, and abnormal scans deduct 2 points / scan. The dynamic credit scoring model evaluates the device: Credit score ≥ 90 points: automatically added to the authorized device list, enjoying priority data response; Credit score ≤ 60 points: scanning frequency is limited (≤ 3 times per 24 hours); Credit score ≤ 40 points: triggers deep verification (e.g., requiring verification code input or facial recognition), replacing the original single blacklist mechanism and improving the flexibility and accuracy of device management.
[0130] Step S802: If the cumulative number of occurrences does not exceed the preset review tolerance limit, then keep the mobile device identifier in the list of devices pending review.
[0131] Specifically, if the cumulative number of occurrences does not exceed the tolerance limit, it indicates that the abnormal scanning behavior of the device is an occasional occurrence (such as accidental scanning or temporary device malfunction). The system will keep the device in the pending review list and continue to monitor subsequent scanning behavior. If subsequent scans return to normal, the device can be manually removed from the pending review list, and its credit score will be gradually increased to restore normal privileges.
[0132] Step S803: If the cumulative number of occurrences exceeds the preset tolerance limit, the mobile device identifier will be moved to the preset malicious device blacklist.
[0133] Specifically, if the cumulative number of occurrences exceeds the tolerance limit or the device credit score is ≤40, it indicates that the device is engaging in malicious scanning behavior (such as frequently scanning unauthorized QR codes or attempting to crack the anti-counterfeiting system). In this case, the device will be added to the preset malicious device blacklist. Devices on the blacklist will have their scanning permissions restricted to prevent them from continuing to engage in malicious behavior.
[0134] Step S804: After the mobile device identifier is added to the preset malicious device blacklist, when a scanning request initiated by the mobile device identifier is received again, the source tracing information is directly rejected and the hash value comparison step is no longer executed.
[0135] Specifically, when a device on the malicious device blacklist initiates a scanning request, the system does not need to perform subsequent steps such as hash value comparison and three-factor comparison, and directly refuses to return traceability information, reducing system resource consumption and effectively preventing malicious devices from obtaining traceability information, thereby improving the security of the anti-counterfeiting system.
[0136] Step S805: Every preset unblocking cycle, remove the mobile device identifier from the preset malicious device blacklist and reset the cumulative occurrence count.
[0137] Specifically, the preset unblocking period is the blacklist unblocking time preset by the management terminal (such as 30 days or 60 days), which is used to avoid devices being permanently restricted from access due to temporary device abnormalities, misjudgments, or other reasons. At each unblocking period, the system automatically removes the device identifier from the blacklist, resets the device's cumulative occurrence count and credit score, and restores its normal scanning permissions. If multiple abnormal scans occur again or the credit score drops excessively, the device will be moved back to the blacklist.
[0138] In one embodiment of this example, after marking the QR code as having an abnormal location in step S707, steps S901 to S906 are further included: Step S901: Obtain the number of all QR codes marked as having abnormal locations in the traceability batch associated with the QR code, and determine whether the proportion of the number to the total number of QR codes in the traceability batch exceeds the preset batch abnormality proportion.
[0139] Specifically, the number of QR codes marked as having abnormal locations refers to the total number of agricultural product QR codes marked as having abnormal locations within the same traceability batch; the total number of QR codes refers to the total number of QR codes for all agricultural products within the traceability batch; the preset batch abnormality ratio is a threshold value (e.g., 10%, 20%) preset by the management terminal to determine whether a batch is abnormal, used to distinguish between individual location abnormalities and batch location abnormalities. If the ratio does not exceed the threshold, it is considered an individual abnormality; if it exceeds the threshold, it is considered a batch abnormality, and batch locking is automatically triggered.
[0140] Step S902: If the ratio does not exceed the preset batch abnormal ratio, then only maintain the current abnormal position of the QR code.
[0141] Specifically, if the proportion of abnormal QR codes does not exceed the threshold, it means that only a small number of individual QR codes in this batch of agricultural products have abnormal positions, which is an occasional situation. The system will only keep the current abnormal QR code in position and will not affect the use of other normal QR codes in the same batch. The management side only needs to check the abnormal QR codes separately.
[0142] Step S903: If the proportion exceeds the preset batch abnormality proportion, then perform batch locking on all QR codes in the traceability batch that are in normal status, and prohibit the return of traceability information.
[0143] Specifically, if the proportion of abnormal QR codes exceeds the threshold, it indicates that the batch of agricultural products may have abnormal batch location (such as batch cross-border sales or batch counterfeiting). At this time, batch locking is performed on all normal QR codes of the batch. After locking, all QR codes will no longer return traceability information after scanning, preventing abnormal agricultural products from continuing to circulate. At the same time, the management terminal will start batch verification to trace the source of the abnormality.
[0144] Step S904: Extract the abnormal geographical locations of all abnormal QR codes in the traceability batch, and determine whether the abnormal geographical locations are all located in the same unauthorized area.
[0145] Specifically, unauthorized areas refer to areas outside the coverage of preset authorized areas and preset logistics routes. Extract the abnormal geographical locations of all abnormal QR codes and determine whether these locations are concentrated in the same unauthorized area (such as an unauthorized market in the same city). This is used to distinguish the type of abnormality. If they are concentrated in the same unauthorized area, it is likely that they are cross-selling; if they are scattered in multiple unauthorized areas, it is likely that they are mass counterfeiting or other abnormalities.
[0146] Step S905: If all abnormal geographical locations are in the same unauthorized area, a cross-regional sales warning report is generated and pushed to the management terminal.
[0147] Specifically, if all abnormal geographical locations are concentrated in the same unauthorized area, it indicates that the batch of agricultural products has been involved in large-scale cross-regional sales (such as distributors transferring agricultural products to unauthorized sales areas). The system generates a cross-regional sales warning report, which includes traceability batch information, number of abnormal QR codes, abnormal geographical locations, cross-regional sales areas, etc., and pushes it to the management end to remind the management end to take timely measures (such as contacting distributors and recalling cross-regional products) to maintain market order.
[0148] Step S906: If the abnormal geographical locations are scattered across multiple unauthorized areas, generate a batch of abnormal alarms and push them to the management terminal.
[0149] Specifically, if abnormal geographical locations are scattered across multiple unauthorized areas, it indicates that the batch of agricultural products may be subject to large-scale counterfeiting (such as multiple counterfeit dens copying QR codes). The system will generate a batch abnormal alarm, and the alarm information will include traceability batch information, the number of abnormal QR codes, and the distribution of abnormal geographical locations. This information will be pushed to the management end to remind the management end to initiate an emergency investigation, crack down on counterfeiting, and prevent counterfeit agricultural products from entering the market.
[0150] Secondly, this application also discloses an anti-counterfeiting analysis system for agricultural products with a unique code for each item.
[0151] Reference Figure 2 A unique anti-counterfeiting analysis system for agricultural products, comprising: The traceability code hash module is used to obtain the unique traceability code corresponding to each agricultural product in the traceability batch, obtain the dynamic salt value bound to the traceability code, and calculate the first hash value by combining the traceability code and the dynamic salt value. The QR code generation module is used to generate QR codes from traceability codes and associate them with the traceability information of agricultural products; The scan data extraction module is used to extract the geographical location, scanning time and mobile device identifier when a mobile device scans a QR code, and combine the geographical location, scanning time and mobile device identifier into second anti-counterfeiting data. The second hash calculation module is used to obtain the dynamic salt value, and calculate the second hash value by combining the second anti-counterfeiting data with the dynamic salt value. The hash comparison module is used to determine whether the second hash value is consistent with the first hash value; If the second hash value matches the first hash value, the normal processing module stores the scan record in the database and returns the traceability information to the mobile device. If the second hash value is inconsistent with the first hash value, the three-factor comparison module is used to compare the geographical location in the second anti-counterfeiting data with the preset authorized area associated with the traceability code to obtain the location comparison result, compare the scanning time with the effective time window associated with the traceability code to obtain the time comparison result, and compare the mobile device identifier with the list of authorized devices associated with the traceability code to obtain the device comparison result. The response decision module is used to determine whether to return traceability information to the mobile terminal based on the combined status of location comparison results, time comparison results, and device comparison results.
[0152] The above are all preferred embodiments of this application, and are not intended to limit the scope of protection of this application. Therefore, all equivalent changes made in accordance with the structure, shape and principle of this application should be covered within the scope of protection of this application.
Claims
1. A method for anti-counterfeiting analysis of agricultural products with unique codes, characterized in that, include: Obtain the unique traceability code corresponding to each agricultural product in the traceability batch, obtain the dynamic salt value bound to the traceability code, and calculate the first hash value by combining the traceability code and the dynamic salt value; The traceability code is generated into a QR code and associated with the traceability information of the agricultural product; When a mobile device scans the QR code, the geographical location, scanning time, and mobile device identifier of the scanning time are extracted, and the geographical location, scanning time, and mobile device identifier are combined into the second anti-counterfeiting data. Obtain the dynamic salt value, and calculate the second hash value by combining the second anti-counterfeiting data with the dynamic salt value; Determine whether the second hash value is consistent with the first hash value; If the second hash value matches the first hash value, the scan record is stored in the database, and the tracing information is returned to the mobile device. If the second hash value is inconsistent with the first hash value, the geographical location in the second anti-counterfeiting data is compared with the preset authorized area associated with the traceability code to obtain the location comparison result. At the same time, the scanning time is compared with the valid time window associated with the traceability code to obtain the time comparison result. At the same time, the mobile device identifier is compared with the list of authorized devices associated with the traceability code to obtain the device comparison result. Based on the combined status of the location comparison result, the time comparison result, and the device comparison result, determine whether to return the traceability information to the mobile terminal.
2. The anti-counterfeiting analysis method for agricultural products with a unique code according to claim 1, characterized in that, After the statement that if the second hash value matches the first hash value, the method further includes: Obtain the cumulative number of scans of the traceability code before this scan, and determine whether the cumulative number of scans is zero; If the cumulative number of scans is zero, the geographical location at the time of the current scan is stored as the initial anchor point of the traceability code; If the cumulative number of scans is not zero, then calculate the offset distance between the geographical location at the time of the current scan and the initial anchor point location; Determine whether the offset distance exceeds a preset reasonable offset distance; If the offset distance does not exceed the preset reasonable offset distance, the scan record is stored normally. If the offset distance exceeds the preset reasonable offset distance, then obtain all historical offset records of the traceability code within the preset historical time period; Based on all the historical offset records, determine whether the geographical location change of the traceability code presents a continuous linear trajectory; If a continuous linear trajectory is observed, the current offset is marked as a normal migration, and the initial anchor point position is updated to the current position. If a continuous linear trajectory is not presented, the traceability code will be marked as a geographical anomaly, and the return of traceability information will be suspended until the management terminal manually cancels it.
3. The anti-counterfeiting analysis method for agricultural products with one code per item according to claim 2, characterized in that, After marking the traceability code as a geographic anomaly, the method further includes: Obtain the traceability batch identifier associated with the traceability code, and determine whether there are other associated traceability codes in the traceability batch that are also marked as geographical anomalies. If there are no other related source codes that are also marked as geographically anomalous, then only the current source code will be kept in a geographically anomalous state. If there are other related source codes that are also marked as geographic anomalies, then it is further determined whether the abnormal geographical locations of all the related source codes of geographic anomalies constitute a spatial clustered distribution. If a spatial cluster distribution is formed, it is determined that the traceability batch has a concentrated geographical anomaly, and batch locking is performed on all traceability codes in the traceability batch. If it does not constitute a spatial clustered distribution, it is judged as an individual geographical anomaly, and the geographical anomaly status is maintained only for the current tracing code.
4. The anti-counterfeiting analysis method for agricultural products with one code per item according to claim 1, characterized in that, After storing the scan records in the database and returning the traceability information to the mobile device, the process further includes: Extract all scan records of the same geographic location within a preset statistical period from the database, and count the number of different mobile device identifiers corresponding to the geographic location based on all scan records; Determine whether the number of different mobile device identifiers exceeds a preset popularity threshold; If the preset heat threshold is not exceeded, continue monitoring subsequent scan records; If the preset popularity threshold is exceeded, the geographical location will be marked as a consumer hotspot area; The agricultural product variety with the most scans within the aforementioned consumer hotspot area is identified, and this agricultural product variety is associated with the aforementioned consumer hotspot area. Determine whether the agricultural product variety is consistent with the historical preferred varieties in the aforementioned consumption hotspot areas; If there is a discrepancy, a variety preference migration report is generated and pushed to the manufacturer's management backend.
5. The anti-counterfeiting analysis method for agricultural products with one code per item according to claim 4, characterized in that, After generating the variety preference migration report and pushing the variety preference migration report to the manufacturer management backend, the process also includes: Receive the response instruction returned by the manufacturer's management backend, and determine the type of the response instruction; If the type of the response instruction is an inventory adjustment instruction, then the target variety and the target adjustment quantity are extracted from the response instruction, wherein the target variety is the currently preferred variety or the historically preferred variety; Based on the target variety, query the traceability batch information corresponding to the target variety, and extract the current remaining inventory from the traceability batch information; Determine whether the target adjustment quantity is less than or equal to the current remaining inventory quantity; If the target adjustment quantity is less than or equal to the current remaining inventory, then the inventory adjustment instruction is executed to transfer the products corresponding to the target adjustment quantity to the consumer hotspot area; If the target adjustment quantity is greater than the current remaining inventory, an insufficient inventory alarm is generated, and the insufficient inventory alarm, together with the current remaining inventory, is returned to the manufacturer's management backend. If the type of the response instruction is a marketing push instruction, then extract the push content template and the upper limit of the push frequency from the response instruction; Obtain the set of mobile device identifiers that have scanned the historical preferred products within the preset statistical period in the consumer hotspot area; Based on the upper limit of push frequency, the push content template is pushed to each mobile device in the set of mobile device identifiers, and the push content template contains a link to the traceability information of the currently preferred variety; Record the push time and target audience for each push, and associate the push time with the scan increment of the currently preferred product in the consumer hotspot area within a subsequent preset time period to generate a push effect evaluation report.
6. The anti-counterfeiting analysis method for agricultural products with one code per item according to claim 1, characterized in that, After stating that if the second hash value is inconsistent with the first hash value, the method further includes: The second anti-counterfeiting data is compared field by field with the original anti-counterfeiting data corresponding to the first hash value to identify the difference fields; Determine whether the difference field is only the scan time field; If only the scan time field is available, then obtain the direction of the deviation between the scan time and the effective time window; If the deviation direction is that the scanning time is earlier than the start time of the effective time window, and the deviation duration is less than the preset early tolerance duration, then traceability information is returned to the mobile terminal, and this scan is marked as an early scan. If the deviation direction is that the scan time is later than the end time of the valid time window, then the source information will not be returned; If the difference fields are not limited to the scan time field, then it is further determined whether the difference fields include the geographic location field; If the location field is included and the deviation value of the location field is less than the preset location tolerance deviation, the source information is returned to the mobile device, and this scan is marked as a location fine-tuning scan. If the QR code contains a geographic location field and the deviation value of the geographic location field is greater than or equal to the preset location tolerance deviation, then the source information will be refused and the QR code will be marked as having an abnormal location.
7. The anti-counterfeiting analysis method for agricultural products with one code per item according to claim 1, characterized in that, The step of determining whether to return the tracing information to the mobile terminal based on the combined state of the location comparison result, the time comparison result, and the device comparison result includes: If the location comparison result is that the geographical location is within the preset authorized area, the time comparison result is that the scanning time is within the effective time window, and the device comparison result is that the mobile device identifier is within the authorized device list, then the traceability information is returned to the mobile device. If the location comparison result is that the geographical location is within the preset authorized area, the time comparison result is that the scanning time is within the effective time window, but the device comparison result is that the mobile device identifier is not in the authorized device list, then a simplified version of the traceability information is returned to the mobile device, and the mobile device identifier is added to the list to be reviewed. If the location comparison result indicates that the geographical location is within the preset authorized area, but the time comparison result indicates that the scanning time is earlier than the start time of the effective time window, then the source tracing information is returned to the mobile terminal, and this scan is marked as an early scan record; If the location comparison result indicates that the geographical location is within the preset authorized area, but the time comparison result indicates that the scanning time is later than the end time of the valid time window, then the traceability information will be refused and the QR code will be marked as expired. If the location comparison result is that the geographical location is not located within the preset authorized area, and the time comparison result is that the scanning time is within the effective time window, then it is further determined whether the geographical location is within the radiation range of the preset logistics path associated with the traceability code; If the geographical location is within the coverage area of the preset logistics route, the traceability information is returned to the mobile terminal, and this scan is marked as a scan during logistics. If the geographical location is not within the coverage area of the preset logistics route, the traceability information will be refused and the QR code will be marked as having an abnormal location.
8. The anti-counterfeiting analysis method for agricultural products with one code per item according to claim 7, characterized in that, After adding the mobile device identifier to the list of devices awaiting review, the process further includes: Obtain the cumulative number of times the mobile device identifier appears in the list to be reviewed, and determine whether the cumulative number of appearances exceeds the preset number of times to be reviewed; If the cumulative number of occurrences does not exceed the preset review tolerance number, then the mobile device identifier remains in the list of devices to be reviewed; If the cumulative number of occurrences exceeds the preset tolerance limit, the mobile device identifier will be moved to the preset malicious device blacklist. After the mobile device identifier is added to the preset malicious device blacklist, when a scanning request initiated by the mobile device identifier is received again, the source tracing information is directly rejected and the hash value comparison step is no longer executed. Every preset unblocking period, the mobile device identifier is removed from the preset malicious device blacklist, and the cumulative occurrence count is reset.
9. The anti-counterfeiting analysis method for agricultural products with one code per item according to claim 7, characterized in that, After marking the QR code as having an abnormal location, the method further includes: Obtain the number of all QR codes marked as having abnormal locations in the traceability batch associated with the QR code, and determine whether the proportion of the number to the total number of QR codes in the traceability batch exceeds a preset batch abnormality proportion. If the ratio does not exceed the preset batch abnormal ratio, then only the current QR code's position abnormal state is maintained; If the ratio exceeds the preset batch abnormal ratio, then batch locking is performed on all QR codes in the traceability batch that are in a normal state, and the return of traceability information is prohibited. Extract the abnormal geographical locations of all abnormal QR codes in the traceability batch, and determine whether the abnormal geographical locations are all located in the same unauthorized area; If all the abnormal geographical locations are located in the same unauthorized area, a cross-selling warning report will be generated and pushed to the management terminal; If the abnormal geographical locations are scattered across multiple unauthorized areas, a batch of abnormal alarms will be generated and pushed to the management terminal.
10. A unique anti-counterfeiting analysis system for agricultural products, characterized in that, For performing the method according to any one of claims 1 to 9, comprising: The traceability code hash module is used to obtain the unique traceability code corresponding to each agricultural product in the traceability batch, obtain the dynamic salt value bound to the traceability code, and calculate the first hash value by combining the traceability code and the dynamic salt value. A QR code generation module is used to generate a QR code from the traceability code and associate it with the traceability information of the agricultural product; The scanning data extraction module is used to extract the geographical location, scanning time and mobile device identifier at the scanning time when the mobile device scans the QR code, and combine the geographical location, scanning time and mobile device identifier into second anti-counterfeiting data; The second hash calculation module is used to obtain the dynamic salt value, and calculate the second hash value by combining the second anti-counterfeiting data with the dynamic salt value. The hash comparison module is used to determine whether the second hash value is consistent with the first hash value; If the second hash value matches the first hash value, the normal processing module stores the scan record in the database and returns the tracing information to the mobile terminal. If the second hash value is inconsistent with the first hash value, the three-factor comparison module is used to compare the geographical location in the second anti-counterfeiting data with the preset authorized area associated with the traceability code to obtain the location comparison result, compare the scanning time with the effective time window associated with the traceability code to obtain the time comparison result, and compare the mobile device identifier with the list of authorized devices associated with the traceability code to obtain the device comparison result. The response decision module is used to determine whether to return the traceability information to the mobile terminal based on the combined status of the location comparison result, the time comparison result, and the device comparison result.
