Rule engine-based contract parameter extraction method and device, equipment and medium

Through the rule engine-based method, the problems of low efficiency and insufficient adaptability in the existing technology are solved, efficient and flexible contract parameter extraction and calculation are achieved, and the customization and adaptability of the product are enhanced.

CN119418355APending Publication Date: 2025-02-11PING AN BANK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411461327.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

The existing contract parameter extraction technology is not efficient, cannot horizontally expand according to user requirements, and cannot adjust and modify rules at any time according to market demand, resulting in insufficient adaptability.

Method used

The rule engine is used to generate the rule engine through image acquisition, identification initialization, content extraction and parameter type mapping, and use it to calculate the file structure data to obtain the contract response parameters.

Benefits of technology

It improves the efficiency and adaptability of contract parameter extraction, realizes functional level expansion, and can flexibly generate rule engines according to different business scenarios, enhancing the degree of product customization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119418355A_ABST
    Figure CN119418355A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, and discloses a rule engine-based contract parameter extraction method, which comprises the following steps of: performing image acquisition on a contract file to generate a contract file image set, and performing identification initialization operation on the contract file image set to generate a rule function set; performing content extraction and parameter type mapping on the contract file image set to obtain file structure data; generating a service function flow according to a preset service scene, and performing rule combination and engine packaging on the rule function set according to the service function flow to obtain a rule engine; calculating the file structure data by using the rule engine to obtain contract response parameters; and packaging, displaying and checking the contract response parameters and the file structure data by utilizing the rule engine to obtain standard contract response parameters. According to the invention, the efficiency and applicability of contract parameter extraction can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a contract parameter extraction method, device, equipment and medium based on a rule engine. Background Art

[0002] With the development of the economy, the number of financial contracts related to asset allocation is also increasing. Different investment strategies in financial contracts may cover multiple areas, and each area has specific terms and rules. Therefore, it is crucial to quickly and accurately extract key contract parameters from financial contracts.

[0003] Most of the existing contract parameter extraction technologies are based on simple optical character recognition. The content in the contract is extracted through optical character recognition technology. In actual applications, the parameter extraction technology based on simple optical character recognition performs logical calculations or processing on the extracted contract content. It cannot be horizontally expanded according to user requirements to meet the growing data analysis and processing requirements. In addition, it is impossible to adjust and modify the rules at any time according to market demand to adapt to different scenarios and new business requirements, which leads to the problems of low efficiency and insufficient adaptability of contract parameter extraction. Summary of the invention

[0004] The present invention provides a contract parameter extraction method, device, equipment and medium based on a rule engine, the main purpose of which is to solve the problems of low efficiency and insufficient adaptability of contract parameter extraction.

[0005] To achieve the above object, the present invention provides a contract parameter extraction method based on a rule engine, comprising:

[0006] Capture images of contract documents to generate a contract document atlas;

[0007] Performing identification initialization operation on the contract document atlas to generate a rule function set;

[0008] Extracting content and mapping parameter types from the contract document atlas to obtain document structure data;

[0009] Generate a business function flow according to a preset business scenario, and perform rule combination and engine encapsulation on the rule function set according to the business function flow to obtain a rule engine;

[0010] Utilizing the rule engine to calculate the file structure data to obtain contract response parameters;

[0011] The rule engine is used to encapsulate, display and verify the contract response parameters and the file structure data to obtain standard contract response parameters.

[0012] Optionally, the generating rule function set for performing identification initialization operation on the contract document atlas includes:

[0013] Sending the contract document atlas to a preset development user group;

[0014] Obtaining a function code set returned by the development user group for the contract document atlas;

[0015] Static compile the function code set to obtain a compiled function set;

[0016] The development rules of the development user group are obtained, and the compilation function set is subjected to a specification review and code repair according to the development rules to obtain a rule function set.

[0017] Optionally, the extracting content and mapping parameter types of the contract document atlas to obtain the document structure data includes:

[0018] Performing optical character recognition on the contract document atlas to obtain the content of the contract document;

[0019] Performing text segmentation and text vectorization operations on the content of the contract document to obtain a document word vector set;

[0020] Perform keyword screening on the document word vector set to obtain a keyword vector group;

[0021] Performing parameter type mapping on the keyword vector group to obtain a parameter type group;

[0022] extracting a file content group from the contract file content according to the keyword vector group;

