Cost accounting processing method and device, computer equipment and storage medium

By employing efficient image recognition and dynamic rule verification technologies, the problem of non-standardized data recognition and rule adaptation for catering invoices has been solved, enabling intelligent expense calculation and processing, improving data accuracy and compliance, and reducing the risk of violations.

CN121255853APending Publication Date: 2026-01-02HUNAN DATA IND GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511147049.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-15
Publication Date
2026-01-02

AI Technical Summary

Technical Problem

Existing technologies struggle to achieve intelligent, structured processing and dynamic rule verification of expense reports when handling complex reimbursement scenarios, resulting in low data processing efficiency and difficulty in ensuring compliance, particularly in the identification of non-standardized data and rule adaptability in restaurant invoices.

Method used

Efficient image recognition technology is used to parse the text of catering invoices. Structured field mapping relationships are generated through entity recognition and association. Ambiguous items are filled in by context. A dynamic rule base is used for compliance assessment. When anomalies are detected, the rule parameters are dynamically adjusted to achieve secondary matching to ensure compliance.

Benefits of technology

It has improved the efficiency of financial auditing, enhanced the transparency and standardization of expense reimbursement, reduced the risk of violations, and achieved intelligent expense accounting processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121255853A_ABST
    Figure CN121255853A_ABST
Patent Text Reader

Abstract

The invention discloses a cost accounting processing method and device, computer equipment and a storage medium. Belongs to the technical field of financial accounting. Firstly, the system collects and processes original image data, and accurately extracts key data such as restaurant names, dish information, prices and dates through advanced image and text processing technologies. Secondly, based on an entity processing technology, the system can convert an unstructured text into a structured field mapping relation, and then fuzzy or missing information is completed through context filling. And then, the system flexibly selects and applies compliance rules for different catering scenes by using a dynamic rule base, and automatically judges whether the dining data meets a preset standard or not. When an abnormal field is found, the system can dynamically adjust rule parameters by using a machine learning technology based on a historical data mode. Finally, a secondary matching mechanism ensures that all the dining data are verified again under the adjusted rule framework, and the cost accounting accuracy and the risk control capability are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of financial accounting, and particularly relates to a cost accounting processing method and device, computer equipment and a storage medium. BACKGROUND

[0002] Expense control and reimbursement management are crucial in enterprise operations, directly related to financial compliance and resource optimization. Reasonable expense management not only improves enterprise economic efficiency, but also prevents financial risks and ensures transparent operations. However, existing solutions often face low data processing efficiency and insufficient rule adaptability when dealing with complex reimbursement scenarios. Traditional systems rely heavily on manual input and verification, making it difficult to handle diverse reimbursement document formats and weak in adapting to dynamic rules, resulting in low approval efficiency and difficulty in timely detecting abnormal data. For example, in meal reimbursement, the diversity of document information and flexibility of rules are difficult to balance, often resulting in compliance loopholes due to inaccurate information extraction or insufficient rule verification.

[0003] The core challenge lies in how to achieve the deep integration of intelligent structured processing of reimbursement documents and dynamic rule verification. Reimbursement documents such as meal invoices contain various non-standardized data such as restaurant name, dish information, price, and date. Traditional image recognition technology cannot efficiently extract and structure these information. This leads to the invalidation of subsequent rule verification due to incomplete or inaccurate data. For example, a meal invoice may have illegible handwriting or complex format, making it difficult for the system to accurately identify dish names and prices, thereby affecting the compliance judgment of the total amount or date. In addition, dynamic rule verification needs to be adjusted flexibly according to different scenarios, such as limiting the upper limit of the price of certain dishes or the range of total amount, but existing systems often lack this adaptive ability, leading to missed detection of abnormal data and increased financial risks.

[0004] Therefore, how to achieve structured extraction of document information through efficient image recognition technology in complex reimbursement scenarios, combined with flexible dynamic rule verification mechanism, to ensure data accuracy and compliance, has become a key problem in the field of expense control. SUMMARY

[0005] The purpose of the embodiments of the present application is to provide a cost accounting processing method, device, computer equipment and storage medium to provide structured extraction of document information through efficient image recognition technology in complex reimbursement scenarios, combined with flexible dynamic rule verification mechanism, to ensure data accuracy and compliance.

[0006] To solve the above technical problems, the embodiments of the present application provide a cost accounting processing method, which adopts the following technical solutions:

[0007] A cost accounting processing method, comprising:

[0008] Collect the original image data of the catering invoice, and perform preliminary text analysis on the original image data to obtain a preliminary text set containing the restaurant name, dish information, dish price and order date;

[0009] According to the non-standardized data characteristics in the preliminary text set, entity recognition and entity association are performed on the preliminary text set to determine the key-value pair of the dish name corresponding to the dish price, and a structured field mapping relationship is obtained.

[0010] From the structured field mapping relationship, extract the fuzzy items or missing items, and use context filling to supplement the fuzzy items or missing items to obtain a structured complete invoice data set.

[0011] From the structured complete invoice data set, obtain user dining data, select rule parameters suitable for the catering scene from a pre-established dynamic rule library, and determine whether the user dining data meets the rule parameters to obtain a preliminary compliance evaluation result, wherein the rule parameters include a price upper limit and a total amount range.

[0012] From the preliminary compliance evaluation result, extract the abnormal fields, and if the number of abnormal fields is greater than zero, use a rule adjustment mechanism to dynamically update the rule parameters according to historical data patterns to determine an adjusted rule set.

[0013] By performing a secondary matching process between the adjusted rule set and the user dining data, it is determined whether all fields of the user dining data meet the adjusted rule set to obtain a final compliance verification result.

[0014] To solve the above technical problems, the embodiment of the application also provides a cost accounting processing device, which adopts the technical scheme as follows:

[0015] A cost accounting processing device comprises:

[0016] An image processing module is configured to collect original image data of a catering invoice, and perform preliminary text analysis on the original image data to obtain a preliminary text set containing the restaurant name, dish information, dish price and order date.

[0017] A structured module is configured to perform entity recognition and entity association on the preliminary text set according to non-standardized data characteristics in the preliminary text set, determine the key-value pair of the dish name corresponding to the dish price, and obtain a structured field mapping relationship.

[0018] A context filling module is configured to extract fuzzy items or missing items from the structured field mapping relationship, and use context filling to supplement the fuzzy items or missing items to obtain a structured complete invoice data set.

[0019] The preliminary evaluation module is configured to obtain user dining data from the structured complete invoice data set, select rule parameters suitable for the dining scenario from the pre-established dynamic rule library, and determine whether the user dining data meets the rule parameters to obtain a preliminary compliance evaluation result. The rule parameters include a price upper limit and a total amount range.

[0020] The rule adjustment module is configured to extract abnormal fields from the preliminary compliance evaluation result. If the number of abnormal fields is greater than zero, the rule adjustment mechanism is used to dynamically update the rule parameters according to historical data patterns to determine an adjusted rule set.

