Bill accounting method and device, electronic equipment and storage medium

文档序号:8448 发布日期:2021-09-17 浏览:27次 中文

1. A bill accounting method, the method comprising:

extracting text information from the bill image based on optical character recognition;

extracting bill basic data in the text information;

and performing bill accounting on the bill basic data based on a domain-specific language to complete the checking of income and expenditure of the bill basic data.

2. The method of claim 1, wherein extracting text information from the billing image based on optical character recognition comprises:

extracting bill keywords in a picture or an image frame of the bill image through an optical character recognition model;

determining whether the picture or the image frame belongs to a bill based on a bill keyword in the picture;

storing pictures or image frames belonging to the bill into an image list;

and extracting text information of the pictures or the image frames in the image list through an optical character recognition model.

3. The method of claim 2, wherein prior to said extracting a billing keyword in a picture or image frame of the billing image by an optical character recognition model, the method further comprises:

acquiring a training bill picture;

marking corresponding texts in the training bill pictures through text boxes to obtain marked training data;

obtaining a text box detection model based on deep learning training by adopting the labeled training data, wherein the text box detection model is used for detecting a text box;

and acquiring a text recognition model based on convolutional recurrent neural network training by adopting the labeled training data, wherein the text recognition model is used for recognizing text information in the bill image.

4. The method of claim 1, wherein the extracting the billing basic data in the text message comprises:

packaging the text information into a bill text list;

determining matching parameters of the bill text list;

and extracting the bill basic data in the text information based on the matching parameters.

5. The method of claim 4, wherein the matching parameters include a billing keyword, a delimiter, a text interval and an index, and wherein the extracting the billing base data in the text information based on the matching parameters comprises:

respectively determining text items of different operations in the bill text list according to the bill keywords;

marking the index for the text item of the different operation;

separating the text items of the different operations by the separators;

and starting from the index, extracting numerical values corresponding to the different operations needing to be checked based on the text interval and the index as basic data to assemble a bill data list, and using the bill data list as the bill basic data.

6. The method of claim 5, wherein the bill accounting of the bill base data based on a domain-specific language comprises:

traversing each variable in the bill base data;

classifying each variable based on different operation types, and respectively assembling the variables of different classifications into Map structure data based on the text intervals;

calling a domain-specific language computing interface, and transmitting the Map structure data and a summation formula to obtain a summation calculation result;

and checking the summation calculation result with the numerical values corresponding to the different operations.

7. The method of claim 6, wherein before the invoking the domain-specific language computation interface, importing the Map structure data and the summation formula to obtain a summation computation result, the method further comprises:

constructing an expression calculation engine for performing addition and subtraction operation based on a domain-specific language, wherein the expression calculation engine acquires an operator of an expression by inheriting Java;

and packaging the expression calculation engine to obtain the calculation interface.

8. A bill accounting apparatus, the apparatus comprising:

the text information extraction module is used for extracting text information from the bill image based on optical character recognition;

the basic data extraction module is used for extracting bill basic data in the text information;

and the accounting module is used for carrying out bill accounting on the bill basic data based on the domain-specific language so as to complete the check of the income and the expenditure of the bill basic data.

9. An electronic device comprising a memory having stored therein program instructions and a processor that, when executed, performs the steps of the method of any of claims 1-7.

10. A storage medium having stored thereon computer program instructions for executing the steps of the method according to any one of claims 1 to 7 when executed by a processor.

Background

In business credits and equity credits, customer qualification is primarily based on the influx and efflux of funds from the customer. Traditionally, a customer manager finds customers one by one and looks up the capital flow of the customers on site, and the offline mode is inefficient, thereby greatly increasing the difficulty of promoting finance. The internet-based thought greatly shortens the loan duration, and a user can submit data online and flow to a loan platform only by checking capital flow in a background. Based on background auditing in such a mode, a client manager also needs to check the running data submitted by the user one by one, and the running data of the user is checked by using a calculator or paper and other means to ensure that the number and the sum of the running data can be matched, but the prior art also has the problem of low bill checking efficiency caused by manual repetition.