[0023] Type mapping is performed on the file content group according to the parameter type group to obtain file structure data.

[0024] Optionally, performing optical character recognition on the contract document atlas to obtain the contract document content includes:

[0025] Performing grayscale and binarization operations on the contract document atlas to obtain a binary document atlas;

[0026] Performing tilt correction on the binary file atlas to obtain a horizontal file atlas;

[0027] Performing text region detection and text cropping on the horizontal document atlas to obtain a cropped document atlas;

[0028] Performing character segmentation and image convolution on the cropped file atlas to obtain a file text feature set;

[0029] Character mapping and text concatenation are performed on the document text feature set to obtain the contract document content.

[0030] Optionally, the step of combining rules and encapsulating engines on the rule function set according to the business function flow to obtain a rule engine includes:

[0031] Functionally decomposing the business function process to obtain a business function sequence;

[0032] Extracting a function feature sequence corresponding to the business function sequence;

[0033] Performing feature mapping on the rule function set using the function feature sequence to obtain a rule function sequence;

[0034] Initialize the interface engine, perform rule parameter mapping and function encapsulation on the interface engine according to the rule function sequence, and obtain a rule engine.

[0035] Optionally, the using the rule engine to calculate the file structure data to obtain the contract response parameters includes:

[0036] Performing data parsing on the file structure data to obtain parsed file parameters;

[0037] Extracting a rule field type from the rule engine;

[0038] Performing format conversion on the parsing file parameters according to the rule field type to obtain rule file parameters;

[0039] Utilizing the rule file parameters to perform parameter mapping on the rule engine to obtain a mapping rule engine;

[0040] The mapping rule engine is calculated to obtain contract response parameters.

[0041] Optionally, the using the rule engine to encapsulate, display and verify the contract response parameters and the file structure data to obtain standard contract response parameters includes:

[0042] Extracting bytes and encapsulating byte blocks on the rule engine to obtain rule byte blocks;

[0043] Performing format conversion on the file structure data to obtain rule file parameters;

[0044] Performing page rendering on the rule byte block, the rule file parameters and the contract response parameters to obtain a contract logic page;

[0045] Sending the contract logic page to a preset client, and obtaining logic verification data returned by the client for the contract logic page;

[0046] The contract response parameters are updated according to the logic verification data to obtain standard contract response parameters.

[0047] In order to solve the above problems, the present invention also provides a contract parameter extraction device based on a rule engine, the device comprising:

[0048] An image acquisition module is used to acquire images of contract documents and generate a contract document atlas;

[0049] An identification initialization module, used for performing identification initialization operation on the contract document atlas to generate a rule function set;

[0050] A content extraction module is used to extract content and map parameter types from the contract document atlas to obtain document structure data;

[0051] An engine packaging module is used to generate a business function flow according to a preset business scenario, and to perform rule combination and engine packaging on the rule function set according to the business function flow to obtain a rule engine;

[0052] A calculation module, used to calculate the file structure data using the rule engine to obtain contract response parameters;

[0053] The encapsulation and verification module is used to use the rule engine to encapsulate, display and verify the contract response parameters and the file structure data to obtain standard contract response parameters.

[0054] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:

[0055] at least one processor; and,

[0056] a memory communicatively connected to the at least one processor; wherein,

[0057] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the above-mentioned contract parameter extraction method based on the rule engine.

[0058] In order to solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned rule engine-based contract parameter extraction method.

[0059] The embodiments of the present invention can input contract document data through a camera device by performing image acquisition, thereby facilitating subsequent computer processing; can realize multi-user collaborative editing function by performing identification initialization operation, promote teamwork and knowledge sharing; can realize extraction of contract document content by performing content extraction and parameter type mapping, eliminate the link of manual content entry, and improve the efficiency of contract parameter extraction; can flexibly generate corresponding rule engines according to various business scenarios by generating business function processes according to preset business scenarios, combining rules and encapsulating engines, thereby improving the customization degree of product contract parameter extraction and improving the efficiency of product contract parameter extraction.