[0021] The secondary evaluation module is configured to determine whether all fields of the user dining data meet the adjusted rule set by performing a secondary matching process on the adjusted rule set and the user dining data to obtain a final compliance verification result.

[0022] To solve the above technical problems, the embodiments of the present application further provide a computer device, which adopts the technical solutions as follows:

[0023] A computer device includes a memory and a processor. The memory stores computer readable instructions. The processor executes the computer readable instructions to implement the steps of the expense accounting processing method according to any one of the above embodiments.

[0024] To solve the above technical problems, the embodiments of the present application further provide a computer readable storage medium, which adopts the technical solutions as follows:

[0025] A computer readable storage medium stores computer readable instructions. The computer readable instructions are executed by a processor to implement the steps of the expense accounting processing method according to any one of the above embodiments.

[0026] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0027] This application discloses a method, apparatus, computer equipment, and storage medium for expense accounting. It belongs to the field of financial accounting technology. First, the system can automatically collect and process raw image data, accurately extracting key data such as restaurant name, menu information, price, and date through advanced image preprocessing and text recognition technologies. Second, based on entity recognition and association technologies, the system can transform unstructured text into structured field mapping relationships, and then fill in fuzzy or missing information through contextual information filling to ensure data integrity and accuracy. Then, the system utilizes a dynamic rule base to flexibly select and apply compliance rules for different catering scenarios, automatically determining whether dining data meets preset standards, achieving intelligent preliminary compliance assessment. When abnormal fields are detected, the system can also dynamically adjust rule parameters based on historical data patterns using machine learning technology. Finally, a secondary matching mechanism ensures that all dining data is re-verified within the adjusted rule framework, significantly improving the accuracy of expense accounting and risk control capabilities. This application not only improves financial audit efficiency and reduces manual intervention but also enhances the transparency and standardization of expense reimbursement, reduces the risk of irregular reimbursement, and provides data support and intelligent assurance for corporate financial management. Attached Figure Description

[0028] To more clearly illustrate the solutions in this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0029] Figure 1 An exemplary system architecture diagram is shown, in which this application can be applied;

[0030] Figure 2 A flowchart of one embodiment of the cost accounting processing method according to this application is shown;

[0031] Figure 3 It shows Figure 2 A flowchart of an embodiment of step S204;

[0032] Figure 4 A schematic diagram of one embodiment of the cost accounting processing apparatus according to this application is shown;

[0033] Figure 5 It shows Figure 4 A schematic diagram of a structure of one embodiment of the preliminary evaluation module 404;

[0034] Figure 6 A schematic diagram of the structure of one embodiment of a computer device according to this application is shown. Detailed Implementation

[0035] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application, are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.

[0036] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0037] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.

[0038] like Figure 1 As shown, system architecture 100 may include terminal device 101, network 102, and server 103. Terminal device 101 may be a laptop 1011, tablet 1012, or mobile phone 1013. Network 102 is used as a medium to provide a communication link between terminal device 101 and server 103. Network 102 may include various connection types, such as wired, wireless communication links, or fiber optic cables.

[0039] Users can use terminal device 101 to interact with server 103 via network 102 to receive or send messages, etc. Various communication client applications can be installed on terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social media platform software, etc.

[0040] Terminal device 101 can be various electronic devices with a display screen and support web browsing. In addition to laptops 1011, tablets 1012, or mobile phones 1013, terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV), a laptop computer, and a desktop computer, etc.

[0041] Server 103 can be a server that provides various services, such as a backend server that provides support for the pages displayed on terminal device 101.

[0042] It should be noted that the cost accounting processing method provided in the embodiments of this application is generally executed by a server / terminal device, and correspondingly, the cost accounting processing device is generally set in the server / terminal device.

[0043] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative; the system can have any number of terminal devices, networks, and servers depending on implementation needs.

[0044] Continue to refer to Figure 2 A flowchart illustrating an embodiment of a cost accounting processing method according to this application is shown. The cost accounting processing method includes the following steps:

[0045] S201, Collect the original image data of the restaurant invoice and perform preliminary text parsing on the original image data to obtain a preliminary text set containing the restaurant name, dish information, dish price and order date;

[0046] Specifically, the acquisition process can be achieved through multi-channel input, including mobile shooting, batch scanning by scanners, or automatic docking with the enterprise reimbursement system to obtain image files. For the original image data of catering invoices, image preprocessing needs to be carried out first to improve the subsequent parsing accuracy, which may include denoising (Gaussian filtering or adaptive median filtering), sharpening, brightness and contrast equalization (histogram equalization), perspective correction, etc. In the text parsing part, the problems of multiple formats and mixed different fonts existing in catering invoices should be considered. A general OCR model (such as CRNN, Transformer OCR) is used in combination with a domain-specific dictionary for preliminary recognition, and the core fields such as restaurant names, dish names, dish prices, dates, etc. are extracted preferentially. Since invoices may contain printed text and handwritten remarks, multi-modal recognition needs to be implemented in the OCR stage, and the outputs of the handwritten recognition model (such as HTRNet, Transformer-based handwriting recognition) and the printed recognition model are fused to generate a unified text result. At the same time, a preliminary layout analysis module should be designed to roughly group the recognition results using text positions, font sizes, and layout structures, forming a preliminary text set containing the above key information.

[0047] S202. According to the non-standard data features in the preliminary text set, entity recognition and entity association are performed on the preliminary text set to determine the key-value pairs of the dish name corresponding to the dish price, and a structured field mapping relationship is obtained.

[0048] Specifically, non-standard data features refer to different expression forms, abbreviations, misspellings, symbol mixing, etc. existing in the preliminary text set. For example, "Stir-Fried Potato, Eggplant and Green Pepper", "Di 3 Xian", "Di San", etc. all refer to the same dish. The entity recognition stage can be implemented based on the named entity recognition (NER) model in the catering field. This model can adopt the BERT+CRF or LayoutLMv3 structure, and combine the pre-constructed catering field knowledge graph and alias dictionary to automatically label entities such as dishes, prices, quantities, dates, etc. in the original text. In the entity association stage, it is necessary to pair the dish name, quantity, unit price, and total price in the same logical line, which can be achieved through position clustering (clustering text blocks according to vertical / horizontal distance), regular matching (price feature matching), and semantic relationship inference (predicting field attribution based on the seq2seq model). If there are multiple price numbers in the invoice, it is necessary to judge their meanings through the context (such as judging whether it is the unit price, total price, or discount) to determine the correct dish-price key-value pair. The finally formed field mapping relationship should include a multi-level association structure of dish name → quantity → unit price → total price, and附带 position index and confidence score.

[0049] S203: Extract fuzzy or missing items from the structured field mapping relationship, and use context filling to supplement the fuzzy or missing items to obtain a structured complete invoice dataset;

