Rule engine-based tax declaration manuscript management system and method
Through the tax declaration draft management system based on the rules engine and combined with the deep learning model, the problems of inaccurate risk judgments in the existing technology are solved, and more scientific weight determination and more accurate risk warning are achieved.
Patent Information
- Application Number
- CN202510213179.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2045-02-26
AI Technical Summary
The existing technology lacks the need for dynamic rules for complex business scenarios in the processing of tax declaration data, and fails to deeply explore potential risks, such as data tampering and tax logic loopholes, and the weight determination method is unscientific, resulting in unreasonable indicator settings.
The tax declaration draft management system based on the rules engine is adopted, and the rules engine is built through the Drools workspace, tax compliance, data logic consistency and risk warning rules are entered, and data feature extraction and risk judgment are carried out in combination with a hybrid model architecture of long and short-term memory networks and autoencoders.
It has achieved dynamic rules satisfaction for complex business scenarios, deeply insight into the internal logic errors of data, prevented tax risks in advance, and improved the accuracy of tax declaration risk judgments.
Smart Images

Figure CN119719205A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a tax declaration manuscript management system and method based on a rule engine. Background Art
[0002] In today's digital age, the accuracy and security of tax return data processing is crucial. With the continuous expansion of corporate business scale and increasingly stringent tax supervision requirements, traditional tax return data processing methods face many difficulties.
[0003] In terms of rule application, most existing technologies are roughly checked statically based on basic tax laws and regulations, without fully considering the rule requirements in complex and changeable actual business scenarios. The lack of in-depth exploration of potential risks, such as data tampering risks and hidden tax logic loopholes, makes companies passive when facing tax audits. In feature extraction and model construction, existing technologies usually only perform simple analysis on a single data dimension in isolation, without deeply exploring the combined value of different data features. Moreover, in terms of weight determination methods, traditional methods either rely solely on simple averages of historical data, ignoring the complex factors behind data fluctuations; or rely solely on subjective experience judgments, lacking scientific and rigorous quantitative analysis, making the weight setting of each indicator unreasonable. Summary of the invention
[0004] The purpose of the present invention is to provide a tax declaration manuscript management system and method based on a rule engine to solve the problems raised in the prior art.
[0005] To achieve the above object, the present invention provides the following technical solutions: A tax declaration manuscript management method based on a rule engine, the method comprising the following steps: Develop data interfaces to connect to the enterprise's internal data sources, extract tax return data at a predetermined frequency through ETL tools, including financial data, invoice data, inventory data and human resources data, and perform data preprocessing and integration; Build a Drools workspace, create a rule base directory for storing rule files, and configure the operating parameters of the rule engine; enter rules based on financial data and invoice data, including tax compliance rules, data logic consistency rules, and risk warning rules; Extracting inventory features based on inventory data, and extracting human resource features based on human resource data; calculating a first operational efficiency human resource comprehensive feature and a second operational efficiency human resource comprehensive feature based on the inventory features and the human resource features; For the first and second operational efficiency human comprehensive characteristics, time series expansion is performed, and data is labeled based on the rules of the Drools rule engine; a hybrid model architecture combining long short-term memory network and autoencoder is selected, and the labeled time series data set is divided into training set, validation set and test set for model training, evaluation and optimization; When new data is updated or submitted in the tax return draft, the newly generated feature sequence is input into the trained hybrid model to determine whether there is a risk of tampering in the current tax return draft. If there is a risk of tampering, the staff will be warned.
[0006] Furthermore, after the financial department of the enterprise completes the daily closing operation, the scheduling function of the ETL tool is used to obtain the latest financial data; write related query statements to integrate the data in the invoice management system, and associate the detail table from the invoice master table to obtain the invoice data; for the inventory system database, use query statements to associate the real-time status of the inventory from the inventory entry table, the inventory exit table and the inventory balance table to obtain the inventory data; query information from the human resource management system database to obtain human resource data; The extracted financial data, invoice data, inventory data and human resources data are cleaned and converted, and a database based on tax declaration requirements is created. Dimension tables and fact tables are constructed in it, and data from different data sources are integrated through the primary key-foreign key association mechanism; financial data is associated with invoice data, inventory data is associated with financial data, and human resources data is associated with financial data.
[0007] Furthermore, an area is opened up for Drools-related development and management, and multiple sub-directories are divided according to functions, including: rule base directory, model directory and test directory; wherein, the rule base directory is used to store rule files related to tax declaration, defining constraints and behavior logic; the model directory stores domain model objects related to tax declaration, which is an abstract simplification of the underlying data structure and is presented in the form of Java class; the test directory is used to write unit test and integration test cases, input different test data, verify whether the rules can be triggered correctly, and output the expected results; In the "kmodule.xml" in the Drools workspace, various configurations of knowledge sessions are defined, and the knowledge sessions are used to ensure that different types of sessions meet different business needs; rules are loaded and updated, and execution priorities, conflict resolution parameters, and performance optimization parameters are set.
[0008] According to the conventional technology in this field, the revenue recognition rules in financial data are set; for enterprises adopting different sales models, the rules for when and at what amount the revenue under each model should be recognized in the financial statements are clarified; based on invoice data, the rules for issuing, authenticating and deducting special VAT invoices and ordinary invoices are standardized; Establish a logical connection between financial income data and invoice data. The rule is set that the main business income in the financial statements should fluctuate within a predefined difference range with the tax-inclusive sales amount issued by invoices during the same period. The difference range is determined through statistical analysis of historical data. Set rules for the logical coherence of invoice data. For risk warning rules, warnings are issued for abnormal data fluctuations, tax rate deviations and related-party transaction risks.
[0009] Inventory features are extracted based on inventory data, including dynamic features, trend features and correlation features. The dynamic features include inventory turnover rate and inventory change rate, the trend features include moving average and seasonal index, and the correlation feature is the correlation between inventory and sales. Human resource features are extracted based on human resource data, including salary structure features and personnel change features. The salary structure features include salary composition ratio and salary level distribution, and the personnel change features include employee turnover rate and new employee ratio.
[0010] Further, for the inventory dynamic characteristics, the inventory turnover rate and the inventory change rate are standardized and weighted and summed according to the first weight, which is determined according to the importance of the two parameters in the inventory dynamic characteristics on the operating efficiency, to obtain the inventory operating efficiency value; for the inventory trend characteristics, the moving average and the seasonal index are standardized and weighted and summed according to the second weight, which is weighted according to the relative importance of the two parameters in the inventory trend characteristics in reflecting the inventory trend, to obtain the inventory trend comprehensive value; for the salary structure characteristics, the basic salary ratio, performance salary ratio, bonus ratio and welfare ratio are weighted and summed according to their respective proportions in the total salary to obtain the salary structure comprehensive value; the inventory operating efficiency value, the inventory trend comprehensive value and the salary structure comprehensive value are weighted and summed according to the third weight, which is determined through actual business verification, to obtain the first operating efficiency human comprehensive characteristics; The correlation between inventory and sales is standardized to obtain a standardized correlation value. For the personnel change characteristics, the employee turnover rate and the proportion of new employees are standardized, and weighted summed according to the fourth weight, where the fourth weight is determined according to the importance of the two parameters in the personnel change characteristics on the operational efficiency, to obtain a comprehensive personnel change value. The standardized correlation value and the comprehensive personnel change value are added with a half-weight to obtain the second operational efficiency human comprehensive characteristics.
[0011] Furthermore, the first weight is determined using the historical data analysis regression method, and the inventory turnover rate of the enterprise in the past m quarters is collected. , Inventory Change Rate And the corresponding operational efficiency indicators ; Establish a multiple linear regression model: ,in is the intercept, is the first regression coefficient, is the second regression coefficient, is the random error term; By performing regression analysis on historical data, we can get the regression coefficient and The estimated value of the inventory turnover rate in the first weight is calculated as follows: , the weight calculation formula for inventory change rate is: ; The second weight and the fourth weight are determined by using an expert scoring method; The third weight is determined by using the hierarchical analysis method; a hierarchical model is constructed, in which the target layer is to determine the comprehensive human characteristics of the first operating efficiency, the criterion layer includes inventory operating efficiency, inventory trend and salary structure, and the scheme layer is to allocate weights to each criterion; experts compare the relative importance of each factor in the criterion layer in pairs to construct a judgment matrix; the maximum eigenvalue of the judgment matrix and its corresponding eigenvector are calculated, the eigenvector is normalized, and the normalized vector element obtained is the third weight.
[0012] Furthermore, we retrospectively obtain multiple periods of inventory data and human resource data from the enterprise's database, and arrange the collected data in chronological order to form a structured time series data set; we calculate sliding window statistics for the first operational efficiency human resource comprehensive feature and the second operational efficiency human resource comprehensive feature; we use seasonal decomposition to split the time series of each comprehensive feature into trend component, seasonal component and residual component; When the time series expanded operational efficiency manpower comprehensive feature data flows into the Drools rule engine, the engine starts rule matching in sequence; performs compliance rule verification on each data point one by one, and when a compliance rule condition is met, the corresponding compliance risk label is marked on the data; risk warning rule matching is performed, and when triggered, the risk warning label is superimposed and marked; data logic consistency rules are executed, and data logic consistency labels are added if the conditions are met.
[0013] Furthermore, based on the annotated time series data set, the data set is divided into a training set, a validation set, and a test set in proportion; in the hybrid model architecture, the long short-term memory network processes the input time series data in sequence, and each long short-term memory network receives the enterprise operation feature vector of the current time step, including the first operation efficiency human comprehensive feature, the second operation efficiency human comprehensive feature and each sub-feature contained therein; combined with the hidden state of the previous time step, through the input gate, the forget gate and the output gate, it is determined which information needs to be retained, updated or forgotten; the autoencoder is used to learn the feature representation of the data, and is composed of an encoder and a decoder; the encoder compresses the high-dimensional input data into a low-dimensional encoding space to extract the key features of the data; during the training process, the model continuously adjusts the weight parameters of the model based on the annotation information with the goal of minimizing the loss function between the predicted results and the true annotations; The model is evaluated at each stage of model training and after the training is finally completed; based on the results of the model evaluation, the hyperparameters of the long short-term memory network and the autoencoder are adjusted.
[0014] The newly generated feature sequence is input into a hybrid model that combines a pre-trained long short-term memory network with an autoencoder. The model compares the currently input feature sequence with the normal and abnormal sample feature patterns accumulated during the training phase, comprehensively determines whether the current tax return draft has a risk of tampering, and gives a corresponding risk probability value. For high-risk levels, a pop-up window will appear on the tax declaration operation interface with a risk warning and an attached comparison chart of key abnormal data, showing the difference between the current data and the normal range and providing suggested verification directions. For medium-risk levels, warning information will be sent to relevant staff by email. For low-risk levels, warning information will be published in the system's internal notification bar.
[0015] A tax declaration manuscript management system based on rule engine, comprising: Data collection and integration module: including: data collection unit and data preprocessing unit; the data collection unit develops data interface, connects to the data source within the enterprise, extracts tax declaration data at a predetermined frequency through ETL tools, including financial data, invoice data, inventory data and human resources data, and the data integration unit performs data preprocessing and integration; Rule engine building module: including: Drools workspace building unit and rule engine configuration unit; wherein, the Drools workspace building unit builds the Drools workspace, creates a rule base directory for storing rule files, and configures the running parameters of the rule engine; the rule engine configuration unit enters rules based on financial data and invoice data, and the rules include tax compliance rules, data logic consistency rules, and risk warning rules; Feature engineering module: including: an inventory feature extraction unit, a human resource feature extraction unit and a comprehensive feature calculation unit; wherein the inventory feature extraction unit extracts inventory features based on inventory data, and the human resource feature extraction unit extracts human resource features based on human resource data; the comprehensive feature calculation unit calculates a first operational efficiency human resource comprehensive feature and a second operational efficiency human resource comprehensive feature according to the inventory feature and the human resource feature; Time series processing and model training module: including: time series expansion unit and model training unit; wherein the time series expansion unit performs time series expansion for the first operational efficiency human comprehensive characteristics and the second operational efficiency human comprehensive characteristics, and performs data annotation based on the rules of the Drools rule engine; the model training unit uses a hybrid model architecture combining a long short-term memory network and an autoencoder, divides the annotated time series data set into a training set, a validation set and a test set, and performs model training, evaluation and optimization; Risk warning module: including: risk judgment unit and warning push unit; among them, when there is new data update or submission of tax declaration draft, the risk judgment unit inputs the newly generated feature sequence into the trained hybrid model to judge whether there is tampering risk in the current tax declaration draft. If there is tampering risk, the warning push unit will warn the staff.
[0016] Compared with the prior art, the present invention has the following beneficial effects: 1. The present invention builds a Drools workspace and scientifically configures the operating parameters of the rule engine to lay a solid foundation for the efficient execution of rules. On this basis, comprehensive and detailed rules are entered based on multi-dimensional data, which can deeply understand the inherent logical errors of the data and prevent tax risks in advance. 2. In terms of model construction, the present invention selects a hybrid model architecture that combines a long short-term memory network with an autoencoder, and specifically optimizes the time series characteristics of tax return data. The model can effectively capture the long-term dependencies of the data and has powerful feature self-learning and noise reduction capabilities.
[0017] 3. The present invention combines a variety of scientific methods in determining weights. For some weights, historical data analysis and regression method is used, and for other weights, expert scoring method and hierarchical analysis method are used respectively. It fully absorbs professional knowledge and experience wisdom, comprehensively weighs the influence of different factors, ensures that the weight system is scientific and reasonable, and comprehensively improves the accuracy of tax declaration risk judgment. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a schematic diagram of the steps of a tax declaration manuscript management method based on a rule engine of the present invention; Figure 2It is a system structure diagram of a tax declaration manuscript management system based on a rule engine of the present invention. DETAILED DESCRIPTION
[0019] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0020] Example: Figure 1-Figure 2 As shown, the present invention provides a technical solution. According to one embodiment of the present invention, Figure 1 A step diagram of a tax declaration draft management method based on a rule engine is shown in the figure. A tax declaration draft management method based on a rule engine comprises the following steps: Develop data interfaces to connect to the enterprise's internal data sources, extract tax return data at a predetermined frequency through ETL tools, including financial data, invoice data, inventory data and human resources data, and perform data preprocessing and integration; Build a Drools workspace, create a rule base directory for storing rule files, and configure the operating parameters of the rule engine; enter rules based on financial data and invoice data, including tax compliance rules, data logic consistency rules, and risk warning rules; Extracting inventory features based on inventory data, and extracting human resource features based on human resource data; calculating a first operational efficiency human resource comprehensive feature and a second operational efficiency human resource comprehensive feature based on the inventory features and the human resource features; For the first and second operational efficiency human comprehensive characteristics, time series expansion is performed, and data is labeled based on the rules of the Drools rule engine; a hybrid model architecture combining long short-term memory network and autoencoder is selected, and the labeled time series data set is divided into training set, validation set and test set for model training, evaluation and optimization; When new data is updated or submitted in the tax return draft, the newly generated feature sequence is input into the trained hybrid model to determine whether there is a risk of tampering in the current tax return draft. If there is a risk of tampering, the staff will be warned.
[0021] Furthermore, after the financial department of the enterprise completes the daily closing operation, the scheduling function of the ETL tool is used to obtain the latest financial data; write related query statements to integrate the data in the invoice management system, and associate the detail table from the invoice master table to obtain the invoice data; for the inventory system database, use query statements to associate the real-time status of the inventory from the inventory entry table, the inventory exit table and the inventory balance table to obtain the inventory data; query information from the human resource management system database to obtain human resource data; The extracted financial data, invoice data, inventory data and human resources data are cleaned and converted, and a database based on tax declaration requirements is created. Dimension tables and fact tables are constructed in it, and data from different data sources are integrated through the primary key-foreign key association mechanism; financial data is associated with invoice data, inventory data is associated with financial data, and human resources data is associated with financial data.
[0022] Furthermore, an area is opened up for Drools-related development and management, and multiple sub-directories are divided according to functions, including: rule base directory, model directory and test directory; wherein, the rule base directory is used to store rule files related to tax declaration, defining constraints and behavior logic; the model directory stores domain model objects related to tax declaration, which is an abstract simplification of the underlying data structure and is presented in the form of Java class; the test directory is used to write unit test and integration test cases, input different test data, verify whether the rules can be triggered correctly, and output the expected results; In the "kmodule.xml" in the Drools workspace, various configurations of knowledge sessions are defined, and the knowledge sessions are used to ensure that different types of sessions meet different business needs; rules are loaded and updated, and execution priorities, conflict resolution parameters, and performance optimization parameters are set.
[0023] According to the conventional technology in this field, the revenue recognition rules in financial data are set; for enterprises adopting different sales models, the rules for when and at what amount the revenue under each model should be recognized in the financial statements are clarified; based on invoice data, the rules for issuing, authenticating and deducting special VAT invoices and ordinary invoices are standardized; Establish a logical connection between financial income data and invoice data. The rule is set that the main business income in the financial statements should fluctuate within a predefined difference range with the tax-inclusive sales amount issued by invoices during the same period. The difference range is determined through statistical analysis of historical data. Set rules for the logical coherence of invoice data. For risk warning rules, warnings are issued for abnormal data fluctuations, tax rate deviations and related-party transaction risks.
[0024] Inventory features are extracted based on inventory data, including dynamic features, trend features and correlation features. The dynamic features include inventory turnover rate and inventory change rate, the trend features include moving average and seasonal index, and the correlation feature is the correlation between inventory and sales. Human resource features are extracted based on human resource data, including salary structure features and personnel change features. The salary structure features include salary composition ratio and salary level distribution, and the personnel change features include employee turnover rate and new employee ratio.
[0025] In this example, we study a medium-sized manufacturing company that mainly produces seasonal consumer goods, and the peak sales season for products is concentrated in the third and fourth quarters of each year. The company's relevant data for the past 20 quarters (m=20) has been fully collected, covering inventory turnover rate, inventory change rate, operating efficiency index (here, return on assets ROA is used as an indicator to measure operating efficiency), moving average, seasonal index, proportion of each component of the salary structure, employee turnover rate, proportion of new employees, and inventory-sales correlation data.
[0026] For the first weight, the inventory turnover ratio (ITR) data for the past 20 quarters are as follows: [1.2,1.3,1.1,0.9,1.4,1.5,1.3,1.2,0.8,0.7,1.6,1.8,2.0,1.9,1.7,1.5,1.3,1.1,1.0,1.2]; The inventory change rate (IVR) data are as follows: [0.1,-0.05,0.08,-0.12,0.15,0.2,-0.08,0.05,-0.15,-0.2,0.25,0.3,-0.1,0.05,-0.05,0.1,-0.08,0.03,-0.05,0.08]; The corresponding return on assets (ROA) data are as follows: [0.1,0.12,0.08,0.06,0.15,0.18,0.13,0.1,0.05,0.04,0.2,0.22,0.18,0.16,0.14,0.12,0.1,0.08,0.06,0.08]; Calculate the inventory turnover weight as , the inventory change rate weight is 1-0.625=0.375.
[0027] For the second weight, five senior inventory management and operation experts from the company were invited to score the relative importance of the moving average (MAV) and seasonal index (SI) in reflecting inventory trends (1-10 points). The scoring results are as follows: Expert 1: MAV-8 points, SI-6 points, Expert 2: MAV-7 points, SI-5 points, Expert 3: MAV-9 points, SI-7 points, Expert 4: MAV-8 points, SI-6 points, Expert 5: MAV-7 points, SI-5 points. The calculated moving average weight is 0.557, and the seasonal index weight is 0.443.
[0028] Similarly, for the fourth weight, the description of the expert scores is omitted, and the calculated weight of employee turnover rate is 0.603, and the weight of new employee ratio is 0.397.
[0029] For the third weight, the target layer: determine the comprehensive human resource characteristics of the first operating efficiency; the criterion layer: inventory operating efficiency (O), inventory trend (T), and salary structure (S); 7 experts (including finance, operations, human resources, etc.) compared the relative importance of each factor in the criterion layer and constructed a judgment matrix A. The mathematical software MATLAB was used to calculate the maximum eigenvalue of the judgment matrix and its corresponding eigenvector. After calculation, the normalized eigenvector corresponding to the maximum eigenvalue was obtained. The weight of the inventory operating efficiency value is 0.54, the weight of the inventory trend comprehensive value is 0.16, and the weight of the salary structure comprehensive value is 0.30.
[0030] Furthermore, for the inventory dynamic characteristics, the inventory turnover rate and the inventory change rate are standardized and weighted and summed according to the first weight, which is determined according to the importance of the two parameters in the inventory dynamic characteristics on the operating efficiency, to obtain the inventory operating efficiency value; for the inventory trend characteristics, the moving average and the seasonal index are standardized and weighted and summed according to the second weight, which is weighted according to the relative importance of the two parameters in the inventory trend characteristics in reflecting the inventory trend, to obtain the inventory trend comprehensive value; for the salary structure characteristics, the basic salary ratio, performance salary ratio, bonus ratio and welfare ratio are weighted and summed according to their respective proportions in the total salary to obtain the salary structure comprehensive value; the inventory operating efficiency value, the inventory trend comprehensive value and the salary structure comprehensive value are weighted and summed according to the third weight, which is determined through actual business verification, to obtain the first operating efficiency human comprehensive characteristic of 0.07; The correlation between inventory and sales is standardized to obtain a standardized correlation value. For the personnel change characteristics, the employee turnover rate and the proportion of new employees are standardized and weighted and summed according to the fourth weight, where the fourth weight is determined according to the importance of the two parameters in the personnel change characteristics on the operational efficiency, to obtain a comprehensive personnel change value. The standardized correlation value and the comprehensive personnel change value are added with a half-weight, to obtain the second operational efficiency human comprehensive characteristic of 0.33.
[0031] Furthermore, we retrospectively obtain multiple periods of inventory data and human resource data from the enterprise's database, and arrange the collected data in chronological order to form a structured time series data set; we calculate sliding window statistics for the first operational efficiency human resource comprehensive feature and the second operational efficiency human resource comprehensive feature; we use seasonal decomposition to split the time series of each comprehensive feature into trend component, seasonal component and residual component; When the time series expanded operational efficiency manpower comprehensive feature data flows into the Drools rule engine, the engine starts rule matching in sequence; performs compliance rule verification on each data point one by one, and when a compliance rule condition is met, the corresponding compliance risk label is marked on the data; risk warning rule matching is performed, and when triggered, the risk warning label is superimposed and marked; data logic consistency rules are executed, and data logic consistency labels are added if the conditions are met.
[0032] Furthermore, based on the annotated time series data set, the data set is divided into a training set, a validation set, and a test set in proportion; in the hybrid model architecture, the long short-term memory network processes the input time series data in sequence, and each long short-term memory network receives the enterprise operation feature vector of the current time step, including the first operation efficiency human comprehensive feature, the second operation efficiency human comprehensive feature and each sub-feature contained therein; combined with the hidden state of the previous time step, through the input gate, the forget gate and the output gate, it is determined which information needs to be retained, updated or forgotten; the autoencoder is used to learn the feature representation of the data, and is composed of an encoder and a decoder; the encoder compresses the high-dimensional input data into a low-dimensional encoding space to extract the key features of the data; during the training process, the model continuously adjusts the weight parameters of the model based on the annotation information with the goal of minimizing the loss function between the predicted results and the true annotations; The model is evaluated at each stage of model training and after the training is finally completed; based on the results of the model evaluation, the hyperparameters of the long short-term memory network and the autoencoder are adjusted.
[0033] The newly generated feature sequence is input into a hybrid model that combines a pre-trained long short-term memory network with an autoencoder. The model compares the currently input feature sequence with the normal and abnormal sample feature patterns accumulated during the training phase, comprehensively determines whether the current tax return draft has a risk of tampering, and gives a corresponding risk probability value. For high-risk levels, a pop-up window will appear on the tax declaration operation interface with a risk warning and an attached comparison chart of key abnormal data, showing the difference between the current data and the normal range and providing suggested verification directions. For medium-risk levels, warning information will be sent to relevant staff by email. For low-risk levels, warning information will be published in the system's internal notification bar.
[0034] According to another embodiment of the present invention, Figure 2 As shown in the system structure diagram of a tax declaration draft management system based on a rule engine, a tax declaration draft management system based on a rule engine includes: Data collection and integration module: including: data collection unit and data preprocessing unit; the data collection unit develops data interface, connects to the data source within the enterprise, extracts tax declaration data at a predetermined frequency through ETL tools, including financial data, invoice data, inventory data and human resources data, and the data integration unit performs data preprocessing and integration; Rule engine building module: including: Drools workspace building unit and rule engine configuration unit; wherein, the Drools workspace building unit builds the Drools workspace, creates a rule base directory for storing rule files, and configures the running parameters of the rule engine; the rule engine configuration unit enters rules based on financial data and invoice data, and the rules include tax compliance rules, data logic consistency rules, and risk warning rules; Feature engineering module: including: an inventory feature extraction unit, a human resource feature extraction unit and a comprehensive feature calculation unit; wherein the inventory feature extraction unit extracts inventory features based on inventory data, and the human resource feature extraction unit extracts human resource features based on human resource data; the comprehensive feature calculation unit calculates a first operational efficiency human resource comprehensive feature and a second operational efficiency human resource comprehensive feature according to the inventory feature and the human resource feature; Time series processing and model training module: including: time series expansion unit and model training unit; wherein the time series expansion unit performs time series expansion for the first operational efficiency human comprehensive characteristics and the second operational efficiency human comprehensive characteristics, and performs data annotation based on the rules of the Drools rule engine; the model training unit uses a hybrid model architecture combining a long short-term memory network and an autoencoder, divides the annotated time series data set into a training set, a validation set and a test set, and performs model training, evaluation and optimization; In this embodiment, the sliding window size is set to 4 quarters, and sliding window statistics are calculated for the first operational efficiency human resource comprehensive feature FEATURE1 and the second operational efficiency human resource comprehensive feature FEATURE2. Taking FEATURE1 as an example, the mean of the first window (quarters 1-4) is calculated to be: 0.1875, the standard deviation is: 0.06, the maximum value is 0.3, and the minimum value is 0.1. Similarly, these statistics are calculated for each window and recorded as extended features.
[0035] Decompose FEATURE1 and FEATURE2 using the time series decomposition method. Taking FEATURE1 as an example, through the seasonal decomposition algorithm, it is found that the trend component TREND1 shows an upward trend year by year, the seasonal component SEASON1 shows a certain seasonal fluctuation, the characteristic value is higher in the peak season and lower in the off-season, and the residual component RESIDUAL1 contains some random fluctuations that cannot be explained by trends and seasons. Perform similar decomposition operations on FEATURE2. Data annotation is performed based on the rules of the Drools rule engine.
[0036] The labeled time series data set is divided into training set, validation set and test set in the ratio of 70%, 15% and 15%. The training set contains about 8 quarters of data, and the validation set and test set contain about 2 quarters of data respectively. A hybrid model architecture combining long short-term memory network (LSTM) and autoencoder is selected. The LSTM part sets 2 hidden layers with 64 neurons in each layer to process the long-term and short-term dependencies of time series data; the autoencoder part sets the encoding dimension to 8, and compresses the high-dimensional input data into a low-dimensional encoding space through the encoder, and then reconstructs it by the decoder to learn the key features of the data. The training set data is input into the model for training, with the goal of minimizing the cross entropy loss (for classification labeling tasks) and mean square error loss (for some numerical feature prediction tasks) between the predicted results and the true annotations. The stochastic gradient descent optimization algorithm is used, the learning rate is set to 0.001, and 100 epochs are trained.
[0037] After multiple training and optimizations, the final performance of the model on the test set is as follows: for the classification tasks of various risk labels, the average accuracy rate reaches 0.85, the recall rate reaches 0.8, and the F1 value reaches 0.82, which can accurately identify potential operational risks and compliance issues. For the prediction tasks of numerical features, such as predicting the FEATURE1 and FEATURE2 values of the next quarter, the RMSE is reduced to 0.03 and the MAE is reduced to 0.02, indicating that the model can fit the data trend well and has a certain predictive ability for future operating conditions.
[0038] Risk warning module: including: risk judgment unit and warning push unit; among them, when there is new data update or submission of tax declaration draft, the risk judgment unit inputs the newly generated feature sequence into the trained hybrid model to judge whether there is tampering risk in the current tax declaration draft. If there is tampering risk, the warning push unit will warn the staff.
[0039] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
Claims
1. A tax declaration manuscript management method based on rule engine, characterized in that: The method comprises the following steps: Develop data interfaces to connect to the enterprise's internal data sources, extract tax return data at a predetermined frequency through ETL tools, including financial data, invoice data, inventory data and human resources data, and perform data preprocessing and integration; Build a Drools workspace, create a rule base directory for storing rule files, and configure the operating parameters of the rule engine; enter rules based on financial data and invoice data, including tax compliance rules, data logic consistency rules, and risk warning rules; Extracting inventory features based on inventory data, and extracting human resource features based on human resource data; calculating a first operational efficiency human resource comprehensive feature and a second operational efficiency human resource comprehensive feature based on the inventory features and the human resource features; For the first and second operational efficiency human comprehensive characteristics, time series expansion is performed, and data is labeled based on the rules of the Drools rule engine; a hybrid model architecture combining long short-term memory network and autoencoder is selected, and the labeled time series data set is divided into training set, validation set and test set for model training, evaluation and optimization; When new data is updated or submitted in the tax return draft, the newly generated feature sequence is input into the trained hybrid model to determine whether there is a risk of tampering in the current tax return draft. If there is a risk of tampering, the staff will be warned.
2. According to claim 1, a tax declaration manuscript management method based on rule engine is characterized by: When the company's financial department completes the daily closing operation, it uses the scheduling function of the ETL tool to obtain the latest financial data; Write associated query statements to integrate the data in the invoice management system, associate the invoice master table with the detail table, and obtain the invoice data; For the inventory system database, use query statements to query the real-time status of inventory from the inventory entry table, inventory exit table and inventory balance table to obtain inventory data; Query information from the human resource management system database to obtain human resource data; The extracted financial data, invoice data, inventory data and human resources data are cleaned and converted, and a database based on tax declaration requirements is created. Dimension tables and fact tables are constructed in it, and data from different data sources are integrated through the primary key-foreign key association mechanism; financial data is associated with invoice data, inventory data is associated with financial data, and human resources data is associated with financial data.
3. The tax declaration manuscript management method based on rule engine according to claim 1 is characterized by: Open up an area for Drools-related development and management, and divide it into multiple subdirectories according to functions, including: rule base directory, model directory and test directory; the rule base directory is used to store rule files related to tax declaration, defining constraints and behavior logic; the model directory stores domain model objects related to tax declaration, which is an abstract simplification of the underlying data structure; the test directory is used to write unit test and integration test cases, input different test data, verify whether the rules can be triggered correctly, and output the expected results; In the "kmodule.xml" in the Drools workspace, define various configurations of knowledge sessions, which are used to ensure that different types of sessions meet different business needs; perform rule loading and update parameters, set execution priority, conflict resolution parameters, and performance optimization parameters.
4. The tax declaration manuscript management method based on rule engine according to claim 3 is characterized by: Set up rules for revenue recognition in financial data; for enterprises adopting different sales models, clarify the rules for when and at what amount revenue should be recognized in the financial statements under each model; standardize the rules for issuing, certifying and deducting special VAT invoices and ordinary invoices based on invoice data; Establish a logical connection between financial income data and invoice data. The rule is set that the main business income in the financial statements should fluctuate within a predefined difference range with the tax-inclusive sales amount issued by invoices during the same period. The difference range is determined through statistical analysis of historical data. Set rules for the logical coherence of invoice data. For risk warning rules, warnings are issued for abnormal data fluctuations, tax rate deviations and related-party transaction risks.
5. The tax declaration manuscript management method based on rule engine according to claim 1 is characterized by: Inventory features are extracted based on inventory data, including dynamic features, trend features and correlation features. The dynamic features include inventory turnover rate and inventory change rate, the trend features include moving average and seasonal index, and the correlation feature is the correlation between inventory and sales. Human resource features are extracted based on human resource data, including salary structure features and personnel change features. The salary structure features include salary composition ratio and salary level distribution, and the personnel change features include employee turnover rate and new employee ratio.
6. A tax declaration manuscript management method based on rule engine according to claim 5, characterized in that: For the inventory dynamic characteristics, the inventory turnover rate and the inventory change rate are standardized, and weighted summed according to a first weight, where the first weight is determined according to the importance of the two parameters in the inventory dynamic characteristics on the operating efficiency, to obtain an inventory operating efficiency value; For the inventory trend feature, the moving average and the seasonal index are standardized, and weighted summed according to a second weight, wherein the second weight is weighted according to the relative importance of the two parameters in the inventory trend feature in reflecting the inventory trend, to obtain a comprehensive inventory trend value; For the characteristics of the salary structure, the basic salary ratio, performance salary ratio, bonus ratio and welfare ratio are weighted and summed according to their respective proportions in the total salary to obtain the comprehensive value of the salary structure; The inventory operation efficiency value, the inventory trend comprehensive value and the salary structure comprehensive value are weighted and summed according to a third weight, wherein the third weight is determined through actual business verification to obtain a first operation efficiency human comprehensive feature; The correlation between inventory and sales is standardized to obtain a standardized correlation value. For the personnel change characteristics, the employee turnover rate and the proportion of new employees are standardized, and weighted summed according to the fourth weight, where the fourth weight is determined according to the importance of the two parameters in the personnel change characteristics on the operational efficiency, to obtain a comprehensive personnel change value. The standardized correlation value and the comprehensive personnel change value are added with a half-weight to obtain the second operational efficiency human comprehensive characteristics.
7. A tax declaration manuscript management method based on rule engine according to claim 6, characterized in that: Use historical data analysis regression method to determine the first weight and collect the inventory turnover rate of the enterprise in the past m quarters , Inventory Change Rate And the corresponding operational efficiency indicators ; Establish a multiple linear regression model: ,in is the intercept, is the first regression coefficient, is the second regression coefficient, is the random error term; By performing regression analysis on historical data, we can get the regression coefficient and The estimated value of the inventory turnover rate in the first weight is calculated as follows: , the weight calculation formula for inventory change rate is: ; The second weight and the fourth weight are determined by using an expert scoring method; The third weight is determined by using the hierarchical analysis method; a hierarchical structure model is constructed, wherein the target layer is to determine the comprehensive human resource characteristics of the first operating efficiency, the criterion layer includes inventory operating efficiency, inventory trend and salary structure, and the scheme layer is to allocate weights to each criterion; experts compare the relative importance of each factor in the criterion layer in pairs to construct a judgment matrix; The maximum eigenvalue of the judgment matrix and its corresponding eigenvector are calculated, and the eigenvector is normalized. The normalized vector element obtained is the third weight.
8. The tax declaration manuscript management method based on rule engine according to claim 6 is characterized by: Obtain multiple periods of inventory data and human resource data from the company's database, and arrange the collected data in chronological order to form a structured time series data set; Calculate sliding window statistics for the first operational efficiency manpower comprehensive feature and the second operational efficiency manpower comprehensive feature; Using seasonal decomposition, the time series of each composite feature is split into trend component, seasonal component and residual component; When the time series expanded operational efficiency manpower comprehensive feature data flows into the Drools rule engine, the engine starts rule matching in sequence; the compliance rule verification is performed on each data point one by one, and when a compliance rule condition is met, the corresponding compliance risk label is marked on the data; Match risk warning rules and add risk warning labels when triggered; Execute data logic consistency rules and add data logic consistency tags if they meet the conditions; Based on the annotated time series data set, the data set is divided into training set, validation set and test set according to the proportion; in the hybrid model architecture, the long short-term memory network processes the input time series data in sequence, and each long short-term memory network receives the enterprise operation feature vector of the current time step, including the first operation efficiency human comprehensive feature, the second operation efficiency human comprehensive feature and its contained sub-features; during the training process, the model continuously adjusts the weight parameters of the model based on the annotation information, with the goal of minimizing the loss function between the predicted result and the actual annotation; The model is evaluated at each stage of model training and after the training is finally completed; based on the results of the model evaluation, the hyperparameters of the long short-term memory network and the autoencoder are adjusted.
9. A tax declaration manuscript management method based on rule engine according to claim 8, characterized in that: The newly generated feature sequence is input into a hybrid model that combines a pre-trained long short-term memory network with an autoencoder. The model compares the currently input feature sequence with the normal and abnormal sample feature patterns accumulated during the training phase, comprehensively determines whether the current tax return draft has a risk of tampering, and gives a corresponding risk probability value. For high-risk levels, a pop-up window will pop up on the tax declaration operation interface with risk warnings, key abnormal data comparison charts, showing the difference between the current data and the normal range, and providing suggested verification directions; for medium-risk levels, warning information will be sent to relevant staff via email; For low risk levels, warning information is published in the system’s internal notification bar.
10. A tax declaration draft management system based on a rule engine, using a tax declaration draft management method based on a rule engine according to any one of claims 1 to 9, comprising: Data collection and integration module: including: data collection unit and data preprocessing unit; the data collection unit develops data interface, connects to the data source within the enterprise, extracts tax declaration data at a predetermined frequency through ETL tools, including financial data, invoice data, inventory data and human resources data, and the data integration unit performs data preprocessing and integration; Rule engine building module: including: Drools workspace building unit and rule engine configuration unit; wherein, the Drools workspace building unit builds the Drools workspace, creates a rule base directory for storing rule files, and configures the running parameters of the rule engine; the rule engine configuration unit enters rules based on financial data and invoice data, and the rules include tax compliance rules, data logic consistency rules, and risk warning rules; Feature engineering module: including: an inventory feature extraction unit, a human resource feature extraction unit and a comprehensive feature calculation unit; wherein the inventory feature extraction unit extracts inventory features based on inventory data, and the human resource feature extraction unit extracts human resource features based on human resource data; the comprehensive feature calculation unit calculates a first operational efficiency human resource comprehensive feature and a second operational efficiency human resource comprehensive feature according to the inventory feature and the human resource feature; Time series processing and model training module: including: time series expansion unit and model training unit; wherein the time series expansion unit performs time series expansion for the first operational efficiency human comprehensive characteristics and the second operational efficiency human comprehensive characteristics, and performs data annotation based on the rules of the Drools rule engine; the model training unit uses a hybrid model architecture combining a long short-term memory network and an autoencoder, divides the annotated time series data set into a training set, a validation set and a test set, and performs model training, evaluation and optimization; Risk warning module: including: risk judgment unit and warning push unit; among them, when there is new data update or submission of tax declaration draft, the risk judgment unit inputs the newly generated feature sequence into the trained hybrid model to judge whether there is tampering risk in the current tax declaration draft. If there is tampering risk, the warning push unit will warn the staff.
Citation Information
Patent Citations
Automatic accounting and tax declaring method and system for artificial intelligence accountant
CN111652703A
Tax calculation method and system based on enterprise custom rule
CN116051299A
System and method for tax declaration and risk early warning
CN117934183A
Ai-based enterprise industry and commerce tax information generation method and system
CN118429117A
Project information system integrated management platform
CN118798791A