[0060] By performing calculations, the packaged rule engine can be used to perform direct contract parameter calculations, reducing the workload of personnel calculations, and realizing the functional level expansion of contract parameter extraction, improving the efficiency of contract parameter extraction. By performing package display and inspection, client users can intuitively mine and logically analyze data, thereby helping users identify and repair contract logic errors and improving the accuracy of product contract extraction. Therefore, the contract parameter extraction method, device, equipment and medium based on the rule engine proposed in the present invention can solve the problems of low efficiency and insufficient adaptability of contract parameter extraction. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 A schematic diagram of a flow chart of a method for extracting contract parameters based on a rule engine provided by an embodiment of the present invention;

[0062] Figure 2 A schematic diagram of a flow chart of a generation rule function set provided by an embodiment of the present invention;

[0063] Figure 3 A schematic diagram of a process for extracting file structure data provided by an embodiment of the present invention;

[0064] Figure 4 A functional module diagram of a contract parameter extraction device based on a rule engine provided in one embodiment of the present invention;

[0065] Figure 5 A schematic diagram of the structure of an electronic device for implementing the rule engine-based contract parameter extraction method provided in one embodiment of the present invention.

[0066] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0067] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0068] The embodiment of the present application provides a contract parameter extraction method based on a rule engine. The execution subject of the contract parameter extraction method based on the rule engine includes but is not limited to at least one of the electronic devices such as a server, a terminal, etc. that can be configured to execute the method provided by the embodiment of the present application. In other words, the contract parameter extraction method based on the rule engine can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.

[0069] Reference Figure 1 FIG. 1 is a flow chart of a method for extracting contract parameters based on a rule engine according to an embodiment of the present invention. In this embodiment, the method for extracting contract parameters based on a rule engine includes:

[0070] S1. Collect images of contract documents to generate a contract document atlas.

[0071] In detail, the contract document may be an asset allocation contract document related to the financial industry or an investment-related contract document, and the contract document atlas refers to an atlas consisting of images of individual contract documents obtained by photographing the contents of the contract document, and images may be captured using a camera or a document scanning device.

[0072] S2. Perform identification initialization operations on the contract document atlas to generate a rule function set.

[0073] Specifically, refer to Figure 2 As shown, the identification initialization operation generating rule function set for the contract document atlas includes:

[0074] S21, sending the contract document atlas to a preset development user group;

[0075] S22, obtaining a function code set returned by the development user group for the contract document atlas;

[0076] S23, statically compile the function code set to obtain a compiled function set;

[0077] S24, obtaining development rules of the development user group, and performing specification review and code repair on the compilation function set according to the development rules to obtain a rule function set.

[0078] In detail, the development user group is a collaborative working group composed of multiple development users. The development users in the development user group can work together in a timely manner, edit corresponding function codes respectively, and compile all function codes into a function code set.

[0079] Specifically, static compilation can be performed using compilation tools such as ESLint, Pylint, Checkstyle or Cppcheck. The development rules refer to the technical specifications and UI specifications that need to be followed during development. The technical specifications include code style, naming rules, directory structure, technology stack (such as React, Vue, Angular, etc.) and API interface specifications. The UI specifications include design systems, component libraries and style guides to ensure that the modules developed by each team are consistent in appearance and interaction.

[0080] In detail, tools such as Jenkins, GitLab CI, and GitHub Actions may be used to conduct specification review, and the code repair refers to returning the non-compliant function code after the specification review to the development user group for repair.

[0081] Specifically, by performing image acquisition, contract document data can be entered through a camera device to facilitate subsequent computer processing, and by performing identification initialization operations, multi-user collaborative editing functions can be realized to promote teamwork and knowledge sharing.

[0082] S3. Extract content and map parameter types of the contract document atlas to obtain document structure data.

[0083] In detail, the file structure data refers to the contract parameters that map data such as character type, numeric type, etc. field types, for example, the character type corresponding to "market opening hours" and "service rate" is "String".

[0084] In the embodiment of the present invention, refer to Figure 3 As shown, the contract file atlas is subjected to content extraction and parameter type mapping to obtain file structure data, including:

[0085] S31, performing optical character recognition on the contract document atlas to obtain the content of the contract document;

[0086] S32, performing text segmentation and text vectorization operations on the content of the contract document to obtain a document word vector set;

[0087] S33, performing keyword screening on the file word vector set to obtain a keyword vector group;

[0088] S34, performing parameter type mapping on the keyword vector group to obtain a parameter type group;

[0089] S35, extracting a file content group from the contract file content according to the keyword vector group;