[0050] Specifically, ambiguous items may manifest as fields with low confidence in the OCR results (such as the last character being missing or misrecognized in "Kung Pao Chicken*"). Missing items may include the unit price, quantity, or date of the dish that were not recognized. The system first performs data quality checks on the structured mapping relationships, filtering out fields with low confidence values ​​(such as below 0.7) and empty fields. Contextual imputation can be divided into two categories: rule-based imputation and model-based imputation. Rule-based imputation uses the logical relationships between fields (such as total price = unit price × quantity) to infer missing values, or infers the unit price based on the price pattern of adjacent rows. Model-based imputation can be based on sequence prediction models (such as BiLSTM+Attention or T5) trained on domain data to infer missing fields using context. In addition, semantic completion can be performed by calling a knowledge base in the catering domain, such as automatically imputing "Kung Pao Chicken" as "Kung Pao Chicken Cubes", or imputing "Sizzling Beef" as "Sizzling Beef Tenderloin". For missing dates, inference can be made by combining invoice metadata (scanning time, upload time) with context fields. After the data is filled in, a consistency check is performed to ensure that the completion result is logically and numerically self-consistent, generating a structured and complete invoice dataset.

[0051] S204: Obtain user dining data from a structured complete invoice dataset, select rule parameters applicable to the catering scenario from a pre-established dynamic rule base, and determine whether the user dining data conforms to the rule parameters to obtain a preliminary compliance assessment result. The rule parameters include the price ceiling and the total amount range.

[0052] Specifically, user dining data includes restaurant name, dining date, dish details (dish name, quantity, unit price, total price), and total consumption amount. The dynamic rule base is a configurable and updatable set of rules, with restaurant-specific rules further subdivided into restrictions on dish unit price, total consumption per transaction, dining time range, and restaurant category. Rule parameters can be derived from the statistical distribution of historical consumption data (e.g., using the 95th percentile as the price ceiling) or manually configured by management. During the judgment process, the system should employ a high-performance rule engine (e.g., Drools, Easy Rules) to compare the structured data against the rules one by one, outputting whether the standards are met and a list of violations. For dishes with fuzzy matching (e.g., "Cordyceps stewed chicken" matching the prohibited word "Cordyceps"), entity standardization should be performed before rule judgment. The judgment result is output in Boolean format with detailed reasons, forming a preliminary compliance assessment result.

[0053] S205: Extract abnormal fields from the preliminary compliance assessment results. If the number of abnormal fields is greater than zero, adopt a rule adjustment mechanism to dynamically update the rule parameters based on historical data patterns and determine the adjusted rule set.

[0054] Specifically, outlier fields refer to those marked as non-compliant during the initial compliance assessment, such as unit price exceeding the limit, total amount exceeding the range, or prohibited dishes being included. The core of the rule adjustment mechanism is adaptive optimization, which can recalculate thresholds based on historical data patterns (distribution of catering consumption data over the past three months or one year), such as dynamically relaxing the upper limit when catering prices generally rise. This mechanism can incorporate statistical analysis (mean, variance, quantiles), cluster analysis (setting different thresholds for different customer groups), or anomaly detection algorithms (such as Isolation Forest) to identify trends and reasonable ranges. Simultaneously, boundary conditions and approval mechanisms for rule updates need to be set to prevent excessive rule adjustments due to a single outlier. After a rule update, an adjusted rule set is generated, and the rule version, reason for adjustment, and adjustment time are recorded to ensure traceability and rollback capabilities.

[0055] S206, by performing a secondary matching process between the adjusted rule set and the user's dining data, it is determined whether all fields of the user's dining data meet the adjusted rule set, and the final compliance verification result is obtained.

[0056] Specifically, the secondary matching process involves fully applying the adjusted rule set, comparing each field in the user's dining data (dish name, unit price, quantity, total price, restaurant name, dining date, etc.) against the rule parameters. This process requires the rule engine to support dynamically loading the latest rule set and output detailed field-level verification results during matching. For fields that still do not comply after rule adjustments, a risk label needs to be added, which can trigger subsequent manual review processes. Technically, the secondary matching can be designed as a batch processing mode (running on a large number of expense reports in batches) or a streaming mode (matching new documents in real time), supporting parallel computing to improve processing speed. The final compliance verification result should be output as a structured report, including field-level compliance status, triggered rule ID, matching confidence level, etc., and the results should be synchronized to the financial system, internal audit platform, or data analysis module to form a closed-loop management system.

[0057] Further, the process involves collecting raw image data from restaurant invoices and performing preliminary text parsing on the raw image data to obtain a preliminary text set containing the restaurant name, menu information, menu prices, and order date. Specifically, this includes:

[0058] The raw image data of restaurant invoices is collected and preprocessed, including image denoising and enhancement, irregularity correction and region filtering.

[0059] The preprocessed raw image data is subjected to text region recognition and segmentation to obtain several text blocks;

[0060] Semantic association is performed on several text blocks, and the association information of the text blocks containing restaurant name, menu information, menu price and order date is obtained from the semantic association results to obtain a preliminary text set.

[0061] In this embodiment, restaurant invoice images are first captured using a mobile device or a high-precision scanning device. Adaptive median filtering combined with high-frequency sharpening is then used for image denoising and enhancement to improve readability in blurry or low-contrast areas. For cases of tilted or curled images, perspective transformation and elastic deformation algorithms based on edge detection are used to correct irregularities, resulting in a regular rectangular shape for the invoice. In the region filtering stage, a semantic segmentation network (such as U-Net or DeepLab) is used to identify and retain the valid regions of the invoice, removing background and irrelevant interference. Subsequently, an arbitrary-shape text detection model (such as PSENet or TextFuseNet) is used to identify text regions in the image, generating several text blocks. Then, clustering is performed based on spatial relationships (vertical and horizontal proximity), font features, and semantic content similarity. Text blocks belonging to the same logical line are semantically associated, automatically matching key information such as restaurant name, dish name, dish price, and order date to form a preliminary text set.

[0062] The primary goal of image denoising and enhancement is to improve the readability of restaurant invoice images. In restaurant invoice collection scenarios, common interferences include oil stains, dirt, scratches, indentations, noise caused by low-light environments, and blurring due to insufficient resolution of the camera or scanning equipment. Denoising can effectively remove high-frequency noise using adaptive median filtering or image denoising models based on convolutional neural networks (such as DnCNN) while maintaining the clarity of text edges. For irregular noise such as oil stains and spots, morphological operations (opening and closing operations) combined with color thresholding can be used for removal. Enhancement can utilize local histogram equalization (CLAHE) to improve brightness and contrast in low-contrast areas, and super-resolution reconstruction (such as ESRGAN and Real-ESRGAN) to improve resolution in blurred areas. Furthermore, unsharp masking can be used to enhance text outlines, making font strokes more distinct and reducing OCR misrecognition rates. This step must ensure that the enhancement process does not introduce additional artifacts while balancing speed and processing quality.

