OCR-based receipt auditing method and system, medium and product
By using an OCR-based receipt verification method, combined with product knowledge graphs and tamper detection, the reliability issues caused by the diversification of product descriptions and coding changes in receipt verification are resolved. This enables accurate identification of product information and effective analysis of cross-regional circulation risks.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-15
- Publication Date
- 2026-03-27
AI Technical Summary
Existing receipt verification systems struggle to accurately match and verify product information when faced with complex situations such as personalized descriptions of similar products and name changes for products circulating across regions, leading to reduced verification reliability.
The method uses OCR to acquire receipt image data, performs optical character recognition, extracts key text information, and conducts cross-regional circulation risk analysis through a pre-set commodity knowledge graph. Combined with tampering detection, behavioral feature fingerprints are constructed to conduct cross-regional circulation risk analysis and audit strategies.
It improves the accuracy and reliability of receipt verification, enabling it to accurately identify product information and detect counterfeiting or tampering when faced with diversified product descriptions and changes in regional codes, thereby enhancing the ability to identify risks associated with cross-regional circulation.
Smart Images

Figure CN121747144A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of OCR technology, specifically to an OCR-based receipt verification method, system, medium, and product. Background Technology
[0002] With the rapid development of e-commerce and new retail, shopping malls and retail businesses have launched various marketing activities such as membership points and cashback programs. Consumers need to submit shopping receipts to participate in these activities, while businesses need to verify the authenticity of a large number of receipts.
[0003] In existing technologies, receipt verification systems use OCR (Optical Character Recognition) technology to recognize textual information on receipts, then match the recognized product information with a pre-set product database; finally, the authenticity of the receipt is determined based on the matching results. Product information is highly diverse, including local specialty product names, personalized descriptions of similar products by different merchants, and complex situations such as coding or name changes for products circulating across regions. This makes it difficult for a single product database to comprehensively and accurately match and standardize the information, reducing the reliability of receipt verification. Summary of the Invention
[0004] This application provides an OCR-based receipt verification method, system, medium, and product to solve the receipt verification problem in complex situations such as personalized descriptions of similar products and changes in codes or names of products circulating across regions, thereby improving the reliability of receipt verification.
[0005] The first aspect of this application provides an OCR-based receipt verification method, which includes: Obtain the image data of the receipt to be reviewed; Optical character recognition is performed on the receipt image data to obtain key text information of the receipt image data, including basic transaction information and product details information; The commodity circulation feature data of the receipt image data is extracted from the key text information. Based on the preset commodity knowledge graph and the commodity circulation feature data, cross-regional circulation risk analysis is performed on the commodity details information to obtain the cross-regional circulation risk analysis results. The receipt image data is subjected to tampering detection to obtain a tampering suspicion score; Based on the cross-regional circulation risk analysis results and the tampering suspicion score, a behavioral feature fingerprint of the receipt image data is constructed. Obtain historical behavioral feature fingerprints within a preset historical time period, compare and analyze the behavioral feature fingerprints with the historical behavioral feature fingerprints, and obtain the comparison and analysis results; The review strategy for the receipt to be reviewed is determined based on the comparative analysis results.
[0006] Optionally, the commodity circulation characteristic data includes commodity code mapping relationships, name terminology correspondence relationships, and cross-regional settlement rules. The commodity circulation characteristic data extracted from the receipt image data from the key text information specifically includes: Extract cross-regional joint venture product records from the product details information, and extract merchant identification information and regional attribute information corresponding to the cross-regional joint venture product records from the basic transaction information; Based on the merchant identification information, identify the product barcode format in the product details information to determine whether there is a regional product code change; If there is a regional product code change, then obtain the product code mapping relationship of the product with the changed code in different regions. Extract the local characteristic description information of the product with the changed code from the product details information; The correspondence between the names and terms is determined based on the local characteristic description information and the regional attribute information. Identify regional price difference markers from the product details information and obtain the cross-regional settlement rules corresponding to the regional price difference markers; The commodity circulation characteristic data is obtained based on the commodity code mapping relationship, the name term correspondence relationship, and the cross-regional settlement rules.
[0007] Optionally, determining the correspondence between the names and terms based on the local characteristic description information and the regional attribute information specifically includes: The dialect expression degree of the local characteristic description information is calculated, and the dialect expression degree is used to characterize the degree of dialect expression in the local characteristic description information; Based on the regional attribute information, a name terminology correspondence is established between the target local characteristic description information and the standard product name corresponding to the target local characteristic description information. The target local characteristic description information is the local characteristic description information with a dialect expression degree greater than a preset dialect threshold.
[0008] Optionally, based on a preset product knowledge graph and the product circulation characteristic data, a cross-regional circulation risk analysis is performed on the product details information to obtain cross-regional circulation risk analysis results, specifically including: The system detects whether there are any cross-regional sales records for limited-time promotional items in the product details information. When the cross-regional cross-selling record exists, the regional promotion rules of the limited-time promotional product corresponding to the cross-regional cross-selling record are obtained from the preset product knowledge graph; Based on the product code mapping relationship, identify the product code change relationship between the original region and the target region corresponding to the cross-regional sales record of the limited-time promotional product; The actual transaction price of the limited-time promotional product is determined based on the aforementioned name terminology correspondence and the aforementioned cross-regional settlement rules. When the actual transaction price is greater than the price deviation rate in the regional promotion rules, and the product code change relationship meets the preset change conditions, the cross-regional circulation risk analysis result is obtained based on the preset product knowledge graph.
[0009] Optionally, the actual transaction price of the limited-time promotional item is determined based on the name terminology correspondence and the cross-regional settlement rules, specifically including: Extract the first promotional description feature of the limited-time promotional product in the original region and the second promotional description feature in the target region from the name term correspondence; A semantic comparison analysis is performed on the first promotional description feature and the second promotional description feature to obtain the semantic comparison analysis results. The actual transaction price of the limited-time promotional product is determined based on the semantic comparison analysis results and the cross-regional settlement rules.
[0010] Optionally, the cross-regional circulation risk analysis results are obtained based on the preset commodity knowledge graph, specifically including: Extract the historical circulation characteristics of the limited-time promotional products from the preset product knowledge graph; Based on the historical circulation characteristics, a suspicious circulation path for the limited-time promotional goods is constructed, and the suspicious circulation path includes the regional flow sequence of the limited-time promotional goods between the original region and the target region; Obtain a preset high-risk circulation model library from the preset commodity knowledge graph; Calculate the matching degree between the suspicious circulation path and each risk pattern in the preset high-risk circulation pattern library, and determine the risk level of the suspicious circulation path based on the risk patterns whose matching degree is greater than a preset matching threshold; Based on the risk level and the regional circulation sequence, the results of the cross-regional circulation risk analysis are obtained.
[0011] Optionally, the receipt image data is subjected to tampering detection to obtain a tampering suspicion score, specifically including: Perform pixel anomaly detection on the receipt image data to identify image splicing traces; Extract the text region from the receipt image data, perform font consistency detection on the text region, and obtain the font detection result; Analyze the EXIF information in the receipt image data to identify edited records; Based on the image splicing traces, the font detection results, and the editing records, a tampering suspicion score for the receipt image data is calculated.
[0012] Secondly, embodiments of this application provide an OCR-based receipt verification system, which includes one or more processors and a memory; the memory is coupled to the one or more processors and is used to store computer program code, which includes computer instructions, and the one or more processors call the computer instructions to cause the OCR-based receipt verification system to perform the method described in the first aspect and any possible implementation thereof.
[0013] Thirdly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on an OCR-based receipt verification system, cause the OCR-based receipt verification system to perform the method described in the first aspect and any possible implementation thereof.
[0014] Fourthly, embodiments of this application provide a computer program product containing instructions that, when the computer program product is run on an OCR-based receipt verification system, cause the OCR-based receipt verification system to execute the method described in the first aspect and any possible implementation thereof.
[0015] In summary, one or more technical solutions provided in this application have at least the following technical effects or advantages: 1. By integrating multiple technologies such as optical character recognition, commodity knowledge graph modeling, commodity circulation feature analysis, image tampering detection, and behavioral feature fingerprint comparison, an OCR-based receipt verification method was constructed. Therefore, during the receipt verification process, it can not only acquire key text information from the receipt image data and extract commodity circulation feature data including transaction time, location, product name, and price, but also perform semantic standardization and structural mapping of commodity details using a pre-set commodity knowledge graph. This enables dynamic assessment of the risks of cross-regional commodity circulation, effectively identifying counterfeit or tampered receipt information. Simultaneously, by detecting tampering traces in the receipt image data and quantifying image-level editing behavior, a behavioral feature fingerprint of the receipt is comprehensively constructed based on the cross-regional circulation risk analysis results. This fingerprint is then compared with known behavioral feature fingerprints of receipts from historical time periods, comprehensively identifying potential counterfeiting, tampering, or abnormal behavior patterns from both temporal and behavioral pattern dimensions. By integrating and analyzing multi-source information and modeling features in multiple dimensions, this technology effectively overcomes the problem of insufficient recognition capabilities caused by relying solely on static matching of product databases in existing technologies. In particular, it improves the accuracy of receipt verification by addressing issues such as diversified product descriptions, non-standardized naming, and ambiguities in the context of cross-regional product circulation.
[0016] 2. By introducing multi-dimensional commodity circulation characteristic data, such as commodity code mapping relationships, name terminology correspondence relationships, and cross-regional settlement rules, and by structurally extracting key factors from critical text information, including cross-regional joint operation commodity records, merchant identification information, regional attribute information, local characteristic description information, and regional price difference markers, a full-link semantic association of commodity coding, description, and settlement rules in different circulation regions is constructed. This effectively solves the problem of inaccurate commodity identification caused by inconsistent commodity descriptions, regional coding changes, and differences in local terminology in existing receipt verification technologies. In particular, by recognizing commodity barcode formats and judging regional coding changes, the commodity code mapping relationship between different regions is further obtained. Combined with local characteristic description information and regional attribute information, the expressiveness of dialect terms is calculated, thereby achieving semantic alignment between local commodity descriptions and standard commodity names, and constructing accurate name terminology correspondence relationships. Furthermore, supplemented by cross-regional settlement rules indicated by regional price difference markers, the true circulation path and pricing mechanism of commodities in various regions are fully restored. The fusion modeling of the aforementioned commodity circulation characteristic data significantly improves the semantic restoration capability of commodity details in receipts. This enables the system to accurately identify the commodity itself and its circulation background even in real business scenarios with rich local terminology, non-standardized commodity descriptions, and complex regional joint ventures, thereby enhancing the accuracy and robustness of subsequent cross-regional circulation risk analysis.
[0017] 3. By detecting whether there are cross-regional sales records for limited-time promotional items in the product details information, and combining this with the corresponding regional promotional rules in the product knowledge graph, the system can locate the sales permissions and price restrictions of the product between the original and target regions. Simultaneously, based on the product code mapping relationship, it identifies the code changes of the product in different regions, and combines the correspondence of name terms with cross-regional settlement rules to further deduce the actual transaction price of the product. Especially when the actual transaction price exceeds the price deviation rate allowed in the regional promotional rules, and the product code change relationship meets the preset cross-regional sales judgment conditions, the system can infer from the product knowledge graph that the product has a risk of illegal cross-regional circulation, thus generating a cross-regional circulation risk analysis result. This constructs an interpretable and traceable cross-regional circulation risk analysis system, effectively solving the problem of difficulty in identifying cross-regional sales behavior caused by complex promotional rules, highly subjective product descriptions, and inconsistent price difference judgment standards in existing technologies.
[0018] 4. By performing semantic comparative analysis on the differences in descriptions of limited-time promotional products between the original and target regions, and extracting the degree of semantic shift between the first and second promotional description features, the system can determine whether there are any instances of deliberate modification or inconsistencies in the product's promotional labeling at the linguistic level. Furthermore, by quantifying discount conversion relationships in conjunction with cross-regional settlement rules, the system can accurately determine the actual transaction price. This mechanism not only improves the accuracy of identifying cross-regional sales behavior but also enhances the system's dynamic analysis capabilities regarding the circulation paths of promotional products across multiple regions and contexts. Attached Figure Description
[0019] Figure 1 This is a flowchart illustrating an OCR-based receipt verification method in an embodiment of this application. Figure 2 This is a flowchart illustrating the cross-regional circulation risk analysis in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of the electronic device in the embodiments of this application.
[0020] Explanation of reference numerals in the attached drawings: 301, Central Processing Unit; 302, Read-Only Memory; 303, Random Access Memory; 304, Bus; 305, Input / Output Interface; 306, Input Section; 307, Output Section; 308, Storage Section; 309, Communication Section; 310, Driver; 311, Removable Media. Detailed Implementation
[0021] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.
[0022] In the description of the embodiments of this application, the words "for example" or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design that is described as "for example" or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design options. Rather, the use of the words "for example" or "for instance" is intended to present the relevant concepts in a specific manner.
[0023] In the description of the embodiments of this application, the term "multiple" means two or more. For example, multiple systems means two or more systems, and multiple screen terminals means two or more screen terminals. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the indicated technical features. Thus, a feature defined with "first" or "second" may explicitly or implicitly include one or more of that feature. The terms "comprising," "including," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0024] Figure 1 This is a flowchart illustrating an OCR-based receipt verification method in an embodiment of this application.
[0025] Please see Figure 1 This application provides an OCR-based receipt verification method, which includes: S101. Obtain the image data of the receipt to be reviewed; In this embodiment, the goal of S101 is to provide raw image input for subsequent optical character recognition and risk analysis, therefore, it is necessary to acquire the receipt image data of the receipt to be reviewed. Receipt image data refers to a digital image containing the content of a paper transaction document, acquired through an image acquisition device. Common image acquisition devices include mobile terminal cameras, barcode scanners, and flatbed scanners, which can convert physical receipts into digital image files, commonly in JPEG, PNG, or TIFF formats.
[0026] In practical applications, users upload images of paper receipts via mobile applications or embedded terminal devices. For example, after checking out at a supermarket, a user uses the merchant's app to photograph their paper receipt, and the image is automatically uploaded to the server via the app. During the image acquisition phase, to ensure subsequent recognition accuracy, the system calls an image quality detection module to determine if the image has issues such as blurriness, uneven exposure, or tilt. This module uses image sharpness assessment algorithms, such as edge sharpness determination methods based on Laplacian transform, to calculate the image edge strength. When the image blurriness exceeds a set threshold, the system prompts the user to retake the photo.
[0027] After image acquisition, the system performs preliminary preprocessing operations, including grayscale conversion, denoising, rotation correction, and edge cropping. Rotation correction uses a tilt angle detection method based on Hough transform to automatically identify the main direction of text lines in the image and corrects it to a horizontal state through affine transformation. Edge cropping utilizes an adaptive edge detection algorithm to extract the ticket boundaries from the image, removing redundant background areas so that subsequent character recognition focuses on the effective content area, improving the efficiency and accuracy of subsequent recognition.
[0028] Through the above process, the system successfully acquired clear and complete receipt image data, providing basic data support for subsequent steps such as optical character recognition, product information extraction, risk analysis, and behavior modeling.
[0029] S102. Perform optical character recognition on the receipt image data to obtain key text information of the receipt image data, the key text information including basic transaction information and product detail information; Step S102 involves converting the receipt content presented in image form into structured text information for subsequent processing such as commodity circulation feature extraction and cross-regional circulation risk analysis. To this end, optical character recognition (OCR) processing is required on the acquired receipt image data to extract the key text information contained therein. The key text information mainly includes two categories: basic transaction information and commodity details. Basic transaction information refers to structured elements related to the transaction, such as merchant name, transaction time, transaction amount, and POS machine number; while commodity details refer to the specific items listed in this transaction, including commodity name, commodity code, quantity, unit price, and subtotal amount.
[0030] In the specific implementation process, the receipt image data is first subjected to OCR preprocessing to optimize image quality and improve recognition accuracy. Preprocessing operations include image binarization, noise removal, contrast enhancement, and layout structure analysis. Image binarization converts the image to black and white using a fixed or adaptive threshold to enhance the contrast between characters and the background. Noise removal employs median filtering or Gaussian filtering to eliminate spots or shadows that may occur during scanning. Layout structure analysis, based on projection analysis or connected component analysis algorithms, identifies the distribution structure of characters, tables, and lines in the image, providing a foundation for subsequent text line segmentation and field location.
[0031] After image preprocessing, the system calls the OCR engine to recognize character regions in the image. The OCR engine employs a recognition architecture based on deep convolutional neural networks (CNNs) and sequence modeling networks (such as BiLSTM+CTC), enabling accurate recognition of receipt characters in various fonts and layouts. The character recognition process first extracts feature maps of character regions through image convolution, then uses recurrent neural networks to model the contextual relationships of character sequences, and finally outputs the character sequence through the CTC decoding algorithm to form the original text information.
[0032] After obtaining the raw text information, the system further performs structured parsing to extract the required key text information. This parsing process combines regular expressions, location labeling models, and entity recognition technology. The extraction of basic transaction information relies on keyword matching and layout location rules; for example, fields such as "checkout time" and "merchant number" are usually located at the top of the receipt. Product details are extracted by detecting the table structure of the product list area, combining column alignment features and price features to parse each row and identify fields such as product name, quantity, and unit price.
[0033] Through the above OCR recognition and structured parsing operations, the system can accurately extract key text information from receipt image data, laying a solid data foundation for subsequent commodity circulation feature extraction and risk modeling.
[0034] S103. Extract commodity circulation feature data from the key text information of the receipt image data; In this embodiment, step S103 aims to further extract deep structured data related to commodity circulation behavior based on the key text information obtained from OCR recognition. This data is used to characterize the coding changes, naming differences, and pricing strategy differences that may be involved when commodities circulate between different regions and different merchants, thereby providing support for subsequent cross-regional circulation risk analysis. To achieve this goal, the system needs to extract data elements that reflect the commodity circulation path and regional attributes from commodity details and basic transaction information, and combine them with information such as the coding mapping relationship, name differences, and price markings in cross-regional joint ventures and settlement processes to construct complete commodity circulation characteristic data. Specifically, this may include the following steps: extracting cross-regional joint venture product records from the product details information, and extracting merchant identification information and regional attribute information corresponding to the cross-regional joint venture product records from the basic transaction information; based on the merchant identification information, identifying the product barcode format in the product details information, and determining whether there is a regional product code change; if there is a regional product code change, obtaining the product code mapping relationship of the product with the changed code in different regions; extracting local characteristic description information of the product with the changed code from the product details information; determining the name terminology correspondence based on the local characteristic description information and the regional attribute information; identifying regional price difference markers from the product details information, and obtaining the cross-regional settlement rules corresponding to the regional price difference markers; obtaining the product circulation characteristic data based on the product code mapping relationship, the name terminology correspondence relationship, and the cross-regional settlement rules.
[0035] In this embodiment, to achieve in-depth analysis of the commodity circulation path, it is necessary to extract commodity records with cross-regional circulation characteristics from the commodity details information obtained by OCR recognition, namely, cross-regional joint operation commodity records. Cross-regional joint operation commodities refer to commodities jointly operated, settled, or transferred by different merchants in two or more regions. These commodities typically exhibit certain patterns in their appearance on sales receipts, such as cross-regional identifiers or supply chain markings in the commodity name, or regional affiliation characteristics reflected in the commodity coding structure. The system constructs a rule base based on commodity name keywords and barcode prefixes to match commodity detail fields and identify commodity items that may belong to cross-regional joint operations. Simultaneously, the system also needs to extract merchant identification information and regional attribute information corresponding to these commodity records from basic transaction information. Merchant identification information typically includes fields such as merchant number and store code, used to uniquely identify the merchant entity involved in the transaction; regional attribute information includes geographic area codes or business area labels, used to determine the region where the merchant is located. Through field mapping between commodity records and basic transaction information, the system completes the association modeling of cross-regional joint operation commodities and their transaction background. For example, if a product item is "Guangdong-Hong Kong Joint Supply - Fresh Milk", the system can identify the "Guangdong-Hong Kong Joint Supply" field and combine it with the merchant number's location being "Shenzhen" to mark the product information as a cross-regional joint operation record.
[0036] After acquiring information on cross-regional joint-operation goods and their transaction background, the system further analyzes the barcode encoding structure using merchant identification information. Barcode formats may vary across different regions or merchant systems, especially in cross-regional transfers or independent coding management systems, where barcode prefixes, number of digits, or rules may differ. The system constructs a barcode rule recognition model to compare the differences between the merchant's barcode system and the standard product coding system to determine if there are regional product coding changes. This model supports recognition based on barcode length, the meaning of coding segments, and the mapping relationship between prefixes and regions. For example, if a merchant's barcode prefix "88" represents "East China" in the standard system, but the current merchant is a "South China" merchant, it can be preliminarily determined that the product has undergone a regional coding change.
[0037] Once a product with a regional product code change is identified, the system needs to further obtain the mapping relationship between the codes used for that product in different regions. The product code mapping relationship refers to the corresponding information between different product codes for the same physical product in multiple regions or systems. This mapping relationship can be provided by a product knowledge graph or established through historical transaction data, product master data centers, etc. The system calls the product code mapping service interface, inputs the original product code and its region, and obtains its corresponding product codes in other regions, achieving unified identification of product codes across regions. For example, a product might be coded "880123456789" in the "South China Region" and marked as "990987654321" in the "North China Region." The system establishes a one-to-one correspondence through a mapping table to ensure that it can be identified as the same product during subsequent risk analysis.
[0038] Based on obtaining the coding mapping relationship, the system also needs to extract local characteristic description information of the coded products from the product details information. Local characteristic description information refers to the expressions reflecting regional characteristics in the product name or description, usually manifested as place names, dialect words, place of origin markings, or regionally specific terms. This type of information is key data for identifying differences in product naming and regional naming habits. The system uses natural language processing methods to segment product names and combines geographical dictionaries and semantic rules to identify the regional descriptions within them. For example, "Yangjiang" in "Yangjiang-style sausage" is local characteristic description information. Based on this, the system can determine that the product has regional characteristics and further participate in the reasoning and construction of the correspondence between name terms. By extracting this descriptive information, the system can not only enhance the regional identification ability of products but also improve the accuracy of subsequent semantic standardization of product names.
[0039] In order to achieve the unified expression and semantic alignment of cross-regional commodity information, it is necessary to determine the corresponding relationship of name terms based on local characteristic description information and regional attribute information. The corresponding relationship of name terms refers to the inconsistent expressions caused by language habits, cultural differences or local cognitions in commodity naming in different regions. For example, "cured meats" may be expressed as "sausages" in the south, while in the north it may be called "air-dried sausages". The local characteristic description information reflects the regional language characteristics contained in commodity naming, while the regional attribute information is used to define the language environment and cultural background in which the expression appears. In order to accurately establish this corresponding relationship, the system not only needs to identify the specific content of the local expression, but also needs to further judge whether the expression belongs to the dialect terms with significant regional characteristics, so as to avoid misjudging the general description as a local expression. Therefore, it is necessary to analyze the expression intensity at the semantic level of the local characteristic description information, quantify its dialect expression degree, and on the premise that the dialect expression degree exceeds the preset threshold, identify it as the target local characteristic description information, and then combine the regional attribute where the information is located to find its corresponding standard commodity name in the commodity knowledge graph or local naming corpus, so as to establish the corresponding relationship of name terms. Specifically, it can include the following steps: calculating the dialect expression degree of the local characteristic description information, which is used to characterize the degree of dialect expression in the local characteristic description information; establishing the corresponding relationship of name terms between the target local characteristic description information and the standard commodity name corresponding to the target local characteristic description information based on the regional attribute information, where the target local characteristic description information is the local characteristic description information with the dialect expression degree greater than the preset dialect threshold.
[0040] Dialectal expressiveness is an indicator used to quantify the strength of dialect features contained in local characteristic descriptions. Its value represents the degree of regional deviation in language expression of the description compared to the standard generic product name, i.e., the degree of dialectal expression. The system constructs a dialect dictionary database containing multi-regional dialect vocabulary and expression habits, and analyzes the description text using a semantic embedding model to identify whether it contains words, word order, or semantic expressions unique to a specific region. A higher dialectal expressiveness indicates a greater deviation from standard language in terms of linguistic structure and a more pronounced regional character, thus making standardization mapping through name terminology correspondence more likely. This indicator plays a role in determining whether dialect standardization processing is necessary during name matching and is a prerequisite for establishing the relationship between local terms and standard product names. The dialect dictionary database records common dialect words from various regions and their frequency of use in product naming. The system segments local characteristic descriptions into words and uses a TF-IDF (Term Frequency-Inverse Document Frequency) mechanism combined with a regional dialect dictionary to weight and score terms, calculating the local language weight of each word. This weighted average of the overall descriptions yields the degree of dialectal expression. A higher expression score indicates a greater and more typical use of dialectal vocabulary in the description. For example, if a product name is "Chaoshan Pig Trotter Ring," and the system identifies "pig trotter ring" as a dialect term with extremely high frequency in the Chaoshan region but almost never used in other regions, then its expression score will be rated as high.
[0041] When the dialectal expressiveness of a local characteristic description exceeds the system's preset dialect threshold, the system marks the description as "target local characteristic description" and initiates the name-term correspondence construction phase. The preset dialect threshold is an empirical threshold derived from training corpora and manually annotated semantic samples, typically set as the boundary value that distinguishes between general product descriptions and significant regional descriptions. During the name-term correspondence construction process, the system uses regional attribute information as context, searches for established standard product name mapping records in regional product naming habit databases or product knowledge graphs, and uses semantic similarity calculations and hierarchical concept matching algorithms to find standard product names semantically consistent with the "target local characteristic description." For example, in a context of "Guangdong Chaoshan," the system identifies "pig's feet ring" as the target local characteristic description, with an expressiveness greater than the threshold of 0.75. Combining this with a local knowledge graph query, the system finds that the standardized name corresponding to this product in national standard naming is "braised pork products," thus establishing a name-term correspondence between "pig's feet ring" and "braised pork products."
[0042] Through the above steps, the system can not only standardize product names with obvious local language characteristics, but also achieve semantic alignment in cross-regional product information comparison, price analysis, and risk identification, avoiding misidentification or omission due to differences in expression, and greatly improving the accuracy and robustness of the receipt verification system in understanding product information.
[0043] To further construct complete commodity circulation characteristic data, the system needs to identify regional price difference markers from commodity details and obtain the corresponding cross-regional settlement rules. Regional price difference markers refer to specific semantic clues or identifiers in commodity sales data that reflect differences in pricing strategies between different regions. These may manifest as price level hints in the commodity name, price source information in the detailed remarks, or price classification fields implicit in the commodity code. For example, phrases such as "East China Price," "Unified Price for Cities," and "Special Price for Joint Supply" are common regional price difference markers. The system constructs a regional price marker dictionary and semantic rule model, performs keyword matching and contextual semantic analysis on the commodity details extracted by OCR, identifies commodity entries that may have price strategy differences, and further determines whether the price marker has cross-regional applicability.
[0044] After identifying the price difference marker, the system needs to obtain the corresponding cross-regional settlement rules. Cross-regional settlement rules refer to the business rules used to guide the pricing and settlement methods adopted by merchants in different regions during the allocation, sale, or joint operation of goods. These rules are usually set by merchant groups, business alliances, or regional supply and sales platforms. These rules may stipulate that a certain type of product adopts a unified purchase price, floating retail price, tiered subsidies, or cross-regional rebates within a specific region. The system queries and obtains the applicable cross-regional settlement rules for a product based on its region, merchant type, and price marker type, using the rule system established in the merchant backend management interface or the product knowledge graph. For example, if the product details show a "joint supply special price" marker, combined with the merchant region being "Southwest Region," the system can match the settlement rule corresponding to this marker as "settlement based on the headquarters' agreed price, with the regional platform bearing the price difference for any excess."
[0045] By combining the product code mapping relationship, the name terminology correspondence relationship, and the cross-regional settlement rules obtained above, the system ultimately generates product circulation characteristic data. The product code mapping relationship solves the problem of differences in codes for the same product in different regions, the name terminology correspondence relationship achieves semantic consistency in product description, and the cross-regional settlement rules reveal the dynamic characteristics of price and settlement during the circulation process. The system integrates these three types of information through a rule engine to form a structured data model, which is used to describe the circulation attributes and behavioral characteristics of a product in different regions, different merchants, or different scenarios. For example, for a product record "Guangdong Joint Supply - Yangjiang Pig Trotter Ring (Joint Supply Special Price)", its product code is "8801A" in South China and "9901X" in North China. The name corresponds to "Braised Pork Products", and the price is marked as "Joint Supply Special Price". The system uniformly models its product circulation characteristic data as: code mapping (8801A↔9901X), name semantic uniformity (Yangjiang Pig Trotter Ring↔Braised Pork Products), and settlement rules (headquarters agreement price + regional subsidy), which serve as an important input basis for subsequent risk analysis and behavior modeling.
[0046] Through the above processing, the system successfully constructed commodity circulation characteristic data covering coding, naming and settlement dimensions, providing a solid data foundation and semantic support for realizing intelligent identification and compliance assessment of cross-regional sales activities.
[0047] S104. Based on the preset commodity knowledge graph and the commodity circulation characteristic data, perform cross-regional circulation risk analysis on the commodity details information to obtain the cross-regional circulation risk analysis results. Figure 2 This is a flowchart illustrating the cross-regional circulation risk analysis in this application embodiment. The following is a summary of the process. Figure 2 A detailed explanation of step S104 is provided below: S1041. Detect whether there are cross-regional sales records of limited-time promotional products in the product details information; Limited-time promotional items refer to products with discounted prices or subsidies set for specific regions and time periods. These products typically have exclusive promotional rules set by headquarters or regional branches, with strict restrictions on pricing, sales channels, and target consumer groups. Cross-regional sales records refer to the act of deliberately transferring products originally intended for sale in a specific promotional region to non-promotional regions. This behavior can lead to price system disruptions, invalidation of regional policies, and even tax and compliance risks. Therefore, timely identification of potential cross-regional sales activities in product details is a crucial step in improving the intelligence level of receipt verification.
[0048] To accurately detect cross-regional sales records of limited-time promotional items, the system first needs to perform structured parsing of product details based on OCR recognition results, extracting data fields such as product name, product code, sales price, promotional tag, merchant ID, and regional attributes for each product entry. Promotional tags can be identified by including keywords such as "limited-time promotion," "special offer," or "special price" in the product name, or by matching and verifying the product code against the promotional catalog configured in the merchant's backend. The system constructs a limited-time promotional product identification model, employing a combination of rule-based and semantic models to determine whether each product in the detailed product list falls within the scope of a limited-time promotion.
[0049] After identifying products falling within the scope of a limited-time promotion, the system further compares the product's sales region with the preset promotional region. The regional consistency judgment is based on the regional attribute bound to the merchant ID, compared with the "applicable region" field registered in the knowledge graph for the promotional product. If the sales location is not within the promotional restricted region, it is preliminarily determined that cross-regional sales have occurred. To exclude temporary transfers or legitimate transfers authorized by headquarters, the system also introduces a cross-verification mechanism between the sales time window and transfer records. This verifies whether the product's sales time is within the promotion's validity period and whether auxiliary information such as headquarters transfer order numbers exists, ensuring the accuracy of cross-regional sales judgment.
[0050] For example, if a product listing shows a item with the name "Southwest Special Offer - Brand Beverage," product code "X123456," and the merchant ID corresponding to the "North China Region," the system identifies that this product belongs to the "Southwest Special Offer" section of the limited-time promotion catalog, and the sales period is within the promotion's validity period. However, the merchant's region is not applicable, and there are no transfer records or headquarters authorization information. Therefore, it can be confirmed that this product is involved in cross-regional sales. In this case, the system marks this record as potentially involved in cross-regional sales, providing input for subsequent risk analysis steps.
[0051] Through the aforementioned detection process, the system can accurately identify cross-regional sales activities that may violate regional promotional policies within the product details, effectively enhancing its ability to detect cross-regional distribution risks and laying a data foundation for subsequent in-depth analysis combining price deviations and coding changes. This detection mechanism, based on a combination of structured recognition and semantic judgment, not only improves the accuracy of cross-regional sales identification but also enhances the ability to model complex distribution behaviors, ultimately providing crucial support for intelligent decision-making in receipt verification strategies.
[0052] S1042. When the cross-regional cross-selling record exists, obtain the regional promotion rules of the limited-time promotional product corresponding to the cross-regional cross-selling record from the preset product knowledge graph; Regional promotion rules refer to the restrictions set for specific products within a specific region and time period, including restrictions on prices, discounts, supply and sales channels, and even end-users. These rules form the basis for determining whether promotional activities are illegal. Since limited-time promotional products often involve price subsidies, channel control, and inventory allocation policies, to prevent their sale in unauthorized areas and thus disrupt market order, regional promotion rules must be structurally described and dynamically invoked at the system level.
[0053] The pre-defined product knowledge graph plays a core supporting role in this process. This pre-defined product knowledge graph is automatically generated based on historical product transaction data, regional policy documents, merchant promotional rules, and product master data, through graph construction algorithms and semantic association modeling. This knowledge graph is a graph-structured database with products as core nodes, linking multiple entities such as product attributes, regional policies, pricing rules, and supply chain relationships, possessing strong correlation and semantic reasoning capabilities. During implementation, the system first locates the corresponding product entity through the product index nodes in the knowledge graph based on the product codes or name semantics identified in the cross-regional sales records. Subsequently, combining the product's promotional tags and sales time information, it further traverses the "promotional rules" sub-nodes directly associated with the product in the graph, filtering out promotional policies applicable to the original sales region during the time period before and after the cross-regional sales occurred.
[0054] To ensure the accuracy and contextual adaptability of the query results, the system also combines merchant identification information and regional attribute information extracted from the receipt image to verify whether the product is within the "applicable region" defined in the promotion rules, and whether the promotion time overlaps with the sales time. The system uses a timestamp-based interval matching algorithm and a region-encoded mapping rule to determine the above relationships, and performs semantic attribution in the graph using a path relationship of "product—promotion rule—region". If a promotion rule that meets the conditions exists, the system loads the rule content into structured data, including fields such as promotion start and end time, promotion price, maximum allowable deviation rate, and settlement method, and integrates this data with subsequent price analysis and circulation path modeling.
[0055] For example, in a certain cross-selling record, the product is "Limited-Time Promotion in East China - A Certain Brand of Yogurt," the seller's region is "Central China," and the sales period is October 10th. The system, through the product knowledge graph, found that this product was on promotion in the "East China" region from October 1st to October 15th, with a promotional price of 2.50 yuan and a maximum price deviation rate of 5%. Since the sales region does not belong to "East China," the system determines that this sales behavior violates the promotional region restriction and uses this promotional rule as an important basis for subsequent risk analysis.
[0056] Through the above operations, the system can quickly and accurately extract regional promotional rules related to the product after identifying cross-regional sales activities. This not only improves the automation level of compliance review for time-limited promotional activities, but also provides key policy background support for subsequent analysis of changes in product codes and price deviations, thereby achieving comprehensive quantification and accurate identification of cross-regional circulation risks.
[0057] S1043. Based on the product code mapping relationship, identify the product code change relationship between the original region and the target region corresponding to the cross-regional sales record of the limited-time promotional product; In this embodiment, to further verify whether there is unauthorized circulation of limited-time promotional goods across regions, it is necessary to identify the changes in product codes between the original and target regions involved in the cross-regional sales records based on the product code mapping relationship. The product code change relationship refers to the mapping relationship where the barcode or internal code of the same product differs in different regions due to differences in coding rules, regional central warehouse management strategies, or inconsistent standards in the joint venture system. Identifying this relationship is crucial for determining whether a product is "same product with different codes" or whether it has been disguised as other products through intermediate distribution nodes; it is a key step in reconstructing the distribution path and logically deducing the outcome.
[0058] During implementation, the system first extracts the product codes of promotional products from the product details obtained through OCR parsing. Combining this with merchant identification and regional attribute information from the basic transaction information, it determines the location where the product was sold, i.e., the "target region." Simultaneously, the system uses the cross-regional sales behavior marked in the previous steps to locate the original sales region. Subsequently, the system uses a product code mapping module to retrieve the corresponding product code pairs in the two regions, determining whether there are consistent codes, matching code prefixes, or mapping relationship patterns. This module achieves recognition based on a combination of rule matching and code structure parsing. Rule matching relies on a pre-built "regional code mapping rule library," recording the conversion logic between product codes in different regions, such as "products starting with the prefix 8801 in East China are mapped to the 9901 series in Central China." Code structure parsing uses a position vector-based pattern recognition algorithm to decompose the product code into fields such as category, brand, and specification. Semantic alignment between these fields determines whether they constitute cross-regional numbers for the same product.
[0059] In practical applications, if a product is coded "8801A123456" in the "East China Region" and "9901X123456" appears in the "Central China Region," the system, through mapping rules, finds that the specification and brand parts are consistent, and the prefix codes conform to the joint platform mapping logic of "8801↔9901." This indicates that the coding change relationship for the same product in different regions is valid. Furthermore, the system marks this mapping relationship as either a legitimate change or a suspicious substitution, specifically based on the legality strategy set in the coding mapping rules.
[0060] By identifying the relationship between changes in product codes, the system can not only clarify whether products are legitimately transferred as different codes, but also help determine whether there is any behavior of using codes to disguise and circumvent regional price controls. Especially in the management of limited-time promotional products, it can effectively reduce the misjudgment rate of cross-regional sales caused by code differences, thereby enhancing the accuracy and depth of cross-regional circulation risk analysis and providing key circulation path basis for the final generation of comprehensive behavioral feature fingerprints.
[0061] S1044. Determine the actual transaction price of the limited-time promotional goods based on the name terminology correspondence and the cross-regional settlement rules; In step S1044, to accurately determine the price deviation of limited-time promotional goods during cross-regional circulation, it is necessary to calculate the actual transaction price based on the correspondence between name terms and cross-regional settlement rules. Since different regions use different terminology for the same product, and in joint ventures or transfer scenarios, the settlement method may differ due to regional policies, supply and sales relationships, or promotional strategies, it is difficult to reconstruct the true transaction amount based solely on the surface price. By identifying the promotional description features of the product in the original and target regions, and combining this with the settlement mechanism of the corresponding regions, a logical connection between semantic consistency and price changes can be established, thereby achieving accurate determination of the actual transaction price. This may include the following steps: extracting the first promotional description feature of the limited-time promotional goods in the original region and the second promotional description feature in the target region from the name term correspondence; performing semantic comparison analysis on the first and second promotional description features to obtain the semantic comparison analysis result; and determining the actual transaction price of the limited-time promotional goods based on the semantic comparison analysis result and the cross-regional settlement rules.
[0062] To accurately determine the actual transaction price of limited-time promotional products in cross-regional distribution scenarios, the system needs to fully consider whether there are semantic differences in the naming methods of products in different regions. Since limited-time promotional products are often described using regionalized language, such as "Special Price in Sichuan and Chongqing Zone" or "Limited-Time Offer in Jiangsu and Zhejiang," these descriptions not only contain regional information but may also include promotional methods, price characteristics, or time restrictions. Therefore, the system needs to extract the promotional description content of the product in the original region and the target region from the name-term correspondence, respectively, as the first and second promotional description features. The name-term correspondence is a data structure formed by semantically mapping local product descriptions to standard product names. It originates from historical sales records, regional product catalogs, and semantic tags in product knowledge graphs, and is used to identify different ways of describing the same product in different regions. The extraction method combines keyword matching algorithms with contextual semantic analysis models to identify promotion-related phrases, sentences, or semantic units in the product name, thereby constructing descriptive features. Taking "Northwest Special Supply - Yogurt" as an example, the system identifies "Northwest Special Supply" as the first promotional description feature. If "Central China Special Price - Yogurt" appears in the target area, then "Central China Special Price" is extracted as the second promotional description feature.
[0063] After extracting the promotional description features, the system needs to determine whether there are substantial differences in the promotional semantics between the original region and the target region. To this end, the system performs semantic comparison analysis on the first and second promotional description features to identify whether there are content substitutions, changes in promotional types, or disguised language expressions. The semantic comparison analysis employs a semantic similarity calculation method based on word vector space modeling. By vectorizing the two sets of promotional description features and calculating cosine similarity in the semantic space, the system determines the degree of semantic closeness between the two. If the similarity is below a certain threshold, it is determined that there are substantial differences in the promotional purpose or content, potentially constituting disguised descriptions or cross-regional promotional restriction circumvention. Furthermore, the system also compares the promotional methods in the two regions based on the promotional type tags registered in the product knowledge graph to see if they are consistent, such as whether there is a substitution relationship between "buy one get one free" and "price reduction." The core purpose of this semantic comparison analysis is to determine whether the product's promotional expression has been artificially modified in different regions to conceal the true sales strategy, thereby assisting in price judgment.
[0064] Based on semantic comparison analysis, the system derives the actual transaction price of the limited-time promotional product by combining cross-regional settlement rules. Cross-regional settlement rules refer to the set of rule parameters such as price calculation methods, subsidy standards, and tax policies adopted by different regions at the commodity circulation level. The system uses the semantic comparison analysis results as weighting factors, and comprehensively calculates the actual transaction price by combining variables such as the actual sales price in the target region, the promotional subsidy amount, and the settlement method (such as "direct settlement from headquarters" or "regional allocation"). If the semantic comparison results show a high degree of consistency, the price is directly estimated based on the target region's selling price combined with the standard promotional subsidy; if the semantic differences are significant, the price is back-calculated based on the product's promotional rules in the original region to assess whether there is any abnormal behavior exceeding the price deviation rate. For example, if a product is marked as "limited-time price 2.5 yuan" in the original region and sold as "special price 3.2 yuan" in the target region, the semantic analysis shows that the promotional descriptions are inconsistent. Combined with the maximum deviation rate of 20% set in the settlement rules, the actual transaction price exceeds the deviation threshold, and the system can therefore determine that the product has abnormal pricing and circulation behavior.
[0065] Through step S1044, the system can not only identify the differences in product promotion expressions at the language level, but also accurately deduce the actual transaction amount of the product by combining regional policies and pricing rules, thereby providing a quantitative basis for cross-regional circulation risk analysis and significantly improving the intelligence and accuracy of cross-selling identification.
[0066] S1045. When the actual transaction price is greater than the price deviation rate in the regional promotion rules, and the product code change relationship meets the preset change conditions, the cross-regional circulation risk analysis result is obtained based on the preset product knowledge graph.
[0067] In step S1045, the price deviation rate, in commodity circulation and risk control analysis, is an indicator used to measure the degree of deviation between the actual transaction price and the reference price of a commodity in different regions, channels, or time periods, usually expressed as a percentage. It is a key parameter for identifying price anomalies and determining whether there is cross-regional sales, false promotions, or price manipulation. To further confirm whether there is abnormal cross-regional circulation behavior of limited-time promotional goods, simply judging whether the actual transaction price exceeds the price deviation rate in the regional promotion rules is insufficient to support a qualitative judgment. Therefore, it is also necessary to combine the commodity coding change relationship to determine whether the commodity has undergone suspicious number conversions between regions through specific coding rules. Only when both price deviation and coding change are present does the system consider there to be a high suspicion of cross-regional sales and trigger a deeper level of risk analysis, namely, modeling the historical circulation characteristics of the commodity based on a preset commodity knowledge graph. By extracting historical circulation paths of goods across multiple regions from a product knowledge graph, the system can construct a regional circulation sequence of the goods between the original region and the target region. This circulation sequence is then matched and analyzed against a pre-defined high-risk circulation pattern library to further quantify the risk level of the circulation path, thus forming the final cross-regional circulation risk analysis result. Specifically, this can include the following steps: extracting historical circulation characteristics of the limited-time promotional goods from the pre-defined product knowledge graph; constructing suspected circulation paths for the limited-time promotional goods based on the historical circulation characteristics, whereby the suspected circulation paths include the regional circulation sequence of the limited-time promotional goods between the original region and the target region; obtaining a pre-defined high-risk circulation pattern library from the pre-defined product knowledge graph; calculating the matching degree between the suspected circulation path and each risk pattern in the pre-defined high-risk circulation pattern library; determining the risk level of the suspected circulation path based on risk patterns with matching degrees greater than a pre-defined matching threshold; and obtaining the cross-regional circulation risk analysis result based on the risk level and the regional circulation sequence.
[0068] In the actual review process, when the system identifies that the actual transaction price of a limited-time promotional item exceeds the price deviation rate set by the regional promotion rules, and the coding changes of the item across different regions meet preset abnormal conditions, the system will call the product knowledge graph to extract and analyze the historical circulation characteristics of the item to further confirm whether there is a systemic risk of cross-regional sales. Historical circulation characteristics refer to the behavioral trajectory data of the item's cross-regional sales, allocation, and settlement within a certain time window, including the frequency of the item's appearance in each region, circulation time nodes, logistics path records, and information on associated merchants. This data comes from long-term historical transaction extraction information accumulated in the product knowledge graph. The graph records the relationship edges between the item and regions, merchants, time, and price in a graph structure, supporting rapid backtracking and structured extraction of multi-dimensional circulation patterns of the item. Through the aggregation and normalization of this historical information, the system can construct the regional circulation sequence of the item between the original region and the target region, i.e., the so-called suspicious circulation path.
[0069] Upon identifying a suspicious distribution path, the system does not directly make a risk assessment. Instead, it compares the path with a pre-defined high-risk distribution pattern library. This library is a set of rules formed by abstracting and modeling past distribution paths of goods confirmed as illegal or suspected of cross-regional sales. Typical patterns include "multi-level short-chain reverse distribution," "centralized regional return flow," "frequent cross-regional transfers," and "targeted transfer of promotional goods." These patterns exist in the form of graph structures or path templates. The system uses a graph matching algorithm (such as path subgraph matching or graph embedding similarity calculation) to calculate the matching degree between the current product's regional distribution sequence and each pattern in the risk pattern library. The matching degree is a quantitative indicator measuring the similarity between the current path and a high-risk pattern, typically calculated using a combination of multi-dimensional features such as structural similarity, consistency of time points, and merchant overlap. If the matching degree exceeds a pre-defined threshold, it indicates that the current product's distribution behavior highly matches a known risk pattern. The system then marks this path as a high-risk path and determines that the product has potential cross-regional sales behavior.
[0070] Ultimately, the system jointly evaluates the risk level (e.g., low, medium, high) corresponding to the matched risk patterns with the product's regional distribution sequence, forming a complete cross-regional distribution risk analysis result. This result not only indicates the risk level but also identifies specific distribution nodes, suspected merchants, and anomalies in the distribution path, serving as the basis for subsequent manual review or automatic interception. For example, if a promotional beverage product appears in the "Southwest Region" and then appears in multiple regions such as "East China" and "North China" with different codes within a short period, and the distribution path matches the "multi-location jump sales" pattern in the high-risk pattern library with a match degree exceeding 0.85, the system marks this path as high-risk and outputs its complete distribution sequence for further processing by the risk control system.
[0071] Through the coordinated implementation of the above steps, the system can not only perform preliminary cross-selling identification based on price and coding changes, but also leverage the structured semantic capabilities of knowledge graphs to trace the regional circulation history of goods in depth, thereby achieving full-chain risk modeling and automated assessment of complex circulation behaviors.
[0072] S105. Perform tampering detection on the receipt image data to obtain a tampering suspicion score; In step S105, to identify whether the receipt image may have been modified or forged, the system needs to perform tampering detection on the acquired receipt image data to be reviewed, and calculate a tampering suspicion score reflecting the image's credibility. This score is used to quantify the risk of the receipt image being tampered with, and is an important basis for subsequently constructing behavioral feature fingerprints and formulating review strategies. However, it is difficult to accurately identify fine-grained tampering behavior based solely on the overall features of the image. Therefore, the system needs to further refine the image content and conduct detection operations from multiple dimensions. Specifically, this may include the following steps: performing pixel anomaly detection on the receipt image data to identify image splicing traces; extracting text regions from the receipt image data, performing font consistency detection on the text regions to obtain font detection results; analyzing the EXIF information in the receipt image data to identify editing records; and calculating the tampering suspicion score of the receipt image data based on the image splicing traces, the font detection results, and the editing records.
[0073] In the process of detecting tampering traces in receipt image data, the system needs to comprehensively analyze the abnormal features of the image at multiple levels to determine whether the receipt is at risk of being edited or forged. Pixel anomaly detection is one of the fundamental steps, mainly utilizing the principle of image sampling consistency to identify the presence of image splicing traces from dimensions such as pixel distribution, edge texture, and compression noise. Splicing traces typically manifest as logical discontinuities in pixel distribution in local areas, inconsistent degrees of edge blurring, and abnormal degrees of compression distortion. The system can effectively detect these differences through multi-scale convolutional analysis or frequency domain Fourier transform, thereby locating image regions that may have been cropped or composited.
[0074] Building upon pixel-level image processing, to further verify the authenticity of key text information in the image, the system also needs to perform font consistency detection on the text regions within the image. Since genuinely printed receipts typically use the same model of cash register or printing module, their fonts, sizes, and spacing exhibit a high degree of consistency. However, if someone intentionally tampers with a product information or price field, they often insert new text regions using image editing tools. While the font style of these regions can mimic the original font, subtle differences remain in font anti-aliasing, character outlines, and stroke thickness. After extracting text regions using an OCR engine, the system compares the font feature vectors of different fields using a font recognition model (such as a font classifier based on convolutional neural networks). If a significant deviation is detected between the font of certain fields and the main font, that region will be marked as a font inconsistency area, thus supporting subsequent judgment of suspected tampering.
[0075] In addition, to analyze whether an image has been edited, the system also needs to parse the image's EXIF information. EXIF (Exchangeable Image File Format) is metadata embedded in a digital image file, recording information such as the image capturing device, capturing time, and modification history. If the EXIF contains identifiers of editing software, a significant discrepancy between the storage time and the transaction time, or traces of deleted or modified metadata fields, these can all serve as important evidence of image tampering. For example, if a receipt image shows a transaction from 2024, but the EXIF record shows a creation time of 2025 and contains Photoshop editing records, it is highly suspicious.
[0076] Finally, the system weights and fuses the detection results from the three dimensions mentioned above to calculate the image's tampering suspicion score. This score can be achieved using methods such as logistic regression, Bayesian classification, or multilayer perceptron, taking image stitching confidence, font deviation, and EXIF editing risk value as input features, and outputting a score between 0 and 1 to quantify the likelihood of image tampering. For example, if a receipt has a stitching boundary detected in the product column on the left side of the image, and the font of the product price field is significantly different from other fields, and the image's EXIF contains editing records from a device other than the original, the system will consider these anomalies and output a tampering suspicion score of 0.87 for the image, indicating that the receipt has a high risk and needs to enter the manual review process.
[0077] Through the collaborative processing of image stitching detection, font consistency analysis, and EXIF information parsing, the system can achieve multi-dimensional credibility assessment of receipt images, providing highly reliable image source data for constructing behavioral feature fingerprints, and also providing a more interpretable risk scoring basis for subsequent review strategies.
[0078] S106. Construct a behavioral feature fingerprint of the receipt image data based on the cross-regional circulation risk analysis results and the tampering suspicion score; In step S106, the system needs to structurally integrate the abnormal performance of the image layer and semantic layer based on the cross-regional circulation risk analysis results and tampering suspicion scores obtained from the previous processing, generating a unified feature representation that can be used for historical behavior comparison and strategy judgment. Behavioral feature fingerprints refer to encoding the behavioral characteristics of each receipt in multiple dimensions such as image, semantics, circulation path, and transaction pattern, forming unique, reproducible, and comparable digital fingerprint information. Its core design lies in unifying the modeling of heterogeneous risk clues to support subsequent behavioral difference analysis and risk clustering identification.
[0079] In constructing behavioral feature fingerprints, the system extracts structured risk elements from cross-regional circulation risk analysis results. These elements include the regional circulation path of promotional goods, product coding change patterns, the degree of deviation between transaction prices and regional promotional rules, and the matching degree level of the path in the high-risk pattern library. This information reflects the compliance of goods circulation between different regions and is quantitatively represented in a graphical manner. For example, if a product is sold in the Southwest region under code A123 and appears in the East China region under code B456, with a transaction behavior where the price deviation rate exceeds 30%, the system encodes its path sequence, coding mapping relationship, and matched risk pattern number into a structured vector, which serves as the "circulation sub-feature" in the behavioral fingerprint.
[0080] The system also incorporates the tampering suspicion score calculated from the image tampering trace detection in the preceding steps into the feature fingerprint. Simultaneously, it introduces the corresponding image anomaly structure features as image risk sub-features, including image splicing confidence, text region font deviation vector, and EXIF editing identifier bits. This part of the feature not only reflects the credibility of the receipt image but also serves as an important reference for subsequent judgment of the authenticity of the receipt's transaction information. To improve the comparability of the representation, the system employs feature normalization and encoding compression techniques to uniformly map information such as risk level, score value, and matching path into a fixed-length behavioral fingerprint vector.
[0081] In its implementation, the system constructs a multi-dimensional behavioral feature fusion model, employing methods such as feature concatenation, principal component retention, and hash compression to fuse image-level features with semantic-level features into a unified fingerprint representation. This model aligns and aggregates risk factors from different sources based on predefined behavioral feature templates, ensuring that features from different sources are mapped to the same semantic space. For example, when the image concatenation confidence is 0.92, the font deviation is 0.87, the cross-regional circulation matching degree is 0.91, and the price deviation is 35%, the system uniformly maps these features into a structured behavioral fingerprint vector such as [0.92, 0.87, 0.91, 0.35, 2, 1], where the number 2 represents a high-risk path level and 1 represents a high-risk matching pattern type.
[0082] This processing method constructs behavioral fingerprints that not only retain risk information from the two key dimensions of cross-regional circulation and image credibility, but also possess high-dimensional feature comparison capabilities. These fingerprints can be directly used for similarity matching and behavioral pattern clustering analysis with historical fingerprints. For example, when the system subsequently detects multiple receipts with highly similar fingerprint vectors that all match the same high-risk pattern, the system can automatically identify potential group cross-border sales or bulk image forgery operations, thus providing the risk control system with more forward-looking and accurate decision-making support.
[0083] In summary, constructing behavioral feature fingerprints based on cross-regional circulation risk analysis results and tampering suspicion scores is not only a process of digitally encapsulating complex graphs and image analysis results, but also a key technical path to achieve standardized expression of behavioral trajectories, enhance anomaly identification capabilities, and support the formulation of intelligent audit strategies.
[0084] S107. Obtain historical behavioral feature fingerprints within a preset historical time period, compare and analyze the behavioral feature fingerprints with the historical behavioral feature fingerprints, and obtain the comparison and analysis results. In step S107, the preset historical time period refers to the time range parameter used to extract historical behavioral feature fingerprints. Its function is to limit the historical data window referenced by the system when performing comparative analysis, so as to ensure the timeliness, relevance, and effectiveness of behavioral pattern comparison. The setting of this time period needs to cover sufficient data samples to support pattern recognition, while avoiding the introduction of outdated or invalid data that may interfere with the accuracy of the current analysis results.
[0085] Specifically, the preset historical time period can be flexibly configured based on factors such as actual business scenarios, product lifecycle characteristics, promotional activity cycles, and data processing capabilities. Common setting methods include: Fixed time window: such as the most recent 30 days, 60 days, or 90 days, suitable for most retail receipt scenarios, covering the promotional cycles and typical transaction behavior cycles of most products. Sliding time window: The system automatically backtracks a fixed number of days each time it analyzes, such as "backtracking 60 days from the date of review," ensuring data continuity and timeliness. Event-triggered time window: For example, focusing only on a period before and after the most recent large-scale promotional event (such as Double Eleven, 618, etc.), such as "7 days before the start of the promotion to 14 days after the end," to identify abnormal behaviors related to specific market activities. Adaptive time window: The system dynamically adjusts the time period based on the product category, merchant type, or historical risk density of the current receipt. For example, the historical time period for high-risk merchants can be set to 180 days, while low-risk merchants only retain the most recent 30 days of data.
[0086] In the specific implementation process, it is first necessary to clarify the composition of behavioral feature fingerprints. A behavioral feature fingerprint is a feature vector encoded by risk factors across multiple dimensions, containing two main sources: cross-regional circulation risk analysis results and tampering suspicion scores. Its structure includes multiple fields such as the circulation path of goods in different regions, product code change patterns, regional price deviations, matched risk circulation pattern numbers, image stitching confidence, font consistency deviation values, and EXIF editing marks. Historical behavioral feature fingerprints are a set of fingerprints recorded by the system within a preset time period (e.g., the past 30 or 90 days) that have cross-correlation with the current receipt image data in terms of merchant identification, product name, or sales region.
[0087] To achieve effective comparison and analysis, the system first performs feature standardization on the current behavioral fingerprint, normalizing each risk field to a uniform scale. It then reduces the dimensionality of the high-dimensional feature space using feature hashing or principal component retention algorithms to improve comparison efficiency and matching accuracy. Subsequently, the system retrieves a set of historical behavioral fingerprints from the historical database that are associated with the current receipt image data in dimensions such as merchant identification, product code, and regional attributes. A similarity measurement model is then used to calculate the similarity between fingerprints. Similarity measurement methods can include cosine similarity, Euclidean distance, Mahalanobis distance, or deep learning-based embedding comparison models. Cosine similarity is often used to describe whether behavioral patterns are consistent due to its greater sensitivity to directionality. During the comparison process, the system not only focuses on the overall similarity between the current fingerprint and historical fingerprints but also performs local field alignment analysis on key risk fields. For example, if the current product code change path is completely consistent with a high-risk path in the historical fingerprint, and the transaction price deviation is similar, it can be determined that the current behavior is highly likely to be a continuation or variation of historical risk behavior. Furthermore, if the current image tampering features highly overlap with a batch of tampered records in historical fingerprints in terms of image splicing feature vectors and font deviation patterns, the system can also determine that the current image may be a forgery from the same source.
[0088] Through the above comparative analysis process, the system ultimately outputs a set of comparative analysis results indicators, including the highest similarity value, the matched historical behavioral fingerprint ID, a list of similar fields, and behavioral offset. Among these, the behavioral offset describes the structural differences in risk expression between the current fingerprint and historical fingerprints. If the current behavior shows a shift towards higher risk in multiple dimensions, the review level can be further increased or manual review can be triggered. For example, if the behavioral feature fingerprint of the current receipt is highly consistent with the fingerprints of multiple receipts uploaded by a merchant in the past week in terms of product code mapping, regional path sequence, and image font deviation pattern, and the historical fingerprints have been marked by the system as high-risk multi-point cross-selling behavior, then the comparative analysis result of the current fingerprint will be marked as "highly overlapping," along with the historical matching sample ID and risk level information.
[0089] By comparing and analyzing current behavioral fingerprints with historical behavioral fingerprints, not only can repetitive risky behaviors and traces of organized operations be identified, but the spread of new risk patterns can also be discovered. This provides a data foundation and behavioral basis for the system to formulate more accurate and dynamic review strategies in subsequent steps. This comparative analysis mechanism is not only real-time and highly sensitive, but also greatly improves the review system's ability to recognize behaviors in complex scenarios through structured fingerprint comparison.
[0090] S108. Determine the review strategy for the receipt to be reviewed based on the comparative analysis results.
[0091] Step S108 determines the review strategy for the receipts to be reviewed based on the comparative analysis results. This step is at the final decision-making stage of the entire review process, aiming to transform the analytical conclusions obtained from the behavioral feature fingerprint comparison into specific review execution actions, achieving closed-loop control from risk identification to risk handling. This strategy not only affects the execution method of the review but also determines whether to trigger subsequent processing paths such as automatic rejection, manual review, and risk warning. Therefore, its design logic requires interpretability, responsiveness, and dynamic adaptability.
[0092] In the specific implementation process, the system reads the comparative analysis results output by step S107. These results include structured information such as the similarity score between the behavioral feature fingerprint of the current receipt image data and the historical behavioral feature fingerprint, the matched high-risk behavioral pattern number, the behavioral offset index, the image credibility level, and the distribution of historical behavioral labels. These indicators together constitute the risk position and semantic meaning of the current behavior in the historical context, serving as the basis for formulating review strategies.
[0093] The system employs a multi-dimensional rule engine model to process these analytical indicators. The rule engine is a configurable decision logic framework that internally maintains a set of review policy rule tables jointly defined by domain experts and machine learning models. This rule table uses risk levels of behavioral fingerprints, image tampering scores, historical matching degrees, and offset trends as trigger conditions, mapping them to different review policies. For example, when the similarity between the behavioral fingerprint and a record in the high-risk fingerprint database is greater than 0.95, and the image splicing risk score exceeds the threshold of 0.85, the system sets the policy to "direct rejection"; when the similarity is between 0.75 and 0.95, and the image credibility level is moderate but there is an abnormal price deviation, the policy is "enter manual review"; if the similarity is less than 0.5, and the image credibility level is high, the policy is "automatically pass and record fingerprint features for model training".
[0094] In practice, the system uses the timestamp of the current receipt image data to determine whether it falls within a peak promotional period or a historically high-risk timeframe. If so, the system will appropriately increase the sensitivity of the review. For example, during periods like Singles' Day or year-end clearance sales, the system will use a dynamic weighting mechanism to adjust the proportion of image risk factors in the review strategy, increasing the priority for identifying image forgery. Simultaneously, the system will also comprehensively consider the historical behavior of merchant identification information and regional attribute information. For instance, if a merchant has continuously uploaded multiple highly similar, high-risk receipts within the past 30 days, their behavior pattern will be marked as "suspicious concentrated submissions." Even if the current fingerprint similarity is slightly lower, it may be upgraded to the "manual review" level to prevent evasive behavior.
[0095] Furthermore, to enhance the traceability and learning capabilities of the audit strategy, the system will store the final audit strategy along with the input behavioral feature fingerprints and comparative analysis results in the audit decision log library for subsequent risk control analysis and strategy optimization. This log library can be used to train an adaptive adjustment model for the audit strategy, enabling the system to continuously learn new risk patterns and behavioral evolution paths during long-term operation, thereby achieving dynamic upgrades to the audit strategy.
[0096] Through the above implementation methods, the determination of the audit strategy no longer relies on a single rule or static threshold judgment, but is based on a comprehensive decision based on structured risk fingerprints and behavioral evolution trends. This enables fine classification and processing of receipt image data, improves the audit system's ability to respond to complex forgery behaviors, multi-regional cross-selling operations, and linked risks, and effectively reduces human intervention costs and misjudgment rates while ensuring audit efficiency, thereby enhancing the intelligence and controllability of the entire invoice audit system.
[0097] Please see Figure 3 This is a schematic diagram of a receipt verification structure based on OCR in an embodiment of this application.
[0098] It should be noted that, Figure 3 The structure of the OCR-based receipt verification system shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0099] like Figure 3 As shown, an OCR-based receipt verification system includes a central processing unit 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory 302 or a program loaded from a storage section 308 into a random access memory 303, such as executing the methods described in the above embodiments. The random access memory 303 also stores various programs and data required for system operation. The central processing unit 301, the read-only memory 302, and the random access memory 303 are interconnected via a bus 304. An input / output interface 305 is also connected to the bus 304.
[0100] The following components are connected to the input / output interface 305: an input section 306 including audio input devices, push-button switches, etc.; an output section 307 including an LCD display, audio output devices, indicator lights, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the input / output interface 305 as needed. A removable medium 311, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 310 as needed so that computer programs read from it can be installed into the storage section 308 as needed.
[0101] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing computer programs for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 309, and / or installed from removable medium 311. When the computer program is executed by central processing unit 301, it performs the various functions defined in the present invention.
[0102] It should be noted that specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory, flash memory, optical fiber, portable compact disk read-only memory, optical storage devices, magnetic storage devices, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0103] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those shown in the drawings.
[0104] Specifically, the OCR-based receipt verification system of this embodiment includes a processor and a memory. The memory stores a computer program. When the computer program is executed by the processor, it implements the OCR-based receipt verification method provided in the above embodiment.
[0105] In another aspect, the present invention also provides a computer-readable storage medium, which may be included in the OCR-based receipt verification system described in the above embodiments; or it may exist independently and not assembled into the OCR-based receipt verification system. The storage medium carries one or more computer programs, which, when executed by a processor of the OCR-based receipt verification system, cause the OCR-based receipt verification system to implement the OCR-based receipt verification method provided in the above embodiments.
Claims
1. A receipt verification method based on OCR, characterized in that, The method includes: Obtain the image data of the receipt to be reviewed; Optical character recognition is performed on the receipt image data to obtain key text information of the receipt image data, including basic transaction information and product details information; Extract commodity circulation feature data from the receipt image data from the key text information; Based on a preset product knowledge graph and the product circulation characteristic data, cross-regional circulation risk analysis is performed on the product details information to obtain cross-regional circulation risk analysis results. The receipt image data is subjected to tampering detection to obtain a tampering suspicion score; Based on the cross-regional circulation risk analysis results and the tampering suspicion score, a behavioral feature fingerprint of the receipt image data is constructed. Obtain historical behavioral feature fingerprints within a preset historical time period, compare and analyze the behavioral feature fingerprints with the historical behavioral feature fingerprints, and obtain the comparison and analysis results; Based on the comparative analysis results, the review strategy for the receipt to be reviewed is determined, and the receipt to be reviewed is reviewed based on the review strategy.
2. The method according to claim 1, characterized in that, The commodity circulation characteristic data includes commodity code mapping relationships, name terminology correspondence relationships, and cross-regional settlement rules. The commodity circulation characteristic data extracted from the receipt image data from the key text information specifically includes: Extract cross-regional joint venture product records from the product details information, and extract merchant identification information and regional attribute information corresponding to the cross-regional joint venture product records from the basic transaction information; Based on the merchant identification information, identify the product barcode format in the product details information to determine whether there is a regional product code change; If there is a regional product code change, then obtain the product code mapping relationship of the product with the changed code in different regions. Extract the local characteristic description information of the product with the changed code from the product details information; The correspondence between the names and terms is determined based on the local characteristic description information and the regional attribute information. Identify regional price difference markers from the product details information and obtain the cross-regional settlement rules corresponding to the regional price difference markers; The commodity circulation characteristic data is obtained based on the commodity code mapping relationship, the name term correspondence relationship, and the cross-regional settlement rules.
3. The method according to claim 2, characterized in that, The process of determining the correspondence between the names and terms based on the local characteristic description information and the regional attribute information specifically includes: The dialect expression degree of the local characteristic description information is calculated, and the dialect expression degree is used to characterize the degree of dialect expression in the local characteristic description information; Based on the regional attribute information, a name terminology correspondence is established between the target local characteristic description information and the standard product name corresponding to the target local characteristic description information. The target local characteristic description information is the local characteristic description information with a dialect expression degree greater than a preset dialect threshold.
4. The method according to claim 1, characterized in that, The method of performing cross-regional circulation risk analysis on the product details based on a preset product knowledge graph and the product circulation characteristic data, and obtaining the cross-regional circulation risk analysis results, specifically includes: The system detects whether there are any cross-regional sales records for limited-time promotional items in the product details information. When the cross-regional cross-selling record exists, the regional promotion rules of the limited-time promotional product corresponding to the cross-regional cross-selling record are obtained from the preset product knowledge graph; Based on the product code mapping relationship, identify the product code change relationship between the original region and the target region corresponding to the cross-regional sales record of the limited-time promotional product; The actual transaction price of the limited-time promotional product is determined based on the aforementioned name terminology correspondence and cross-regional settlement rules. When the actual transaction price is greater than the price deviation rate in the regional promotion rules, and the product code change relationship meets the preset change conditions, the cross-regional circulation risk analysis result is obtained based on the preset product knowledge graph.
5. The method according to claim 4, characterized in that, The determination of the actual transaction price of the limited-time promotional product based on the name terminology correspondence and the cross-regional settlement rules specifically includes: Extract the first promotional description feature of the limited-time promotional product in the original region and the second promotional description feature in the target region from the name term correspondence; A semantic comparison analysis is performed on the first promotional description feature and the second promotional description feature to obtain the semantic comparison analysis results. The actual transaction price of the limited-time promotional product is determined based on the semantic comparison analysis results and the cross-regional settlement rules.
6. The method according to claim 4, characterized in that, The cross-regional circulation risk analysis results obtained based on the preset commodity knowledge graph specifically include: Extract the historical circulation characteristics of the limited-time promotional products from the preset product knowledge graph; Based on the historical circulation characteristics, a suspicious circulation path for the limited-time promotional goods is constructed, and the suspicious circulation path includes the regional flow sequence of the limited-time promotional goods between the original region and the target region; Obtain a preset high-risk circulation model library from the preset commodity knowledge graph; Calculate the matching degree between the suspicious circulation path and each risk pattern in the preset high-risk circulation pattern library, and determine the risk level of the suspicious circulation path based on the risk patterns whose matching degree is greater than a preset matching threshold; Based on the risk level and the regional circulation sequence, the results of the cross-regional circulation risk analysis are obtained.
7. The method according to claim 1, characterized in that, The step of detecting tampering traces in the receipt image data and obtaining a tampering suspicion score specifically includes: Perform pixel anomaly detection on the receipt image data to identify image splicing traces; Extract the text region from the receipt image data, perform font consistency detection on the text region, and obtain the font detection result; Analyze the EXIF information in the receipt image data to identify edited records; Based on the image splicing traces, the font detection results, and the editing records, a tampering suspicion score for the receipt image data is calculated.
8. A receipt verification system based on OCR, characterized in that, The OCR-based receipt verification system includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to cause the OCR-based receipt verification system to perform the method as described in any one of claims 1-7.
9. A computer-readable storage medium comprising instructions, characterized in that, When the instruction is run on the OCR-based receipt review system, the OCR-based receipt review system performs the method as described in any one of claims 1-7.
10. A computer program product, characterized in that, When the computer program product is run on the OCR-based receipt verification system, the OCR-based receipt verification system performs the method as described in any one of claims 1-7.