[0090] S36. Perform type mapping on the file content group according to the parameter type group to obtain file structure data.

[0091] Specifically, the text segmentation method can be jieba segmentation, and the text can be vectorized using Word2Vec or BERT model. The keyword screening refers to screening out file word vectors with similar feature distances in the file word vector set as keyword vectors according to pre-defined keyword vectors. The cosine distance algorithm or the Euclidean distance algorithm can be used for keyword screening.

[0092] In detail, the parameter type mapping refers to mapping each keyword vector in the keyword vector group to a corresponding parameter type according to a preset parameter type rule, and the parameter type may be int, String or float.

[0093] Specifically, the optical character recognition is performed on the contract document atlas to obtain the contract document content, including: graying and binarizing the contract document atlas to obtain a binary file atlas; tilt correcting the binary file atlas to obtain a horizontal file atlas; performing text area detection and text cropping on the horizontal file atlas to obtain a cropped file atlas; performing character splitting and image convolution on the cropped file atlas to obtain a file text feature set; performing character mapping and text splicing on the file text feature set to obtain the contract document content.

[0094] Specifically, a mean grayscale algorithm may be used to perform a grayscale operation, a threshold segmentation method may be used to perform a binarization operation, and a Hough transform method may be used to perform a tilt correction.

[0095] Specifically, edge detection operators such as canny or sobel can be used to monitor text areas, and masks can be used to crop text. Vertical mapping methods can be used for character splitting, and neural network models such as CNN or VGG can be used for image convolution.

[0096] In detail, the character mapping refers to mapping the characters corresponding to each file text feature in the file text feature set according to a preset character library, and the text splicing includes character splicing according to position information, removing redundant spaces, and performing spelling checking and text correction.

[0097] In the embodiment of the present invention, by performing content extraction and parameter type mapping, the content of the contract document can be extracted, the manual content entry link is omitted, and the efficiency of contract parameter extraction is improved.

[0098] S4. Generate a business function flow according to a preset business scenario, and perform rule combination and engine packaging on the rule function set according to the business function flow to obtain a rule engine.

[0099] In detail, the business scenario refers to the scenario in which the contract document is applied, such as a loan scenario, a leasing scenario, and an investment scenario; the business function process refers to the business function process for meeting the needs of the business scenario; for example, when the business scenario is a loan scenario, the corresponding business function process includes credit assessment, loan approval, and contract signing.

[0100] Specifically, generating a business function flow according to a preset business scenario includes performing a functional analysis on the business scenario to obtain a business function set, and performing logical splicing on the business function set to obtain a business function flow, wherein the functional analysis can be performed by brainstorming through a development user group, or the scenario features of the business scenario can be extracted and the business function set can be screened out from a preset business function library using a feature mapping method, and the logical splicing refers to splicing the business function flow into a business function flow in the order of execution of each business function in the business function set.

[0101] In an embodiment of the present invention, the rule function set is combined with rules and the engine is encapsulated according to the business function process to obtain a rule engine, including: functionally decomposing the business function process to obtain a business function sequence; extracting a function feature sequence corresponding to the business function sequence; using the function feature sequence to perform feature mapping on the rule function set to obtain a rule function sequence; initializing an interface engine, and performing rule parameter mapping and function encapsulation on the interface engine according to the rule function sequence to obtain a rule engine.

[0102] In detail, the function decomposition refers to extracting business functions one by one according to the process sequence in the business function process, and compiling them into a business function sequence. The function feature sequence corresponding to the business function sequence can be extracted using feature coding or convolution methods.

[0103] Specifically, the feature mapping refers to matching similar functional features in the functional feature sequence as rule functions according to the functional features corresponding to each rule function in the rule function set. The feature mapping can be performed using the cosine distance algorithm or the Euclidean distance algorithm. The interface engine can be initialized using Flask. The interface engine (InterfaceEngine) is a software system or platform, which is mainly used to manage and coordinate data exchange and communication between different systems or applications. The interface engine can handle a variety of data formats and communication protocols to ensure that data can be correctly transmitted, converted and integrated between different systems.

[0104] In detail, the interface engine is mapped with rule parameters and function encapsulated according to the rule function sequence to obtain a rule engine, including defining a request path, a request method, an input parameter and an input result for the interface engine according to the rule function sequence to obtain a mapping interface engine; performing parameter parsing and parameter conversion on the mapping interface engine according to the rule function sequence to obtain a parameter interface engine, and the parameter interface engine is used to call and encapsulate the rule function sequence to obtain a rule engine.