[0063] Irregularity correction primarily addresses deformation issues caused by factors such as shooting angle, document folding, and curling during the collection process of restaurant invoices. Common distortions in shooting scenarios include trapezoidal distortion, curvature distortion, and local warping. These distortions affect the straightness of text lines, thus reducing the accuracy of text detection and recognition. The correction process typically begins by locating the edges of the document using edge detection (Canny, Sobel operators) or Hough line transform, then calculating the precise positions of the four corner points, and using perspective transformation to restore the trapezoidal shape to a rectangular image. For curvature distortion or local creases, methods based on thin plate spline (TPS) or mesh deformation correction can be used to achieve smoothing by predicting the positions of local control points. In deep learning, geometric correction networks (such as Spatial Transformer Network, STN) can also be used for end-to-end correction of the entire image. The entire correction process must ensure that the text proportions are not excessively stretched or deformed, while preserving the original clarity and edge information of the document.

[0064] Region filtering aims to remove irrelevant background information from restaurant invoice images, such as desktops, hands, other receipts, and shadows, thereby reducing misidentification and computational redundancy in the OCR stage. The conventional approach is to first detect and crop the receipt, using color- and edge-based image segmentation methods to quickly locate the valid boundaries. However, due to significant differences in receipt color and background lighting in real-world scenarios, traditional methods are easily limited. Therefore, a better solution is to use deep semantic segmentation models (such as U-Net, DeepLabV3+, and Mask R-CNN) to perform pixel-level segmentation of the receipt, accurately separating the valid receipt area from the background. After segmentation, the edges can be appropriately expanded (dilated) to prevent text truncation, followed by precise cropping to obtain a standardized receipt image. For situations with transparent plastic film or reflections, reflection suppression processing (such as multi-channel fusion or polarization filtering simulation) can be performed before region filtering. Region filtering not only improves OCR accuracy but also reduces noise interference in subsequent NLP processing, enhancing the overall system's recognition stability and execution efficiency.

[0065] Through the above steps, key information of catering invoices can be extracted with high precision under various formats and complex interference backgrounds, thereby improving the reliability and automation of subsequent compliance judgments.

[0066] Further, according to the non-standard data features in the preliminary text set, the steps of entity recognition and entity association are performed on the preliminary text set to determine the key-value pairs of the dish names corresponding to the dish prices, and the structured field mapping relationship is obtained, specifically including:

[0067] Identify the non-standard data in the preliminary text set and extract the features of the non-standard data;

[0068] Based on the features of the non-standard data, use regular expressions to segment the non-standard data and extract the candidate text segments containing the dish names and dish prices;

[0069] Perform semantic segmentation on the candidate text segments through a convolutional neural network model to determine the semantic boundaries of the candidate text segments;

[0070] Based on the semantic boundaries, use a named entity recognition algorithm to extract the dish name and dish price information, generate an initial key-value pair set, and obtain the structured field mapping relationship.

[0071] In this embodiment, first, non-standard feature analysis is performed on the preliminary text set, including detecting dish abbreviations (such as "Gongji"), misspelled words, dialect expressions (such as "Yangyu"), and the mixing of numbers and symbols, etc., and extracting their features, such as character patterns, word frequency distributions, context position relationships, etc. Subsequently, using a preset regular expression template combined with these features, the original text is segmented into candidate segments that may contain dish names and prices, for example, matching based on the pattern of "text + number + yuan" or "text + number". For these candidate segments, a convolutional neural network (CNN) is used for semantic segmentation to accurately divide the boundary positions of different fields, ensuring the independence of information such as dish names, quantities, and unit prices in space and semantics. Finally, based on the segmented semantic boundaries, a customized named entity recognition (NER) model in the catering field (such as BERT+CRF) is called to automatically extract the dish name and dish price, and pair the two to generate an initial key-value pair set, constructing a structured field mapping relationship.

[0072] Through the above steps, the corresponding relationship between dishes and prices can be accurately extracted under different bill formats and non-standard expressions, significantly improving the accuracy and stability of data structuring.

[0073] Further, the steps of using regular expressions to segment the non-standard data based on the features of the non-standard data and extracting the candidate text segments containing the dish names and dish prices specifically include:

[0074] Design a regular expression according to the features of the non-standard data. Among them, the regular expression can extract the information segments that meet the requirements from the text based on specific pattern matching rules;

[0075] Segment the initial text collection using the designed regular expression to obtain several text segments;

[0076] By matching the text segments with the regular expression, the text segments containing the dish names and dish prices are segmented from the whole text to form candidate text segments.

[0077] In this embodiment, first analyze the common forms of non-standard data in catering bills, including various delimiters (spaces, tab characters, dot symbols, hyphens) that may exist between the dish name and price, the diverse representations of numbers and currency symbols (such as "¥48", "48 yuan", "48.00"), and the cases of dish abbreviations or mixed languages. Based on these features, construct a flexible regular expression pattern, such as ([^\d]+)(\d+(\.\d{1,2}))(yuan|¥) to capture the "dish name + price" structure, or ([^\d]+)(\d+)[xX](\d+) to capture the "dish name + quantity + unit price" structure. Subsequently, apply this regular expression to the initial text collection for segmentation, decomposing the long text into multiple smaller text segments for more precise matching of the combinations containing dish names and prices. During the matching process, a multi-round matching and filtering mechanism can be combined to ensure that only logically reasonable candidate segments are retained, such as removing non-dish category descriptions (such as "service fee", "private room fee") or records with abnormal prices, thereby generating a clean and structured set of candidate text segments.

[0078] Through the above steps, the combination of dishes and prices can be effectively and accurately separated from complex non-standard texts, reducing noise interference and improving the accuracy of subsequent information extraction.

[0079] Furthermore, the steps of determining the semantic boundaries of the candidate text segments through a convolutional neural network model for semantic segmentation specifically include:

[0080] Construct and train a convolutional neural network model, where the convolutional neural network model is used for feature extraction and semantic understanding of the candidate text segments;

[0081] Input the candidate text segments into the trained convolutional neural network model to obtain the feature map of the candidate text segments;

[0082] According to the feature map, use a semantic segmentation algorithm to determine the semantic boundaries of the candidate text segments, where the semantic boundaries divide the candidate text segments into different semantic units, further refining the extraction of dish name and dish price information.

[0083] In this embodiment, a convolutional neural network (CNN) model is first constructed based on the restaurant receipt scenario. Its input consists of candidate text fragment images or character embedding sequences extracted using regular expressions. The model includes multiple convolutional and pooling layers to extract low-level local features (such as stroke structure, number shape, and character spacing patterns) and high-level semantic features (such as the relative layout of dish names and prices). During the training phase, sample data labeled with "dish name region" and "price region" can be used, and the segmentation accuracy is optimized using the cross-entropy loss function or the Di ce coefficient. In the inference phase, the candidate text fragments are input into the trained model to generate corresponding feature maps. Then, a semantic segmentation algorithm (such as Fully Convolutional Network, U-Net, or DeepLab) is used to predict the semantic label for each pixel or character position, thereby determining the boundary position between the dish name and the dish price. This process can not only distinguish closely arranged text within the same line but also handle boundary blurring caused by scanning errors, font variations, and misalignment, ensuring accurate and reliable extraction results.

[0084] By following the steps above, the boundaries of dishes and prices in the candidate segments can be accurately defined, thereby providing higher quality input for subsequent entity recognition and significantly improving the accuracy of structured data generation.