Disclosure of Invention

In view of the above, an object of the embodiments of the present application is to provide a bill checking method, a bill checking device, an electronic device, and a storage medium, so as to solve the problem of low bill checking efficiency in the prior art.

The embodiment of the application provides a bill accounting method, which comprises the following steps: extracting text information from the bill image based on optical character recognition; extracting bill basic data in the text information; and performing bill accounting on the bill basic data based on a domain-specific language to complete the checking of income and expenditure of the bill basic data.

In the implementation mode, automatic text extraction is carried out on data uploaded by a client through optical character recognition, data operation is carried out based on the domain-specific language, and the calculation result is compared with the target to be checked, so that automatic checking of bills is realized, the bill checking efficiency is improved, and the bill checking efficiency is improved technically.

Optionally, the extracting text information from the bill image based on optical character recognition includes: extracting bill keywords in a picture or an image frame of the bill image through an optical character recognition model; determining whether the picture or the image frame belongs to a bill based on a bill keyword in the picture; storing pictures or image frames belonging to the bill into an image list; and extracting text information of the pictures or the image frames in the image list through an optical character recognition model.

In the implementation mode, the text information can be rapidly and accurately extracted by adopting the optical character recognition, and the bill is recognized by respectively recognizing the bill keywords on the picture and the video, so that the bill recognition accuracy and the subsequent accounting accuracy are improved, and the applicability of the method is ensured.

Optionally, before the extracting, by an optical character recognition model, the bill keyword in the picture or image frame of the bill image, the method further comprises: acquiring a training bill picture; marking corresponding texts in the training bill pictures through text boxes to obtain marked training data; obtaining a text box detection model based on deep learning training by adopting the labeled training data, wherein the text box detection model is used for detecting a text box; and acquiring a text recognition model based on convolutional recurrent neural network training by adopting the labeled training data, wherein the text recognition model is used for recognizing text information in the bill image.

In the implementation mode, the text box detection model is obtained based on deep learning training, the neural network model is introduced for optical character recognition, the accuracy of optical character recognition is improved, and therefore the accuracy of bill checking is guaranteed.

Optionally, the extracting the bill basic data in the text information includes: packaging the text information into a bill text list; determining matching parameters of the bill text list; and extracting the bill basic data in the text information based on the matching parameters.

In the implementation mode, the bill basic data in the text information is extracted through the matching parameters, and the data which do not belong to the bill accounting information in the text image can be eliminated, so that unnecessary data calculation is reduced, and the bill accounting accuracy and efficiency are improved.

Optionally, the matching parameters include a billing keyword, a delimiter, a text interval, and an index, and the extracting the billing basic data in the text information based on the matching parameters includes: respectively determining text items of different operations in the bill text list according to the bill keywords; marking the index for the text item of the different operation; separating the text items of the different operations by the separators; and starting from the index, extracting numerical values corresponding to the different operations needing to be checked based on the text interval and the index as basic data to assemble a bill data list, and using the bill data list as the bill basic data.

In the implementation mode, the bill data list is assembled based on text intervals, indexes and the like, and the numerical values corresponding to different operations are recorded in a classified mode, so that the calculation can be performed based on different operation types of the numerical values in the subsequent calculation process of bill calculation, and the accuracy of bill calculation is guaranteed.

Optionally, the performing bill accounting on the bill basic data based on the domain-specific language includes: traversing each variable in the bill base data; classifying each variable based on different operation types, and respectively assembling the variables of different classifications into Map structure data based on the text intervals; calling a domain-specific language computing interface, and transmitting the Map structure data and a summation formula to obtain a summation calculation result; and checking the summation calculation result with the numerical values corresponding to the different operations.

In the implementation mode, the operation types of the variables are classified through the traversal variables, so that the variables of each operation type can be classified and calculated, the numerical check is realized through the domain-specific language calculation interface, the mixing of the variables of different operation types can be avoided, and the bill accounting accuracy is improved.