[0105] In the embodiment of the present invention, by generating business function processes according to preset business scenarios and performing rule combination and engine packaging, it is possible to flexibly generate corresponding rule engines according to various business scenarios, thereby improving the customization degree of product contract parameter extraction and improving the efficiency of product contract parameter extraction.

[0106] S5. Utilize the rule engine to calculate the file structure data to obtain contract response parameters.

[0107] In detail, the contract response parameters refer to the contract parameters that need to be extracted. For example, when extracting content, a line of text in the contract file is extracted, and the business function process needs to extract the time of this line of text. The time extracted using the rule engine function is the contract response data.

[0108] In an embodiment of the present invention, the use of the rule engine to calculate the file structure data to obtain the contract response parameters includes: performing data parsing on the file structure data to obtain parsed file parameters; extracting the rule field type from the rule engine; performing format conversion on the parsed file parameters according to the rule field type to obtain the rule file parameters; using the rule file parameters to perform parameter mapping on the rule engine to obtain a mapping rule engine; and calculating the mapping rule engine to obtain the contract response parameters.

[0109] In detail, data parsing can be performed using a JSON, XML or CSV data parsing library. The rule field type is the data type of the calling function field of each rule function in the rule engine. Format conversion can be performed using type conversion, structure conversion and other methods, and calculations can be performed using direct calling or dynamic calling and other methods.

[0110] In the embodiment of the present invention, by performing calculations, the encapsulated rule engine can be used to perform direct contract parameter calculations, thereby reducing the workload of personnel calculations, achieving functional level expansion of contract parameter extraction, and improving the efficiency of contract parameter extraction.

[0111] S6. Use the rule engine to encapsulate, display and verify the contract response parameters and the file structure data to obtain standard contract response parameters.

[0112] In detail, the standard corresponding parameters refer to the contract response parameters after verification.

[0113] In an embodiment of the present invention, the rule engine is used to encapsulate, display and verify the contract response parameters and the file structure data to obtain standard contract response parameters, including: byte extraction and byte block encapsulation of the rule engine to obtain rule byte blocks; format conversion of the file structure data to obtain rule file parameters; page rendering of the rule byte blocks, the rule file parameters and the contract response parameters to obtain a contract logic page; sending the contract logic page to a preset client to obtain logic verification data returned by the client for the contract logic page; updating the contract response parameters according to the logic verification data to obtain standard contract response parameters.

[0114] Specifically, the byte extraction refers to extracting the function logic of each rule function in the rule engine. For example, the function logic of the FindMaxValue() function for selecting the maximum value is:

[0115] For each element in array: Ifelement>maxValue:maxValue=element, that is, for each element in the array, if the corresponding element is greater than the initial value, the element is taken as the maximum value, and iterative calculation is performed to obtain the final maximum value.

[0116] In detail, the byte block encapsulation refers to the visual byte encapsulation of the function logic extracted from the bytes, for example, encapsulating "if" as "if", and encapsulating "=" as "equals". The format conversion method is consistent with the format conversion method in the above step S4, which will not be repeated here.

[0117] Specifically, the page rendering can be performed using tool libraries such as Blockly or tools such as Vue.js, the client refers to the port of the staff who reviews the contract parameters, and the logic verification data is the verification data obtained after the client performs logic verification on the contract logic page.

[0118] In the embodiment of the present invention, by performing packaging display and inspection, client users can intuitively mine and logically analyze data, thereby helping users identify and repair contract logic errors and improving the accuracy of product contract extraction.

[0119] The embodiments of the present invention can input contract document data through a camera device by performing image acquisition, thereby facilitating subsequent computer processing; can realize multi-user collaborative editing function by performing identification initialization operation, promote teamwork and knowledge sharing; can realize extraction of contract document content by performing content extraction and parameter type mapping, eliminate the link of manual content entry, and improve the efficiency of contract parameter extraction; can flexibly generate corresponding rule engines according to various business scenarios by generating business function processes according to preset business scenarios, combining rules and encapsulating engines, thereby improving the customization degree of product contract parameter extraction, and improving the efficiency and adaptability of product contract parameter extraction.