[0085] Further, please refer to Figure 3 The process involves obtaining user dining data from a structured, complete invoice dataset, selecting rule parameters applicable to the catering scenario from a pre-established dynamic rule base, and determining whether the user dining data conforms to the rule parameters to obtain a preliminary compliance assessment result. Specifically, this includes:

[0086] S301, extract detailed information about the user's dining from the structured complete invoice dataset to obtain user dining data, which includes, but is not limited to, the number of diners, details of the dishes, unit price, quantity, and total amount;

[0087] S302, access the pre-established dynamic rule base, which stores the preset rule parameters for different catering scenarios. The rule parameters involve the upper limit of dish price, the limit of total amount of a single meal, and the consumption frequency of specific types of dishes in different catering scenarios.

[0088] S303, Select appropriate rule parameters from the dynamic rule base based on the catering scenario to which the current catering invoice belongs;

[0089] S304 compares the extracted user dining data with the rule parameters one by one, checks whether each piece of dining data meets the rule requirements, records all violations or data points that exceed the rule limits, and forms a preliminary compliance assessment result.

[0090] In this embodiment, the system first parses the structured complete invoice dataset to extract the core elements of the user's dining experience, including the restaurant name, dining date, number of diners, name of each dish, unit price, quantity, and calculated total amount. This data undergoes logical validation (e.g., unit price × quantity = subtotal) before entering the rule matching process. Subsequently, the system accesses a dynamic rule base, which is categorized according to dining scenarios, such as daily business meals, holiday gatherings, client entertainment, and high-end dining. Each scenario is configured with different parameters, including upper limits on dish unit prices, single-trip total amount limits, and consumption frequency thresholds for specific dishes (e.g., expensive ingredients no more than once per month). The system automatically selects the matching set of rule parameters based on the dining scenario tag of the current invoice (which can be inferred from restaurant records, number of diners, and dish combinations). In the rule comparison stage, the system matches and verifies each user's dining data against the selected rule parameters. For example, it checks for violations such as excessive unit price, excessive total amount, prohibited dishes being included, or high-frequency consumption. The system also generates structured abnormal data items for each violation record, including field name, violation type, and extent of exceeding the limit. Finally, it forms a preliminary compliance assessment result for use in the dynamic rule adjustment and manual review stages.

[0091] A company's finance system received a restaurant invoice submitted by an employee. After parsing the invoice information, it showed: the restaurant name was "Seaview Fishing Port Hotel," the dining date was June 18, 2025, the number of diners was 4, and the dishes included one serving of "Steamed Lobster" (880 yuan), two servings of "Abalone Rice" (260 yuan each), and one serving of "Stir-fried Seasonal Vegetables" (38 yuan each), totaling 1,438 yuan. The system first performed a logical validation on the data (880×1+260×2+38×1=1,438 yuan, validation passed). Then, the system accessed the dynamic rule base and, based on the restaurant's records and the type of dishes, determined that the scenario belonged to the "Business Hospitality Dining" category. This category's rules are set as follows: the unit price of a single dish cannot exceed 600 yuan, the total amount cannot exceed 1,200 yuan, and the frequency of consumption for dishes containing rare seafood cannot exceed once per quarter. After comparing each item, the system found that the price of "steamed lobster" at 880 yuan exceeded the 600 yuan limit, and the total amount of 1,438 yuan also exceeded the total limit. Furthermore, historical records showed that the employee had already reimbursed one banquet that included lobster this quarter. The system generated structured exception fields for these three violations, including field names (dish price, total amount, frequency of rare dishes), violation type (exceeding price, exceeding total amount, exceeding frequency), and the extent of exceeding the limit (+280 yuan, +238 yuan, +1 time), ultimately forming a preliminary compliance assessment result.

[0092] By following the steps above, irregular consumption behaviors can be quickly identified in different dining scenarios, enabling flexible and efficient initial screening of fee compliance.

[0093] Furthermore, the steps for extracting abnormal fields from the preliminary compliance assessment results, and determining the adjusted rule set by dynamically updating rule parameters based on historical data patterns using a rule adjustment mechanism, specifically include:

[0094] Identify fields marked as anomalous in the preliminary compliance assessment results. Anomalous fields refer to data points in user dining data that do not meet the requirements of the rule parameters.

[0095] Count the number of abnormal fields. If the number of abnormal fields is greater than zero, activate the rule adjustment mechanism.

[0096] Access the historical database to obtain historical data patterns similar to the current catering invoice scenario. The historical data patterns include historical compliance records, anomaly handling cases, and rule adjustment trends.

[0097] Historical data features are extracted from historical data patterns. These features can reflect the distribution patterns and compliance trends of user dining data in different catering scenarios.

[0098] A machine learning model is trained using historical data features, wherein the machine learning model is configured to predict the direction and magnitude of adjustment of rule parameters based on the input historical data patterns;

[0099] The current scenario features of restaurant invoices are input into a trained machine learning model to obtain suggestions for adjusting the predicted rule parameters;

[0100] Based on the rule parameter adjustment suggestions, the original rule parameters are fine-tuned to generate an adjusted rule set.

[0101] In this embodiment, when the system detects one or more abnormal fields in the preliminary compliance assessment results, it triggers a dynamic rule adjustment mechanism to prevent fixed rules from failing to adapt to changes in real-world business scenarios. First, the system extracts and categorizes all abnormal fields, such as "unit price exceeding limits," "total amount exceeding limits," and "abnormal frequency of dishes," and records the degree of numerical deviation. Next, the system accesses the historical database to retrieve historical records highly similar to the current invoice's catering scenario. These records not only contain the proportion of compliant and non-compliant data but also the results of historical manual intervention adjustments and long-term rule change trends. The system extracts features from this historical data, such as dish price distribution curves, seasonal price changes for specific cuisines, and per capita consumption differences among different consumer groups. Then, a machine learning model (such as a gradient boosting tree, random forest, or deep neural network) trained using these features predicts the direction (relaxation or tightening) and magnitude (percentage or amount range of adjustment) of the rule parameters based on the input historical patterns and current scenario characteristics. Finally, the system applies the prediction results to the original rule set to generate an adjusted rule set that better fits the current consumption environment, thereby improving the accuracy and rationality of judgments in subsequent verification stages.

[0102] By following the steps above, the rule parameters can be adaptively updated as the scenario changes, improving the flexibility and accuracy of compliance judgment.

[0103] In the above embodiments, this application discloses a method for expense accounting, belonging to the field of financial accounting technology. First, the system can automatically collect and process raw image data, accurately extracting key data such as restaurant name, menu information, price, and date through advanced image preprocessing and text recognition technologies. Second, based on entity recognition and association technologies, the system can transform unstructured text into structured field mapping relationships, and then fill in fuzzy or missing information through contextual information filling to ensure data integrity and accuracy. Then, the system utilizes a dynamic rule base to flexibly select and apply compliance rules for different catering scenarios, automatically determining whether dining data meets preset standards, achieving intelligent preliminary compliance assessment. When abnormal fields are detected, the system can also dynamically adjust rule parameters based on historical data patterns using machine learning technology. Finally, a secondary matching mechanism ensures that all dining data is re-verified within the adjusted rule framework, significantly improving the accuracy of expense accounting and risk control capabilities. This application not only improves financial audit efficiency and reduces manual intervention but also enhances the transparency and standardization of expense reimbursement, reduces the risk of irregular reimbursement, and provides data support and intelligent assurance for corporate financial management.