Optionally, before the invoking the domain-specific language computing interface and the importing the Map structure data and the summation formula to obtain the summation computation result, the method further includes: constructing an expression calculation engine for performing addition and subtraction operation based on a domain-specific language, wherein the expression calculation engine acquires an operator of an expression by inheriting Java; and packaging the expression calculation engine to obtain the calculation interface.

In the implementation mode, the specific calculation can be carried out based on the transmitted summation formula after the expression calculation engine is constructed, and the expression calculation engine based on the characteristics of the domain-specific language can be flexibly matched with different calculation formulas, so that the bill accounting accuracy is improved.

An embodiment of the present application further provides a bill accounting device, the device includes: the text information extraction module is used for extracting text information from the bill image based on optical character recognition; the basic data extraction module is used for extracting bill basic data in the text information; and the accounting module is used for carrying out bill accounting on the bill basic data based on the domain-specific language so as to complete the check of the income and the expenditure of the bill basic data.

In the implementation mode, automatic text extraction is carried out on data uploaded by a client through optical character recognition, data operation is carried out based on the domain-specific language, and the calculation result is compared with the target to be checked, so that automatic checking of bills is realized, the bill checking efficiency is improved, and the bill checking efficiency is improved technically.

Optionally, the text information extraction module is specifically configured to: extracting bill keywords in a picture or an image frame of the bill image through an optical character recognition model; determining whether the picture or the image frame belongs to a bill based on a bill keyword in the picture; storing pictures or image frames belonging to the bill into an image list; and extracting text information of the pictures or the image frames in the image list through an optical character recognition model.

In the implementation mode, the text information can be rapidly and accurately extracted by adopting the optical character recognition, and the bill is recognized by respectively recognizing the bill keywords on the picture and the video, so that the bill recognition accuracy and the subsequent accounting accuracy are improved, and the applicability of the method is ensured.

Optionally, the bill accounting apparatus further includes: the model building module is used for obtaining a training bill picture; marking corresponding texts in the training bill pictures through text boxes to obtain marked training data; obtaining a text box detection model based on deep learning training by adopting the labeled training data, wherein the text box detection model is used for detecting a text box; and acquiring a text recognition model based on convolutional recurrent neural network training by adopting the labeled training data, wherein the text recognition model is used for recognizing text information in the bill image.

In the implementation mode, the text box detection model is obtained based on deep learning training, the neural network model is introduced for optical character recognition, the accuracy of optical character recognition is improved, and therefore the accuracy of bill checking is guaranteed.

Optionally, the basic data extracting module is specifically configured to: packaging the text information into a bill text list; determining matching parameters of the bill text list; and extracting the bill basic data in the text information based on the matching parameters.

In the implementation mode, the bill basic data in the text information is extracted through the matching parameters, and the data which do not belong to the bill accounting information in the text image can be eliminated, so that unnecessary data calculation is reduced, and the bill accounting accuracy and efficiency are improved.

Optionally, the basic data extracting module is specifically configured to: respectively determining text items of different operations in the bill text list according to the bill keywords; marking the index for the text item of the different operation; separating the text items of the different operations by the separators; and starting from the index, extracting numerical values corresponding to the different operations needing to be checked based on the text interval and the index as basic data to assemble a bill data list, and using the bill data list as the bill basic data.

In the implementation mode, the bill data list is assembled based on text intervals, indexes and the like, and the numerical values corresponding to different operations are recorded in a classified mode, so that the calculation can be performed based on different operation types of the numerical values in the subsequent calculation process of bill calculation, and the accuracy of bill calculation is guaranteed.

Optionally, the accounting module is specifically configured to: traversing each variable in the bill base data; classifying each variable based on different operation types, and respectively assembling the variables of different classifications into Map structure data based on the text intervals; calling a domain-specific language computing interface, and transmitting the Map structure data and a summation formula to obtain a summation calculation result; and checking the summation calculation result with the numerical values corresponding to the different operations.