[0120] By performing calculations, the packaged rule engine can be used to perform direct contract parameter calculations, reducing the workload of personnel calculations, and realizing the functional level expansion of contract parameter extraction, improving the efficiency of contract parameter extraction. By performing package display and inspection, client users can intuitively mine and logically analyze data, thereby helping users identify and repair contract logic errors and improving the accuracy of product contract extraction. Therefore, the contract parameter extraction method based on the rule engine proposed in the present invention can solve the problems of low efficiency and insufficient adaptability of contract parameter extraction.

[0121] like Figure 4 , which is a functional module diagram of a contract parameter extraction device based on a rule engine provided in one embodiment of the present invention.

[0122] The contract parameter extraction device 100 based on the rule engine of the present invention can be installed in an electronic device. According to the functions implemented, the contract parameter extraction device 100 based on the rule engine can include an image acquisition module 101, an identification initialization module 102, a content extraction module 103, an engine encapsulation module 104, a calculation module 105 and an encapsulation verification module 106. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.

[0123] In this embodiment, the functions of each module / unit are as follows:

[0124] The image acquisition module 101 is used to acquire images of contract documents to generate a contract document atlas;

[0125] The identification initialization module 102 is used to perform identification initialization operations on the contract document atlas to generate a rule function set.

[0126] In detail, the identification initialization module 102 includes an identification initialization unit. When the identification initialization unit performs the identification initialization operation on the contract document atlas to generate a rule function set, the identification initialization unit includes: sending the contract document atlas to a preset development user group; obtaining the function code set returned by the development user group for the contract document atlas; statically compiling the function code set to obtain a compiled function set; obtaining the development rules of the development user group, and performing specification review and code repair on the compiled function set according to the development rules to obtain a rule function set.

[0127] The content extraction module 103 is used to extract content and perform parameter type mapping on the contract document atlas to obtain file structure data.

[0128] In detail, the content extraction module 103 includes a content extraction unit and a character recognition unit.

[0129] Specifically, when the content extraction unit performs content extraction and parameter type mapping on the contract document atlas to obtain file structure data, it includes: performing optical character recognition on the contract document atlas to obtain contract document content; performing text segmentation and text vectorization operations on the contract document content to obtain a file word vector set; performing keyword screening on the file word vector set to obtain a keyword vector group; performing parameter type mapping on the keyword vector group to obtain a parameter type group; extracting a file content group from the contract document content according to the keyword vector group; performing type mapping on the file content group according to the parameter type group to obtain file structure data.

[0130] In detail, when the character recognition unit performs optical character recognition on the contract document atlas to obtain the contract document content, it includes: performing grayscale and binarization operations on the contract document atlas to obtain a binary file atlas; performing tilt correction on the binary file atlas to obtain a horizontal file atlas; performing text area detection and text cropping on the horizontal file atlas to obtain a cropped file atlas; performing character splitting and image convolution on the cropped file atlas to obtain a file text feature set; performing character mapping and text splicing on the file text feature set to obtain the contract document content.

[0131] The engine packaging module 104 is used to generate a business function flow according to a preset business scenario, and to perform rule combination and engine packaging on the rule function set according to the business function flow to obtain a rule engine.

[0132] In an embodiment of the present invention, the engine encapsulation module 104 includes an engine encapsulation unit, and the engine encapsulation unit performs rule combination and engine encapsulation on the rule function set according to the business function process to obtain a rule engine, including: functionally decomposing the business function process to obtain a business function sequence; extracting a function feature sequence corresponding to the business function sequence; using the function feature sequence to perform feature mapping on the rule function set to obtain a rule function sequence; initializing the interface engine, and performing rule parameter mapping and function encapsulation on the interface engine according to the rule function sequence to obtain a rule engine.

[0133] The calculation module 105 is used to calculate the file structure data using the rule engine to obtain the contract response parameters.

[0134] In detail, the calculation module 105 includes a calculation unit. When the calculation unit uses the rule engine to calculate the file structure data to obtain the contract response parameters, it includes: performing data parsing on the file structure data to obtain parsed file parameters; extracting the rule field type from the rule engine; performing format conversion on the parsed file parameters according to the rule field type to obtain the rule file parameters; using the rule file parameters to map the parameters of the rule engine to obtain a mapping rule engine; and calculating the mapping rule engine to obtain the contract response parameters.