[0104] In this embodiment, the cost accounting processing method operates on electronic devices (e.g., Figure 1The server shown can receive commands or acquire data via wired or wireless connections. It should be noted that the aforementioned wireless connection methods may include, but are not limited to, 3G / 4G connections, Wi-Fi connections, Bluetooth connections, Wi-Fi connections, Zigbee connections, UWB (ultra-Width band) connections, and other currently known or future wireless connection methods.

[0105] It should be emphasized that, to further ensure the privacy and security of the aforementioned fee information, this fee information can also be stored in a blockchain node.

[0106] The blockchain referred to in this application is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying blockchain platform, a platform product service layer, and an application service layer.

[0107] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0108] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0109] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware through computer-readable instructions. These computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the methods described above. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, optical disk, or read-only memory (ROM), or random access memory (RAM).

[0110] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0111] Further reference Figure 4 As a response to the above Figure 2 To implement the method shown, this application provides an embodiment of a cost accounting processing device, which is similar to... Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.

[0112] like Figure 4 As shown, the cost calculation and processing device 400 described in this embodiment includes:

[0113] Image processing module 401 is used to collect the original image data of the catering invoice and perform preliminary text parsing on the original image data to obtain a preliminary text set containing the restaurant name, dish information, dish price and order date.

[0114] The structure module 402 is used to perform entity recognition and entity association on the preliminary text set based on the non-standardized data features in the preliminary text set, determine the key-value pairs of dish names and corresponding dish prices, and obtain structured field mapping relationships.

[0115] The context filling module 403 is used to extract fuzzy or missing items from the structured field mapping relationship, and use context filling to fill in the fuzzy or missing items to obtain a structured complete invoice dataset.

[0116] The preliminary assessment module 404 is used to obtain user dining data from a structured complete invoice dataset, select rule parameters applicable to the catering scenario from a pre-established dynamic rule base, and determine whether the user dining data meets the rule parameters to obtain a preliminary compliance assessment result. The rule parameters include the price ceiling and the total amount range.

[0117] The rule adjustment module 405 is used to extract abnormal fields from the preliminary compliance assessment results. If the number of abnormal fields is greater than zero, the rule adjustment mechanism is used to dynamically update the rule parameters according to the historical data pattern to determine the adjusted rule set.

[0118] The secondary evaluation module 406 is used to determine whether all fields of the user's dining data meet the adjusted rule set by performing a secondary matching process between the adjusted rule set and the user's dining data, and to obtain the final compliance verification result.

[0119] Furthermore, the image processing module 401 specifically includes:

[0120] The preprocessing unit is used to acquire the raw image data of the catering invoice and preprocess the raw image data. The preprocessing includes image denoising and enhancement, irregularity correction and region filtering.

[0121] The text region processing unit is used to perform text region recognition and segmentation on the preprocessed original image data to obtain several text blocks;

[0122] The semantic association unit is used to perform semantic association on several text blocks respectively, and to obtain the text block association information containing restaurant name, menu information, menu price and order date from the semantic association results, thus obtaining a preliminary text set.

[0123] Furthermore, the structured module 402 specifically includes:

[0124] The data recognition unit is used to identify non-standardized data in the initial text set and extract the features of the non-standardized data;

[0125] The regularization processing unit is used to segment non-standardized data based on its features using regular expressions, and extract candidate text fragments containing dish names and prices.

[0126] The semantic segmentation unit is used to perform semantic segmentation on candidate text segments using a convolutional neural network model and to determine the semantic boundaries of the candidate text segments.

[0127] The named entity recognition unit is used to extract dish names and price information based on semantic boundaries using named entity recognition algorithms, generate an initial set of key-value pairs, and obtain structured field mapping relationships.

[0128] Furthermore, the regularization processing unit specifically includes:

[0129] The regular expression building subunit is used to design regular expressions based on the characteristics of non-standardized data. Regular expressions can extract information fragments that meet the requirements from text based on specific pattern matching rules.

[0130] The text segmentation processing subunit is used to apply pre-designed regular expressions to segment the initial text set into several text fragments;

[0131] The text segmentation subunit is used to segment text fragments containing dish names and prices from the whole text by matching text fragments with regular expressions, forming candidate text fragments.

[0132] Furthermore, the semantic segmentation unit specifically includes:

[0133] The model training subunit is used to build and train the convolutional neural network model, which is used to extract features and understand semantics from candidate text segments.

[0134] The text input subunit is used to input candidate text segments into the trained convolutional neural network model to obtain feature maps of the candidate text segments;

[0135] The semantic boundary recognition subunit is used to determine the semantic boundary of candidate text segments based on the feature map and a semantic segmentation algorithm. The semantic boundary divides the candidate text segments into different semantic units, further refining the extraction of dish names and price information.

[0136] Further, please refer to Figure 5 The preliminary assessment module 404 specifically includes:

[0137] The dining data acquisition unit 501 is used to extract detailed dining information from the structured complete invoice dataset to obtain user dining data, which includes, but is not limited to, the number of diners, dish details, unit price, quantity, and total amount.

[0138] The rule base access unit 502 is used to access a pre-established dynamic rule base, which stores preset rule parameters for different catering scenarios. The rule parameters involve the upper limit of dish prices, the limit of total amount for a single meal, and the consumption frequency of specific types of dishes in different catering scenarios.

[0139] The adaptation rule unit 503 is used to select adaptation rule parameters from the dynamic rule library based on the catering scenario to which the current catering invoice belongs;

[0140] The rule matching unit 504 is used to compare the extracted user dining data with the rule parameters one by one, check whether each piece of dining data meets the rule requirements, record all violations or data points that exceed the rule limits, and form a preliminary compliance assessment result.

[0141] Furthermore, the rule adjustment module 405 specifically includes:

[0142] The abnormal field identification unit is used to identify fields marked as abnormal in the preliminary compliance assessment results. Abnormal fields refer to data points in user dining data that do not meet the requirements of the rule parameters.

[0143] The abnormal field statistics unit is used to count the number of abnormal fields. If the number of abnormal fields is greater than zero, the rule adjustment mechanism will be activated.

[0144] The historical data pattern unit is used to access the historical database and obtain historical data patterns of scenarios similar to the current catering invoice. The historical data patterns include historical compliance records, anomaly handling cases, and rule adjustment trends.

[0145] The historical data feature unit is used to extract historical data features from historical data patterns. These historical data features can reflect the distribution patterns and compliance trends of user dining data in different catering scenarios.

[0146] A machine learning unit is used to train a machine learning model using features of historical data, wherein the machine learning model is configured to predict the direction and magnitude of adjustment of rule parameters based on the patterns of the input historical data.