In the implementation mode, the operation types of the variables are classified through the traversal variables, so that the variables of each operation type can be classified and calculated, the numerical check is realized through the domain-specific language calculation interface, the mixing of the variables of different operation types can be avoided, and the bill accounting accuracy is improved.

Optionally, the accounting module is specifically configured to: constructing an expression calculation engine for performing addition and subtraction operation based on a domain-specific language, wherein the expression calculation engine acquires an operator of an expression by inheriting Java; and packaging the expression calculation engine to obtain the calculation interface.

In the implementation mode, the specific calculation can be carried out based on the transmitted summation formula after the expression calculation engine is constructed, and the expression calculation engine based on the characteristics of the domain-specific language can be flexibly matched with different calculation formulas, so that the bill accounting accuracy is improved.

An embodiment of the present application further provides an electronic device, where the electronic device includes a memory and a processor, where the memory stores program instructions, and the processor executes steps in any one of the above implementation manners when reading and executing the program instructions.

The embodiment of the present application further provides a readable storage medium, in which computer program instructions are stored, and the computer program instructions are read by a processor and executed to perform the steps in any of the above implementation manners.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.

Fig. 1 is a schematic flowchart of a bill accounting method according to an embodiment of the present application.

Fig. 2 is a schematic flowchart of an optical character recognition text extraction step according to an embodiment of the present disclosure.

Fig. 3 is a flowchart illustrating steps of constructing an optical character recognition model according to an embodiment of the present disclosure.

Fig. 4 is a schematic flowchart of a bill basic data extracting step according to an embodiment of the present application.

Fig. 5 is a schematic flowchart of a bill accounting step according to an embodiment of the present application.

Fig. 6 is a block diagram of a bill accounting device according to an embodiment of the present disclosure.

Icon: 20-bill accounting means; 21-text information extraction module; 22-basic data extraction module; 23-accounting module.

Detailed Description

The technical solution in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.

An embodiment of the present application provides a bill accounting method, please refer to fig. 1, where fig. 1 is a schematic flow diagram of the bill accounting method provided in the embodiment of the present application, and the specific steps of the bill accounting method may be as follows:

step S12: text information is extracted from the billing image based on optical character recognition.

In financial credit business, such as business loan, it is usually necessary to check business analysis data uploaded by a user to ensure that the data and data uploaded by the user are real, at this time, the user may upload a picture or a recorded video, and if there is no automatic reconciliation function, it is necessary for business personnel to perform addition and subtraction operations on the data of each page by using a calculator or paper to ensure the authenticity of information provided by the user, which is inefficient and cannot realize automation. Therefore, the embodiment can perform text extraction through Optical Character Recognition (OCR). Referring to fig. 2, fig. 2 is a schematic flow chart of an optical character recognition text extraction step according to an embodiment of the present application, where the optical character recognition text extraction step may specifically be as follows:

step S121: and extracting the bill keywords in the picture or image frame of the bill image through an optical character recognition model.

Optionally, in this embodiment, whether the data uploaded by the user is a picture or a video may be distinguished according to the file name of the bill image uploaded by the user. In addition, the embodiment may also determine the type of the data uploaded by the user through a file format scanning or the like.

Common formats of images in the bill images uploaded by the user in this embodiment may include jpg (joint Photographic Experts Group) and png (Portable Network Graphics), and common Video formats may include avi (Audio Video Interleaved format), mov (movie format), rmvb (real media Variable bitrate), rm (real media file format), flv (FlashVideo, streaming media format), mp4(Moving Picture Experts Group 4, dynamic image expert Group), and 3GP (3GP file format).

When the bill image is a picture, an optical character recognition model can be adopted to extract the bill keywords from the picture for bill confirmation.

When the bill image is a video, the video can be loaded by adopting a video capture method of OpenCV, each frame is cyclically acquired, each frame result (namely, image frame) is stored in an image List (List), and then an optical character recognition model is called for each image frame to extract keywords for bill confirmation.