[0135] The encapsulation and verification module 106 is used to use the rule engine to encapsulate, display and verify the contract response parameters and the file structure data to obtain standard contract response parameters.

[0136] Specifically, the encapsulation verification module 106 includes an encapsulation verification unit. When the encapsulation verification unit uses the rule engine to encapsulate, display and verify the contract response parameters and the file structure data, it obtains standard contract response parameters, including: byte extraction and byte block encapsulation of the rule engine to obtain rule byte blocks; format conversion of the file structure data to obtain rule file parameters; page rendering of the rule byte blocks, the rule file parameters and the contract response parameters to obtain a contract logic page; sending the contract logic page to a preset client to obtain logic verification data returned by the client for the contract logic page; updating the contract response parameters according to the logic verification data to obtain standard contract response parameters.

[0137] In detail, each module described in the contract parameter extraction device 100 based on the rule engine in the embodiment of the present invention is used in the same manner as described above. Figures 1 to 3 The technical means are the same as the contract parameter extraction method based on the rule engine described in, and can produce the same technical effects, so I will not go into details here.

[0138] like Figure 5 , which is a schematic diagram of the structure of an electronic device for implementing a contract parameter extraction method based on a rule engine provided by an embodiment of the present invention.

[0139] The electronic device 1 may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a contract parameter extraction program based on a rule engine.

[0140] In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 10 is the control core (ControlUnit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules stored in the memory 11 (for example, executing a contract parameter extraction program based on a rule engine, etc.), and calls data stored in the memory 11 to execute various functions of the electronic device and process data.

[0141] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 can also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 11 can also include both an internal storage unit of the electronic device and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device, such as the code of the contract parameter extraction program based on the rule engine, but also can be used to temporarily store data that has been output or is to be output.

[0142] The communication bus 12 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.

[0143] The communication interface 13 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.

[0144] The figure only shows an electronic device with components. Those skilled in the art will understand that the structure shown in the figure does not constitute a limitation on the electronic device, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0145] For example, although not shown, the electronic device may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0146] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.

[0147] The contract parameter extraction program based on the rule engine stored in the memory 11 of the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can achieve:

[0148] Capturing images of contract documents to generate a contract document atlas, and performing identification initialization operations on the contract document atlas to generate a rule function set;

[0149] Extracting content and mapping parameter types from the contract document atlas to obtain document structure data;

[0150] Generate a business function flow according to a preset business scenario, and perform rule combination and engine encapsulation on the rule function set according to the business function flow to obtain a rule engine;

[0151] Utilizing the rule engine to calculate the file structure data to obtain contract response parameters;

[0152] The rule engine is used to encapsulate, display and verify the contract response parameters and the file structure data to obtain standard contract response parameters.

[0153] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, which will not be repeated here.

[0154] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).

[0155] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:

[0156] Capturing images of contract documents to generate a contract document atlas, and performing identification initialization operations on the contract document atlas to generate a rule function set;

[0157] Extracting content and mapping parameter types from the contract document atlas to obtain document structure data;

[0158] Generate a business function flow according to a preset business scenario, and perform rule combination and engine encapsulation on the rule function set according to the business function flow to obtain a rule engine;

[0159] Utilizing the rule engine to calculate the file structure data to obtain contract response parameters;

[0160] The rule engine is used to encapsulate, display and verify the contract response parameters and the file structure data to obtain standard contract response parameters.

[0161] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0162] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0163] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0164] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0165] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.

[0166] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0167] The embodiments of the present application can acquire and process relevant data based on data processing technology. Among them, 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 knowledge to obtain the best results.

[0168] In addition, it is obvious that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. The multiple units or devices stated in the system embodiment can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any specific order.

[0169] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solutions of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention. It should be noted that if software tools or components other than those of the company appear in the embodiments of the present application, they are only used for example introduction and do not represent actual use.

Claims

1. A contract parameter extraction method based on rule engine, characterized in that: The method comprises: Capture images of contract documents to generate a contract document atlas; Performing identification initialization operation on the contract document atlas to generate a rule function set; Extracting content and mapping parameter types from the contract document atlas to obtain document structure data; Generate a business function flow according to a preset business scenario, and perform rule combination and engine encapsulation on the rule function set according to the business function flow to obtain a rule engine; Utilizing the rule engine to calculate the file structure data to obtain contract response parameters; The rule engine is used to encapsulate, display and verify the contract response parameters and the file structure data to obtain standard contract response parameters.