[0147] The adjustment suggestion unit is used to input the scenario features of the current catering invoice into the trained machine learning model to obtain the predicted rule parameter adjustment suggestions;

[0148] The rule parameter fine-tuning unit is used to fine-tune the original rule parameters based on the rule parameter adjustment suggestions, and generate the adjusted rule set.

[0149] In the above embodiments, this application discloses a cost accounting processing device, belonging to the field of financial accounting technology. First, the system can automatically collect and process raw image data, accurately extracting key data such as restaurant name, menu information, price, and date through advanced image preprocessing and text recognition technologies. Second, based on entity recognition and association technologies, the system can transform unstructured text into structured field mapping relationships, and then fill in fuzzy or missing information through contextual information filling to ensure data integrity and accuracy. Then, the system utilizes a dynamic rule base to flexibly select and apply compliance rules for different catering scenarios, automatically determining whether dining data meets preset standards, achieving intelligent preliminary compliance assessment. When abnormal fields are detected, the system can also dynamically adjust rule parameters based on historical data patterns using machine learning technology. Finally, a secondary matching mechanism ensures that all dining data is re-verified within the adjusted rule framework, significantly improving the accuracy of cost accounting and risk control capabilities. This application not only improves financial audit efficiency and reduces manual intervention but also enhances the transparency and standardization of expense reimbursement, reduces the risk of irregular reimbursement, and provides data support and intelligent assurance for enterprise financial management.

[0150] To address the aforementioned technical problems, embodiments of this application also provide a computer device. Please refer to [link / reference needed]. Figure 6 , Figure 6 This is a basic structural block diagram of the computer device in this embodiment.

[0151] The computer device 6 includes a memory 61, a processor 62, and a network interface 63 that are interconnected via a system bus. It should be noted that only the computer device 6 with memory 61, processor 62, and network interface 63 is shown in the figure; however, it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented alternatively. Those skilled in the art will understand that the computer device described here is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0152] The computer device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device can interact with the user via a keyboard, mouse, remote control, touchpad, or voice control.

[0153] The memory 61 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 61 may be an internal storage unit of the computer device 6, such as the hard disk or memory of the computer device 6. In other embodiments, the memory 61 may also be an external storage device of the computer device 6, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 6. Of course, the memory 61 may include both the internal storage unit and its external storage device of the computer device 6. In this embodiment, the memory 61 is typically used to store the operating system and various application software installed on the computer device 6, such as computer-readable instructions for cost accounting processing methods. In addition, the memory 61 can also be used to temporarily store various types of data that have been output or will be output.

[0154] In some embodiments, the processor 62 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 62 is typically used to control the overall operation of the computer device 6. In this embodiment, the processor 62 is used to execute computer-readable instructions stored in the memory 61 or to process data, for example, to execute computer-readable instructions for the cost accounting processing method.

[0155] The network interface 63 may include a wireless network interface or a wired network interface, which is typically used to establish communication connections between the computer device 6 and other electronic devices.

[0156] This application also provides an embodiment, namely, a computer device including a memory and a processor. The memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, it implements the steps of the above-described cost calculation processing method, that is, it implements:

[0157] A cost accounting method, comprising:

[0158] Collect raw image data from restaurant invoices and perform preliminary text parsing on the raw image data to obtain a preliminary text set containing restaurant name, dish information, dish price, and order date;

[0159] Based on the non-standardized data characteristics in the preliminary text set, entity recognition and entity association are performed on the preliminary text set to determine the key-value pairs of dish names corresponding to dish prices, and to obtain structured field mapping relationships.

[0160] Extract fuzzy or missing items from the structured field mapping relationship, and use context filling to supplement the fuzzy or missing items to obtain a complete structured invoice dataset;

[0161] User dining data is obtained from a structured complete invoice dataset. Rule parameters applicable to the catering scenario are selected from a pre-established dynamic rule base. The user dining data is then judged to determine whether it conforms to the rule parameters, and a preliminary compliance assessment result is obtained. The rule parameters include the price ceiling and the total amount range.

[0162] Extract abnormal fields from the preliminary compliance assessment results. If the number of abnormal fields is greater than zero, use a rule adjustment mechanism to dynamically update the rule parameters based on historical data patterns to determine the adjusted rule set.

[0163] By performing a secondary matching process between the adjusted rule set and the user's dining data, it is determined whether all fields of the user's dining data meet the adjusted rule set, and the final compliance verification result is obtained.

[0164] This application also provides another embodiment, namely, a computer-readable storage medium storing computer-readable instructions that can be executed by at least one processor to cause the at least one processor to perform the steps of the cost calculation processing method described above, i.e., to implement:

[0165] A cost accounting method, comprising:

[0166] Collect raw image data from restaurant invoices and perform preliminary text parsing on the raw image data to obtain a preliminary text set containing restaurant name, dish information, dish price, and order date;

[0167] Based on the non-standardized data characteristics in the preliminary text set, entity recognition and entity association are performed on the preliminary text set to determine the key-value pairs of dish names corresponding to dish prices, and to obtain structured field mapping relationships.

[0168] Extract fuzzy or missing items from the structured field mapping relationship, and use context filling to supplement the fuzzy or missing items to obtain a complete structured invoice dataset;

[0169] User dining data is obtained from a structured complete invoice dataset. Rule parameters applicable to the catering scenario are selected from a pre-established dynamic rule base. The user dining data is then judged to determine whether it conforms to the rule parameters, and a preliminary compliance assessment result is obtained. The rule parameters include the price ceiling and the total amount range.

[0170] Extract abnormal fields from the preliminary compliance assessment results. If the number of abnormal fields is greater than zero, use a rule adjustment mechanism to dynamically update the rule parameters based on historical data patterns to determine the adjusted rule set.

[0171] By performing a secondary matching process between the adjusted rule set and the user's dining data, it is determined whether all fields of the user's dining data meet the adjusted rule set, and the final compliance verification result is obtained.

[0172] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0173] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0174] It should be noted that the software tools or components not belonging to this company that appear in the various embodiments of this application are merely illustrative examples and do not represent actual use.

[0175] Obviously, the embodiments described above are only some embodiments of this application, not all embodiments. The accompanying drawings show preferred embodiments of this application, but do not limit the patent scope of this application. This application can be implemented in many different forms; rather, the purpose of providing these embodiments is to provide a more thorough and comprehensive understanding of the disclosure of this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this application's specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this application.

Claims