Optionally, in this embodiment, the extraction of the billing keyword may be performed by using optical character recognition, where the optical character recognition refers to a process in which an electronic device (e.g., a scanner or a digital camera) checks characters printed on paper, and then translates the shape into computer characters by using a character recognition method, that is, a process in which text data is scanned, and then an image file is analyzed to obtain characters and layout information. In this embodiment, the bill keyword may be extracted through an optical character recognition model, please refer to fig. 3, and fig. 3 is a schematic flow chart of steps for constructing an optical character recognition model according to an embodiment of the present application, where the steps for constructing the optical character recognition model may be as follows:

step S111: and acquiring a training bill picture.

The training bill picture may be a picture containing bill data such as income data and expenditure data.

Step S112: and marking the corresponding text in the training bill picture through the text box to obtain marked training data.

Step S113: and obtaining a text box detection model based on deep learning training by adopting labeled training data, wherein the text box detection model is used for detecting the text box.

Step S114: and adopting the labeled training data, and training based on a convolution recurrent neural network to obtain a text recognition model, wherein the text recognition model is used for recognizing text information in the bill image.

A Convolutional Recurrent Neural Network (CRNN) is a Convolutional Recurrent Neural Network structure, and is used to solve the problem of image-based sequence recognition, especially the problem of scene character recognition. The method is mainly used for recognizing the text sequence with the indefinite length end to end, and the text recognition is converted into the sequence learning problem of time sequence dependence without cutting a single character, namely the sequence recognition based on the image.

Optionally, in this embodiment, the recognition result of the text information in the bill image by the text recognition model may be illustrated by example data, taking the income representing expenditure as an example: [ [30.0,390.0], [470.0,390.0], [470.0,423.0], [30.0,423.0] ], [ 'expenditure 16,262.69 income 2,981.58',0.94432557] ], the first 4 list points represent position coordinate points of the text box, and the last list represents recognized text and probabilities.

Step S122: it is determined whether the picture or the image frame belongs to a bill based on a bill keyword in the picture.

Optionally, in this embodiment, the picture or image frame containing the keywords such as "income", "expense", "bill", and "total" may be determined as a bill.

Step S123: and storing the pictures or image frames belonging to the bill into an image list.

Alternatively, the image list of this step S123 and the image list of the above-described saved image frame may not be the same list.

Step S124: and extracting text information of the pictures or the image frames in the image list through an optical character recognition model.

In this embodiment, the text included in the picture or the image frame in the image list is extracted by the optical character recognition model.

It should be understood that the optical character recognition model extracts more text from the bill, and needs to extract effective information based on a certain configuration, the extracted effective information can be used as basic data for checking the bill, and the rest useless data can be eliminated. Different bill types, which have different formats, are subject to the following step S14 of configurable extraction of bill valid information in order to satisfy the requirement of accommodating different bill valid information extractions.

Step S14: and extracting the bill basic data in the text information.

Referring to fig. 4, fig. 4 is a schematic flowchart of a bill basic data extracting step according to an embodiment of the present application, where the bill basic data extracting step may specifically be as follows:

step S141: and packaging the text information into a bill text list.

Step S142: matching parameters of the bill text list are determined.

Optionally, in this embodiment, the configuration page may be used to set matching parameters, for example, the left area of the configuration page is the extracted text real example, and the right area of the configuration page is the parameter configuration for extracting valid information, where the matching parameters may include a keyword representing total input/output, a separator after matching, a text interval of the bill basic data item, and an index of the bill basic data in the interval.

Step S143: and extracting bill basic data in the text information based on the matching parameters.

When different bills represent income, expenditure and other operations, the input names may be different, and the formats may also be different, so that the matching parameters need to be set according to specific bill types, and then the bill basic data in the text information is extracted based on the matching parameters.

Specifically, step S143 in this embodiment may include the following sub-steps:

step S1431: and respectively determining text items of different operations in the bill text list according to the bill keywords.

Optionally, text items representing different operations such as input and output are regularly matched according to configured keywords.