2. The contract parameter extraction method based on rule engine according to claim 1, characterized in that: The step of generating a rule function set for performing identification initialization operation on the contract document atlas includes: Sending the contract document atlas to a preset development user group; Obtaining a function code set returned by the development user group for the contract document atlas; Static compile the function code set to obtain a compiled function set; The development rules of the development user group are obtained, and the compilation function set is subjected to a specification review and code repair according to the development rules to obtain a rule function set.

3. The contract parameter extraction method based on rule engine according to claim 1, characterized in that: The content extraction and parameter type mapping of the contract document atlas are performed to obtain the document structure data, including: Performing optical character recognition on the contract document atlas to obtain the content of the contract document; Performing text segmentation and text vectorization operations on the content of the contract document to obtain a document word vector set; Perform keyword screening on the document word vector set to obtain a keyword vector group; Performing parameter type mapping on the keyword vector group to obtain a parameter type group; extracting a file content group from the contract file content according to the keyword vector group; Type mapping is performed on the file content group according to the parameter type group to obtain file structure data.

4. The contract parameter extraction method based on rule engine according to claim 3, characterized in that: The optical character recognition is performed on the contract document atlas to obtain the content of the contract document, including: Performing grayscale and binarization operations on the contract document atlas to obtain a binary document atlas; Performing tilt correction on the binary file atlas to obtain a horizontal file atlas; Performing text region detection and text cropping on the horizontal document atlas to obtain a cropped document atlas; Performing character segmentation and image convolution on the cropped file atlas to obtain a file text feature set; Character mapping and text concatenation are performed on the document text feature set to obtain the contract document content.

5. The contract parameter extraction method based on rule engine according to claim 1, characterized in that: The step of combining the rule function set according to the business function flow and encapsulating the engine to obtain a rule engine includes: Functionally decomposing the business function process to obtain a business function sequence; Extracting a function feature sequence corresponding to the business function sequence; Performing feature mapping on the rule function set using the function feature sequence to obtain a rule function sequence; Initialize the interface engine, perform rule parameter mapping and function encapsulation on the interface engine according to the rule function sequence, and obtain a rule engine.

6. The contract parameter extraction method based on rule engine according to claim 1, characterized in that: The using the rule engine to calculate the file structure data to obtain the contract response parameters includes: Performing data parsing on the file structure data to obtain parsed file parameters; Extracting rule field types from the rule engine; Performing format conversion on the parsing file parameters according to the rule field type to obtain rule file parameters; Utilizing the rule file parameters to perform parameter mapping on the rule engine to obtain a mapping rule engine; The mapping rule engine is calculated to obtain contract response parameters.

7. The contract parameter extraction method based on rule engine according to claim 1, characterized in that: The method of using the rule engine to encapsulate, display and inspect the contract response parameters and the file structure data to obtain standard contract response parameters includes: Extracting bytes and encapsulating byte blocks on the rule engine to obtain rule byte blocks; Performing format conversion on the file structure data to obtain rule file parameters; Performing page rendering on the rule byte block, the rule file parameters and the contract response parameters to obtain a contract logic page; Sending the contract logic page to a preset client, and obtaining logic verification data returned by the client for the contract logic page; The contract response parameters are updated according to the logic verification data to obtain standard contract response parameters.

8. A contract parameter extraction device based on a rule engine, characterized in that: The device comprises: An image acquisition module is used to acquire images of contract documents and generate a contract document atlas; An identification initialization module, used for performing identification initialization operation on the contract document atlas to generate a rule function set; A content extraction module is used to extract content and map parameter types from the contract document atlas to obtain document structure data; An engine packaging module is used to generate a business function flow according to a preset business scenario, and to perform rule combination and engine packaging on the rule function set according to the business function flow to obtain a rule engine; A calculation module, used to calculate the file structure data using the rule engine to obtain contract response parameters; The encapsulation and verification module is used to use the rule engine to encapsulate, display and verify the contract response parameters and the file structure data to obtain standard contract response parameters.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the contract parameter extraction method based on the rule engine as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the contract parameter extraction method based on a rule engine as described in any one of claims 1 to 7 is implemented.