1. A method for cost accounting, characterized in that, include: Collect the original image data of the restaurant invoice and perform preliminary text parsing on the original image data to obtain a preliminary text set containing the restaurant name, dish information, dish price and order date; Based on the non-standardized data features in the preliminary text set, entity recognition and entity association are performed on the preliminary text set to determine the key-value pairs of dish names corresponding to dish prices, thereby obtaining a structured field mapping relationship; Extract fuzzy or missing items from the structured field mapping relationship, and use context filling to supplement the fuzzy or missing items to obtain a structured complete invoice dataset; User dining data is obtained from the structured complete invoice dataset. Rule parameters applicable to the catering scenario are selected from the pre-established dynamic rule base. The user dining data is then judged to determine whether it conforms to the rule parameters, and a preliminary compliance assessment result is obtained. The rule parameters include the price ceiling and the total amount range. Anomaly fields are extracted from the preliminary compliance assessment results. If the number of anomaly fields is greater than zero, the rule adjustment mechanism is used to dynamically update the rule parameters based on historical data patterns to determine the adjusted rule set. By performing a secondary matching process between the adjusted rule set and the user's dining data, it is determined whether all fields of the user's dining data meet the adjusted rule set, and the final compliance verification result is obtained.

2. The cost accounting method as described in claim 1, characterized in that, The steps of collecting the original image data of restaurant invoices and performing preliminary text parsing on the original image data to obtain a preliminary text set containing the restaurant name, menu information, menu prices, and order date specifically include: The original image data of the catering invoice is collected, and the original image data is preprocessed, wherein the preprocessing includes image denoising and enhancement, irregularity correction and region filtering; The preprocessed original image data is subjected to text region recognition and segmentation to obtain several text blocks; Semantic association is performed on several text blocks respectively, and text block association information containing restaurant name, dish information, dish price and order date is obtained from the semantic association results to obtain the preliminary text set.

3. The cost accounting method as described in claim 1, characterized in that, The step of performing entity recognition and entity association on the preliminary text set based on the non-standardized data features in the preliminary text set, determining the key-value pairs of dish names corresponding to dish prices, and obtaining structured field mapping relationships specifically includes: Identify non-standardized data in the preliminary text set and extract features from the non-standardized data; Based on the characteristics of the non-standardized data, regular expressions are used to segment the non-standardized data and extract candidate text fragments containing dish names and dish prices. The candidate text segments are semantically segmented using a convolutional neural network model to determine their semantic boundaries. Based on the semantic boundaries, a named entity recognition algorithm is used to extract dish names and price information, generate an initial set of key-value pairs, and obtain the structured field mapping relationship.

4. The cost accounting method as described in claim 3, characterized in that, The step of segmenting the non-standardized data using regular expressions based on its features and extracting candidate text fragments containing dish names and prices specifically includes: Based on the characteristics of the non-standardized data, a regular expression is designed, wherein the regular expression can extract information fragments that meet the requirements from the text based on specific pattern matching rules. The initial text set is segmented using pre-designed regular expressions to obtain several text fragments; By matching the text fragments with the regular expression, the text fragments containing dish names and prices are segmented from the whole text to form the candidate text fragments.

5. The cost accounting method as described in claim 3, characterized in that, The step of semantically segmenting the candidate text segments using a convolutional neural network model and determining the semantic boundaries of the candidate text segments specifically includes: Convolutional neural network model is constructed and trained, wherein the convolutional neural network model is used to extract features and understand semantics of candidate text segments; The candidate text fragments are input into a trained convolutional neural network model to obtain feature maps of the candidate text fragments; Based on the feature map, a semantic segmentation algorithm is used to determine the semantic boundaries of the candidate text fragments, wherein the semantic boundaries divide the candidate text fragments into different semantic units, further refining the extraction of dish names and dish price information.

6. The cost accounting method as described in claim 1, characterized in that, The steps of obtaining user dining data from the structured complete invoice dataset, selecting rule parameters applicable to the catering scenario from a pre-established dynamic rule base, and determining whether the user dining data conforms to the rule parameters to obtain a preliminary compliance assessment result specifically include: Detailed information about the user's dining experience is extracted from the structured complete invoice dataset to obtain the user dining data, which includes, but is not limited to, the number of diners, the details of the dishes, the unit price, the quantity, and the total amount. Access a pre-established dynamic rule base, which stores preset rule parameters for different dining scenarios. These rule parameters include the upper limit of dish prices, the limit of total amount for a single meal, and the frequency of consumption of specific types of dishes for different dining scenarios. Based on the catering scenario to which the current catering invoice belongs, select appropriate rule parameters from the dynamic rule base; The extracted user dining data is compared one by one with the corresponding rule parameters to check whether each piece of dining data meets the rule requirements. All violations or data points that exceed the rule limits are recorded to form a preliminary compliance assessment result.

7. The cost accounting method as described in claim 1, characterized in that, The step of extracting abnormal fields from the preliminary compliance assessment results, and if the number of abnormal fields is greater than zero, dynamically updating the rule parameters based on historical data patterns using a rule adjustment mechanism to determine the adjusted rule set, specifically includes: Identify the fields marked as abnormal in the preliminary compliance assessment results, wherein the abnormal fields represent data points in the user dining data that do not meet the requirements of the rule parameters; Count the number of the abnormal fields. If the number of abnormal fields is greater than zero, initiate the rule adjustment mechanism. Access the historical database to obtain historical data patterns similar to the current catering invoice scenario. The historical data patterns include historical compliance records, anomaly handling cases, and rule adjustment trends. Historical data features are extracted from the historical data patterns, whereby the historical data features can reflect the distribution patterns and compliance trends of user dining data in different catering scenarios. A machine learning model is trained using the historical data features, wherein the machine learning model is configured to predict the adjustment direction and magnitude of rule parameters based on the input historical data patterns; The current scenario features of restaurant invoices are input into a trained machine learning model to obtain suggestions for adjusting the predicted rule parameters; Based on the rule parameter adjustment suggestions, the original rule parameters are fine-tuned to generate the adjusted rule set.

8. A cost accounting processing device, characterized in that, include: The image processing module is used to collect the original image data of the restaurant invoice and perform preliminary text parsing on the original image data to obtain a preliminary text set containing the restaurant name, dish information, dish price and order date. The structuring module is used to perform entity recognition and entity association on the preliminary text set based on the non-standardized data features in the preliminary text set, determine the key-value pairs of dish names and dish prices, and obtain a structured field mapping relationship. The context filling module is used to extract ambiguous or missing items from the structured field mapping relationship, and use context filling to fill in the ambiguous or missing items to obtain a structured complete invoice dataset; The preliminary assessment module is used to obtain user dining data from the structured complete invoice dataset, select rule parameters applicable to the catering scenario from a pre-established dynamic rule base, and determine whether the user dining data conforms to the rule parameters to obtain a preliminary compliance assessment result. The rule parameters include a price ceiling and a total amount range. The rule adjustment module is used to extract abnormal fields from the preliminary compliance assessment results. If the number of abnormal fields is greater than zero, the rule adjustment mechanism is used to dynamically update the rule parameters according to historical data patterns to determine the adjusted rule set. The secondary evaluation module is used to determine whether all fields of the user's dining data meet the adjusted rule set by performing a secondary matching process between the adjusted rule set and the user's dining data, and to obtain the final compliance verification result.

9. A computer device, characterized in that, The device includes a memory and a processor, wherein the memory stores computer-readable instructions, and the processor executes the computer-readable instructions to implement the steps of the cost accounting processing method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the cost accounting processing method as described in any one of claims 1 to 7.