Step S1432: the text items of different operations are indexed.

Step S1433: text items of different operations are separated by separators.

After the index is marked in this embodiment, the index is divided according to the configured separators, so as to obtain the numerical values of the text items of different operations, such as the total input value and the total output value.

Step S1434: and starting from the index, extracting values corresponding to different operations needing to be checked based on the text interval and the index as basic data to assemble a bill data list, and taking the bill data list as bill basic data.

And circulating the bill text list, starting from the index, dynamically extracting basic data to be checked according to the configured interval parameters and basic data index parameters in the interval, and packaging the basic data into a new bill data list as the bill basic data.

Taking a bill as an example, the expenditure and the income respectively represent the total output and the total input, specific income data and expenditure data are separated according to the previous symbol, and detailed data of the bill is obtained according to data indexes in intervals.

Step S16: and carrying out bill accounting on the bill basic data based on the domain-specific language so as to complete the check of income and expenditure of the bill basic data.

Referring to fig. 5, fig. 5 is a schematic flow chart illustrating a bill checking step according to an embodiment of the present application, where the bill checking step may be as follows:

step S161: each variable in the bill base data is traversed.

And circularly traversing each variable in the bill basic data based on the extracted bill basic data.

Step S162: classifying each variable based on different operation types, and respectively assembling the variables of different classifications into Map structure data based on text intervals.

Different operations are performed for their corresponding variable values, e.g., data for revenue and expenditure, if the value <0, indicating expenditure, and if the value >0, indicating revenue, the billing base data is grouped by revenue and expenditure.

The data is then assembled into a grouped Map structure, and if the first item extracts a value 100, named var1, then placed into a posMap, and the second item extracts a value 88, named var2, then placed into a negMap, and so on, and the key values of each Map are assembled into a string posStr, negStr.

Step S163: and calling a domain-specific language computing interface, and transmitting Map structure data and a summation formula to obtain a summation calculation result.

Domain-Specific Language (DSL) refers to a computer Language that is dedicated to a certain application Domain.

It should be appreciated that the domain specific language computing interface needs to be constructed before it can be invoked.

Specifically, an expression calculation engine for performing addition and subtraction is constructed based on a domain-specific language, and since data items to be calculated are different in number due to the fact that the data has positive and negative values, the DSL is used to write the expression calculation engine for performing addition and subtraction.

The expression calculation engine inherits Java tokens, obtains an operator of an expression, and defines automatic identification logic of addition and subtraction by using a Scala analysis combination sub-definition, and the following codes are shown as follows:

the expression calculation engine realizes different calculation logics according to different operators, takes addition as an example, has different data types, and calls different data conversion logics to realize addition, and the addition is realized as follows:

then, a computing interface of the expression computing engine is packaged, and the following specific methods can be adopted: double getValue (Map < String, double >, String str).

Step S164: and checking the summation calculation result with values corresponding to different operations.

And calling a computing interface getValue, transmitting Map structure data and a summation formula, obtaining a computing result, and checking the computing result with values corresponding to different operations, so that the bill information is automatically identified, one-by-one computing checking is not needed by virtue of manpower or other tools, and the bill information checking efficiency is improved.

In order to cooperate with the bill accounting method provided in the embodiment of the present application, an accounting apparatus 20 is further provided in the embodiment of the present application, please refer to fig. 6, and fig. 6 is a schematic block diagram of the accounting apparatus provided in the embodiment of the present application.

The bill accounting device 20 includes:

a text information extraction module 21 for extracting text information from the bill image based on optical character recognition;

the basic data extraction module 22 is used for extracting the bill basic data in the text information;

and the accounting module 23 is configured to perform bill accounting on the bill basic data based on the domain-specific language, so as to complete checking of income and expenditure of the bill basic data.

Optionally, the text information extraction module 21 is specifically configured to: extracting bill keywords in a picture or an image frame of a bill image through an optical character recognition model; determining whether the picture or the image frame belongs to a bill based on a bill keyword in the picture; storing pictures or image frames belonging to the bill into an image list; and extracting text information of the pictures or the image frames in the image list through an optical character recognition model.

Optionally, the bill accounting apparatus 20 further includes: the model building module is used for obtaining a training bill picture; marking corresponding texts in the training bill pictures through the text boxes to obtain marked training data; adopting labeled training data, and obtaining a text box detection model based on deep learning training, wherein the text box detection model is used for detecting a text box; and adopting the labeled training data, and training based on a convolution recurrent neural network to obtain a text recognition model, wherein the text recognition model is used for recognizing text information in the bill image.

Optionally, the basic data extracting module 22 is specifically configured to: packaging the text information into a bill text list; determining matching parameters of a bill text list; and extracting bill basic data in the text information based on the matching parameters.

Optionally, the basic data extracting module 22 is specifically configured to: respectively determining text items of different operations in a bill text list according to the bill keywords; marking indexes for the text items of different operations; separating the text items of different operations by separators; and starting from the index, extracting values corresponding to different operations needing to be checked based on the text interval and the index as basic data to assemble a bill data list, and taking the bill data list as bill basic data.

Optionally, the accounting module 23 is specifically configured to: traversing each variable in the bill basic data; classifying each variable based on different operation types, and respectively assembling the variables of different classifications into Map structure data based on text intervals; calling a domain-specific language computing interface, and transmitting Map structure data and a summation formula to obtain a summation calculation result; and checking the summation calculation result with values corresponding to different operations.

Optionally, the accounting module 23 is specifically configured to: constructing an expression calculation engine for performing addition and subtraction operation based on a domain-specific language, wherein the expression calculation engine acquires an operator of an expression by inheriting Java JavaTokenParsers, and defines an identification logic of addition and subtraction by using a sub-definition combination of analysis and composition of Scala; the expression computation engine is encapsulated to obtain a computation interface.

The embodiment of the present application further provides an electronic device, which includes a memory and a processor, where the memory stores program instructions, and when the processor reads and runs the program instructions, the processor executes the steps in any one of the bill accounting methods provided in this embodiment.

It should be understood that the electronic device may be a Personal Computer (PC), a tablet PC, a smart phone, a Personal Digital Assistant (PDA), or other electronic device having a logical computing function.

The embodiment of the application also provides a readable storage medium, wherein computer program instructions are stored in the readable storage medium, and the computer program instructions are read by a processor and run to execute the steps in the bill accounting method.

To sum up, the embodiment of the present application provides a bill accounting method, an apparatus, an electronic device, and a storage medium, where the method includes: extracting text information from the bill image based on optical character recognition; extracting bill basic data in the text information; and performing bill accounting on the bill basic data based on a domain-specific language to complete the checking of income and expenditure of the bill basic data.

In the implementation mode, automatic text extraction is carried out on data uploaded by a client through optical character recognition, data operation is carried out based on a domain-specific language, a calculation result is compared with a target to be checked, automatic checking of bills is achieved, the problem that manual confirmation is needed when capital flow information is checked is solved, the correctness is not needed to be manually calculated by an auditor, information in the bills is automatically recognized, automatic flow checking is carried out, the efficiency of capital flow checking based on pictures/videos is greatly improved, an automatic bill checking function can be provided for finance or other business scenes, the bill checking efficiency is improved, and the bill checking efficiency is technically improved.

In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. The apparatus embodiments described above are merely illustrative, and for example, the block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of devices according to various embodiments of the present application. In this regard, each block in the block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams, and combinations of blocks in the block diagrams, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Therefore, the present embodiment further provides a readable storage medium, in which computer program instructions are stored, and when the computer program instructions are read and executed by a processor, the computer program instructions perform the steps of any of the block data storage methods. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a RanDom Access Memory (RAM), a magnetic disk, or an optical disk.

The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.

The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application.

It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

完整详细技术资料下载
上一篇:石墨接头机器人自动装卡簧、装栓机
下一篇:指纹识别方法、指纹识别装置及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!