# Evaluation of Accounting Data of Water Company Based on Combination Model

Authors: Yu Tian; Yonghong Zhang
Journal: Scientific Programming
 (2022)

---

## Abstract

Driven by the dual effects of artificial intelligence and accounting transformation, it has become one of the research hotspots of accounting intelligence in China to replace accountants with computers to make professional judgments and automatically evaluate accounting. On the basis of summarizing and analyzing the research status in the field of intelligent accounting, the realization path of intelligent accounting in water companies is put forward in this paper. By introducing the improved Apriori learning algorithm based on Boolean mapping matrix, intelligent data mining is carried out for evaluation of water accounting. With the help of the improved attribute inductive learning algorithm, the corresponding relationship between the original water consumption attribute and the water right transaction is mined and output. In addition, with the help of forward reasoning in inference engine technology, the computer intelligent data evaluation function is realized. Finally, the functional architecture of accounting system of the water company is designed, which provides reference for the development and application of intelligent accounting system, and explores a new path for the integration of accounting and intelligent algorithms.


---

## Body

## 1. Introduction

After more than 40 years of development, China has basically realized the automation of accounting books and statements processing, but the accounting personnel's professional judgment is always indispensable in the preparation of accounting vouchers, which leads to the stagnation of accounting automation in China. With the continuous development of artificial intelligence in the accounting industry, the research and development of intelligent accounting system with self-learning and the replacement of accountants by computers for professional judgment and automatic preparation of accounting vouchers have become the key research field of accounting [1]. The key to realize the intelligentization of accounting is to make the computer have the ability of autonomous learning, intelligent judgment, and reasoning in unsupervised mode. With the help of accounting rules automatically acquired by intelligent learning algorithm, it can analyze and judge economic business and compile accounting vouchers. Because the computer does not have the function of self-learning, and when the accounting rules change, the accounting voucher template needs to be changed manually, even if the financial robot based on RPA (Robotic Process Automation) technology is not intelligent accounting either. In essence, the financial robot is a computer based on predesigned fixed rules and processes [2] and a computer program that helps human beings to complete standardized work with fixed rules and high repeatability by simulating manual operation of computers.Water enterprises belong to the water rights entity, which is the main body of water resources development and utilization. Water-related businesses include water storage, water treatment, water supply, and water trading [3]. Because of the various types of business, large scale and large water flow, water enterprises are representative in the process of realizing intelligent accounting. In water enterprises, establishing water accounting subjects, accounting water accounting business, formulating water accounting statements, expanding the application of existing water accounting framework of water rights entity to specific water users, and establishing corresponding accounting system can verify that the existing framework of water rights entity is the key of current research [4].Therefore, in this paper, Apriori improved algorithm based on Boolean mapping matrix is used to automatically mine frequent item sets from accounting voucher database, and through attribute-oriented induction (AOI) algorithm, accounting rules are learned and extracted from the original water consumption database independently, forming accounting rule base, which enables the computer to have self-learning ability in unsupervised mode. Combined with the actual operation of water enterprises, the accounting of characteristic businesses such as sewage treatment, construction, and management of water delivery facilities is carried out. While promoting the fine management of water resources, the water accounting system is improved and the connotation of water accounting research is enriched and according to the original water consumption data and accounting rule base, with the help of inference engine technology, the computer has the function of automatically compiling accounting vouchers. Finally, the evaluation of accounting data will be realized, which will help accountants transform from accounting to management-assisted decision-making.


## 2. Basic Accounting Theory and Accounting Basis of the Water Company

### 2.1. Theoretical Framework

At present, there are two representative views on the definition of accounting in China's accounting theory circle, namely, information system theory and management theory [5]. From the perspective of information system theory, water resources accounting can be defined as follows: water resources accounting is based on the stock and flow of water resources, using monetary measurement units, and standardizing according to the requirements of specific accounting assumptions and accounting principles. By adopting the methods of modern accounting, resource economics, mathematics, and asset appraisal, the economic information system provides water resources information to users of water resources accounting information regularly through accounting and supervision [6]. According to the management activity theory, water accounting is a kind of management activity applied to water industry to reflect and control the process and results of water resources circulation caused by ecological circulation of water resources.


#### 2.1.1. Accounting Objectives

Accounting objective is the highest level of accounting theoretical structure, which is the expression of subjective consciousness under certain social and economic environment. Only by correctly understanding the influence of these factors can we study accounting objective more deeply [7]:(1)
Ultimate objective: sustainable development is the theme of world development today. Water accounting is put forward under the condition that water resources are increasingly scarce and the sustainable development and survival of human beings are threatened. Water resources accounting should take sustainable development as the ultimate goal to promote people to rationally utilize water resources.(2)
General objectives: the general goal of water resources accounting is to make rational use of water resources accounting to obtain maximum social and economic benefits. Through the establishment of water resources value system, water resources information can be provided to promote the rational allocation and utilization of water resources. The establishment of water resources value system means that the law of value can be applied to allocate water resources by market [8]. The marketization of water resources (under certain intervention) will make the utilization of water resources more reasonable and scientific.Water supply and demand are regulated separately. Water supply is ultimately determined by the “available water in the region” module, while the demand is mainly specified by the “water demand” module [9, 10]. This separation and linear structure of demand and supply is shown in Figure 1, in which the data connection from one module to another module is indicated by arrows. For example, different data exported from the module of “Water Availability in the Region” are directly transferred to the module of “Distribution of Emissions,” “Water Allocation,” “River Flow Calculation,” and “Groundwater Flow” [11].Figure 1
Module of water resources accounting.


#### 2.1.2. Accounting Hypothesis

Accounting hypothesis is to limit the scope and content of accounting and make logical inference according to the objective normal situation or trend of accounting phenomenon that has not been confirmed. Due to the economic characteristics of water resources, the basic assumptions of water resources accounting should include the following points besides general accounting hypothesis [12–15]:(1)
The assumption of sustainable development: although there are many uncertainties in the economic activities of accounting subjects, the normal procedures and methods of accounting and supervision should be based on the sustainable development of accounting subjects, especially in water resources accounting. Therefore, sustainable development is the hypothetical condition of water resources accounting, which is also the fundamental constraint for us to construct the water resources accounting theory and method system.(2)
Multiple units of measurement hypothesis: water resources accounting should be based on monetary measurement. Its accounting is to supervise enterprises in the whole water resources environment. Besides monetary measurement, physical quantity indicators and words can also be used to explain their social contributions or social losses, such as biochemical oxygen demand, chemical oxygen content, suspended solids, and toxic substances in water pollution indicators.(3)
Multiple measurement attribute hypothesis: the assumption of multiple measurement attributes is also reflected in the fact that multiple measurement attributes should also be adopted within the monetary measurement form. Not only can historical cost, current cost, current market price, net realizable value, and future cash flow be used, but also new measurement attributes such as opportunity cost and substitution cost can be used in water resources accounting.


#### 2.1.3. Accounting

Under the condition of clear water rights, the transformation quantity of microwater rights entity is accompanied by the changes of water quantity increase and decrease, such as water quantity acquisition or use, loss, and discharge, which is reflected in the fact that the increase or decrease of one water resources assets transformation movement is always closely related to the decrease or increase of another water resources assets transformation movement [16]. The accounting structure is shown in Figure 2.Figure 2
Structure of water resources accounting.Account setting of water resources accounting: the confirmation of water accounting elements can be based on traditional accounting element confirmation, which develops and broadens the concept connotation of traditional accounting element confirmation. The elements of water resources accounting include water resources assets, water resources liabilities, water owners' equity, water resources income, water resources expenses, and water resources profits [17]. According to the accounting elements of water resources, accounts such as water resources assets, water resources liabilities, water resources costs, water resources income, water resources profits, water resources capital, and water resources capital appreciation can be set up accordingly.The account of water resources assets reflects the increase and decrease of water resources assets, and the account of accumulated consumption of water resources assets reflects the consumption of water resources assets [18]. “Water resources compensation payable” can be set for water resources liability accounts. The occurrence of water resources costs should be listed in the accounts of production cost, management cost, and manufacturing cost according to their different consumption and occurrence nature, and corresponding secondary accounts, such as water pollution control fee and water quality degradation fee, should be opened to reflect the various water resources costs incurred by microaccounting entities.


## 2.1. Theoretical Framework

At present, there are two representative views on the definition of accounting in China's accounting theory circle, namely, information system theory and management theory [5]. From the perspective of information system theory, water resources accounting can be defined as follows: water resources accounting is based on the stock and flow of water resources, using monetary measurement units, and standardizing according to the requirements of specific accounting assumptions and accounting principles. By adopting the methods of modern accounting, resource economics, mathematics, and asset appraisal, the economic information system provides water resources information to users of water resources accounting information regularly through accounting and supervision [6]. According to the management activity theory, water accounting is a kind of management activity applied to water industry to reflect and control the process and results of water resources circulation caused by ecological circulation of water resources.


### 2.1.1. Accounting Objectives

Accounting objective is the highest level of accounting theoretical structure, which is the expression of subjective consciousness under certain social and economic environment. Only by correctly understanding the influence of these factors can we study accounting objective more deeply [7]:(1)
Ultimate objective: sustainable development is the theme of world development today. Water accounting is put forward under the condition that water resources are increasingly scarce and the sustainable development and survival of human beings are threatened. Water resources accounting should take sustainable development as the ultimate goal to promote people to rationally utilize water resources.(2)
General objectives: the general goal of water resources accounting is to make rational use of water resources accounting to obtain maximum social and economic benefits. Through the establishment of water resources value system, water resources information can be provided to promote the rational allocation and utilization of water resources. The establishment of water resources value system means that the law of value can be applied to allocate water resources by market [8]. The marketization of water resources (under certain intervention) will make the utilization of water resources more reasonable and scientific.Water supply and demand are regulated separately. Water supply is ultimately determined by the “available water in the region” module, while the demand is mainly specified by the “water demand” module [9, 10]. This separation and linear structure of demand and supply is shown in Figure 1, in which the data connection from one module to another module is indicated by arrows. For example, different data exported from the module of “Water Availability in the Region” are directly transferred to the module of “Distribution of Emissions,” “Water Allocation,” “River Flow Calculation,” and “Groundwater Flow” [11].Figure 1
Module of water resources accounting.


### 2.1.2. Accounting Hypothesis

Accounting hypothesis is to limit the scope and content of accounting and make logical inference according to the objective normal situation or trend of accounting phenomenon that has not been confirmed. Due to the economic characteristics of water resources, the basic assumptions of water resources accounting should include the following points besides general accounting hypothesis [12–15]:(1)
The assumption of sustainable development: although there are many uncertainties in the economic activities of accounting subjects, the normal procedures and methods of accounting and supervision should be based on the sustainable development of accounting subjects, especially in water resources accounting. Therefore, sustainable development is the hypothetical condition of water resources accounting, which is also the fundamental constraint for us to construct the water resources accounting theory and method system.(2)
Multiple units of measurement hypothesis: water resources accounting should be based on monetary measurement. Its accounting is to supervise enterprises in the whole water resources environment. Besides monetary measurement, physical quantity indicators and words can also be used to explain their social contributions or social losses, such as biochemical oxygen demand, chemical oxygen content, suspended solids, and toxic substances in water pollution indicators.(3)
Multiple measurement attribute hypothesis: the assumption of multiple measurement attributes is also reflected in the fact that multiple measurement attributes should also be adopted within the monetary measurement form. Not only can historical cost, current cost, current market price, net realizable value, and future cash flow be used, but also new measurement attributes such as opportunity cost and substitution cost can be used in water resources accounting.


### 2.1.3. Accounting

Under the condition of clear water rights, the transformation quantity of microwater rights entity is accompanied by the changes of water quantity increase and decrease, such as water quantity acquisition or use, loss, and discharge, which is reflected in the fact that the increase or decrease of one water resources assets transformation movement is always closely related to the decrease or increase of another water resources assets transformation movement [16]. The accounting structure is shown in Figure 2.Figure 2
Structure of water resources accounting.Account setting of water resources accounting: the confirmation of water accounting elements can be based on traditional accounting element confirmation, which develops and broadens the concept connotation of traditional accounting element confirmation. The elements of water resources accounting include water resources assets, water resources liabilities, water owners' equity, water resources income, water resources expenses, and water resources profits [17]. According to the accounting elements of water resources, accounts such as water resources assets, water resources liabilities, water resources costs, water resources income, water resources profits, water resources capital, and water resources capital appreciation can be set up accordingly.The account of water resources assets reflects the increase and decrease of water resources assets, and the account of accumulated consumption of water resources assets reflects the consumption of water resources assets [18]. “Water resources compensation payable” can be set for water resources liability accounts. The occurrence of water resources costs should be listed in the accounts of production cost, management cost, and manufacturing cost according to their different consumption and occurrence nature, and corresponding secondary accounts, such as water pollution control fee and water quality degradation fee, should be opened to reflect the various water resources costs incurred by microaccounting entities.


## 2.1.1. Accounting Objectives

Accounting objective is the highest level of accounting theoretical structure, which is the expression of subjective consciousness under certain social and economic environment. Only by correctly understanding the influence of these factors can we study accounting objective more deeply [7]:(1)
Ultimate objective: sustainable development is the theme of world development today. Water accounting is put forward under the condition that water resources are increasingly scarce and the sustainable development and survival of human beings are threatened. Water resources accounting should take sustainable development as the ultimate goal to promote people to rationally utilize water resources.(2)
General objectives: the general goal of water resources accounting is to make rational use of water resources accounting to obtain maximum social and economic benefits. Through the establishment of water resources value system, water resources information can be provided to promote the rational allocation and utilization of water resources. The establishment of water resources value system means that the law of value can be applied to allocate water resources by market [8]. The marketization of water resources (under certain intervention) will make the utilization of water resources more reasonable and scientific.Water supply and demand are regulated separately. Water supply is ultimately determined by the “available water in the region” module, while the demand is mainly specified by the “water demand” module [9, 10]. This separation and linear structure of demand and supply is shown in Figure 1, in which the data connection from one module to another module is indicated by arrows. For example, different data exported from the module of “Water Availability in the Region” are directly transferred to the module of “Distribution of Emissions,” “Water Allocation,” “River Flow Calculation,” and “Groundwater Flow” [11].Figure 1
Module of water resources accounting.


## 2.1.2. Accounting Hypothesis

Accounting hypothesis is to limit the scope and content of accounting and make logical inference according to the objective normal situation or trend of accounting phenomenon that has not been confirmed. Due to the economic characteristics of water resources, the basic assumptions of water resources accounting should include the following points besides general accounting hypothesis [12–15]:(1)
The assumption of sustainable development: although there are many uncertainties in the economic activities of accounting subjects, the normal procedures and methods of accounting and supervision should be based on the sustainable development of accounting subjects, especially in water resources accounting. Therefore, sustainable development is the hypothetical condition of water resources accounting, which is also the fundamental constraint for us to construct the water resources accounting theory and method system.(2)
Multiple units of measurement hypothesis: water resources accounting should be based on monetary measurement. Its accounting is to supervise enterprises in the whole water resources environment. Besides monetary measurement, physical quantity indicators and words can also be used to explain their social contributions or social losses, such as biochemical oxygen demand, chemical oxygen content, suspended solids, and toxic substances in water pollution indicators.(3)
Multiple measurement attribute hypothesis: the assumption of multiple measurement attributes is also reflected in the fact that multiple measurement attributes should also be adopted within the monetary measurement form. Not only can historical cost, current cost, current market price, net realizable value, and future cash flow be used, but also new measurement attributes such as opportunity cost and substitution cost can be used in water resources accounting.


## 2.1.3. Accounting

Under the condition of clear water rights, the transformation quantity of microwater rights entity is accompanied by the changes of water quantity increase and decrease, such as water quantity acquisition or use, loss, and discharge, which is reflected in the fact that the increase or decrease of one water resources assets transformation movement is always closely related to the decrease or increase of another water resources assets transformation movement [16]. The accounting structure is shown in Figure 2.Figure 2
Structure of water resources accounting.Account setting of water resources accounting: the confirmation of water accounting elements can be based on traditional accounting element confirmation, which develops and broadens the concept connotation of traditional accounting element confirmation. The elements of water resources accounting include water resources assets, water resources liabilities, water owners' equity, water resources income, water resources expenses, and water resources profits [17]. According to the accounting elements of water resources, accounts such as water resources assets, water resources liabilities, water resources costs, water resources income, water resources profits, water resources capital, and water resources capital appreciation can be set up accordingly.The account of water resources assets reflects the increase and decrease of water resources assets, and the account of accumulated consumption of water resources assets reflects the consumption of water resources assets [18]. “Water resources compensation payable” can be set for water resources liability accounts. The occurrence of water resources costs should be listed in the accounts of production cost, management cost, and manufacturing cost according to their different consumption and occurrence nature, and corresponding secondary accounts, such as water pollution control fee and water quality degradation fee, should be opened to reflect the various water resources costs incurred by microaccounting entities.


## 3. Realization of Intelligent Accounting

At present, there is a general consensus on the transformation of accounting from automation to intelligence under the background of artificial intelligence. However, most of the existing researches on intelligent accounting are focused on the impact of artificial intelligence on accounting industry and personnel, the assumption and prospect of intelligent accounting system architecture, etc. [19], and its development process is shown in Figure 3. Although some researches have studied the realization of intelligent accounting voucher preparation, the research process cannot get rid of accounting voucher template theory, accounting expert simulation theory, and assistant judgment of accountants, and most of the research results belong to the category of semiautomation or weak artificial intelligence. In addition, it is relatively rare to introduce artificial intelligence data mining algorithm into practice of water company, and it is even rarer to study the improvement and integration of machine learning intelligent algorithm and accounting information system. The results of developing practical intelligent accounting system with computer language platform are relatively few [20]. Although BP artificial neural network algorithm is theoretically introduced to explore the confirmation of accounting elements, due to the dynamic learning parameters of BP neural network and the instability of network output, the related research results cannot meet the basic requirements of accounting practice [21].Figure 3
Development of intelligent accounting.The intelligence of the intelligent accounting system is mainly reflected in the fact that the computer must have the ability of self-learning, knowledge updating, judgment reasoning, and knowledge memory storage in unsupervised mode [22]. Therefore, the intelligent accounting system should have enough training samples for machine learning, on the one hand, and introduce intelligent algorithms for machine learning on the other hand, both of which are indispensable. At present, there are only accounting vouchers, account books, statements, and other related data in the mainstream accounting information system in China. The key information needed by machine learning intelligent algorithm is still blank. The core of accounting measurement is to determine the name, accounting direction, and accounting amount of the account. Different economic businesses have different impacts on accounting elements, and the combination of generated account and accounting rules will also have certain changes in different periods and different stages of the development [23].The intelligent learning algorithm should be able to accurately mine and store the account combination rules and extract the corresponding relationship between the original voucher and the accounting voucher from the database (essentially, the corresponding relationship between the attributes and attribute values of the original voucher and the account name, accounting direction and accounting amount of the accounting voucher) [24]. In this way, the accounting system has intelligent attributes and can replace accountants to make professional judgments and automatically compile accounting vouchers, thus developing towards the direction that is shown in Figure 4.Figure 4
Accounting intelligence and its future development trend.


## 4. Accounting of the Water Company Based on Combination Algorithm

### 4.1. Improved Apriori Algorithm

The basic idea of Apriori algorithm is a machine learning intelligent algorithm based on frequency set theory [25], which mines frequent item sets through layer-by-layer search iteration method. Considering that Apriori algorithm will generate a large number of candidate sets in the iterative process, the intersection of some accounting accounts is empty in practice. Therefore, the iterative process of Apriori algorithm will generate a large number of invalid candidate sets. At the same time, Apriori algorithm needs to scan the database frequently to complete pruning and frequency statistics, which will greatly reduce the mining efficiency [26].In view of the shortcomings of traditional Apriori algorithm, this paper proposes an improved Apriori algorithm based on Boolean mapping matrix, combining with combination rules of accounting account. The improvement ideas are as follows:(1)
Build a Boolean account combination matrix, in which the first column represents the number of transaction set W, the second to penultimate columns represent each item in item setR, and the last column is the total number of items in each transaction. Boolean mapping rule is as follows: if an item appears in transaction Ti, the matrix elements in the I-th row of Boolean account combination matrix and the column where the item is located are mapped to “1.” Then map the matrix elements in the column where the item does not appear in row I to “0” and carry out vector inner product operation on the constructed Boolean account combination matrix. The improved Apriori algorithm can complete the required calculation and statistical work only by scanning the database once, and the algorithm efficiency is significantly improved.(2)
In view of the problem that the traditional Apriori algorithm will generate a large number of invalid candidate sets in the iterative process, this paper puts forward an improved strategy of building candidate sets based on the combination rule of accounting accounts: first, after the compound accounting entries are decomposed into simple accounting entries, all transactions in the set are of three types, namely, one-to-one, one-to-many, and many-to-one. According to the statistical rules of water consumption, when a one-to-many transaction candidate set is built, no more than two statistical combinations can appear in all candidate sets at the same time. Similarly, when a “many-to-one” transaction candidate set is built, no more than two combinations can appear in all candidate sets at the same time. The second is to investigate the correspondence between accounting accounts and make full use of the situation that the account portfolio is empty set to shield invalid candidate sets. Third, in the iterative process of the algorithm, if there is only one item in a transaction, the transaction should be deleted from the learning sample.After the improved Apriori algorithm designed in this paper optimizes the construction of combined candidate set through the above three strategies, the invalid candidate set generated by the improved Apriori algorithm will be greatly reduced in the iterative process and the running efficiency of the algorithm has been significantly improved. The flow chart and pseudocode of Apriori improved algorithm is shown in Algorithm1 based on Boolean mapping matrix.Algorithm 1: Improved Apriori Algorithm.
Input:Am×n, Minsupfor (k = 2, Lk-1≠; k++)//Generating frequent k item sets from frequent k-1 item setsbeginC_k = apriori_gen (Lk-1);//Call the apriori_gen function to generate Ck by Lk-1For all transactionsT ∈ DdobeginCt = subset (Ck, t);//t contains the candidate setFor all candidates C ∈ CTmi = M (,i1) M (,i2)//Calculate the vector inner product of the corresponding items in the candidate set, where i is the number of columns of matrix A.qi = COUNT (mi)//Statistics the summary of column i itemsIf qi < Minsup Then Delect, I//calculate to generateAm,n-x row intersection matrix Cm×m m.k = k + 1Go To Line3Lk = {c ∈ Ct&boxv;c.qi ≥ Minsup}//Output frequent itemset LOutput:LENDapriori_genselectp.it1,p.it2,…,p.itk-1from Lk-1p,.Lk-1q,Wherep.it1 = p.it2,…,p.itk-2 = p.itk-2,p.itk-1<p.itk-1;For all itsets c ∈ Ck do//pruning stepIfc ∉ Lk-1or c ∈ Anti_B_R//If it does not belong to Lk-1 or violates the rules of correspondence between accounting direction and accountThen deletec from Ck//Delete cEnd


### 4.2. AOI Algorithm Improvement

In order to explore the relationship between the original water consumption attributes, attribute values, and the combination of accounting accounts, AOI algorithm is introduced. On the basis of attribute compression of attribute values proposed by Hanetal [27], macrotuples are generated step by step and corresponding rules are output by upgrading the concept level of attributes:(1)
Build an original voucher attribute to extract all tuples related to frequent item sets from the original voucher database, take the original voucher name and attribute combination as column names, and make the attribute values corresponding to the combination as column values. In addition, the original certificate attributes also include attributes and attribute value combinations newly added by the company for internal management.(2)
Count the number of attribute value types in each column. If the number of attribute value types is equal to 1, it means that the combination of the original voucher is positively correlated with the frequent item sets by 100%; at the same time, if the number of attribute value types is equal to the number of tuples, it means that the original voucher and attribute combination are not related to frequent item sets. Finally, if the attribute value type number is between 1 and tuple number, it means that the combination of the original voucher is related to frequent item sets to some extent, but the degree of their correlation is not high.(3)
Attribute-oriented generalization: for the case where the number of attribute value types is greater than 1, it is necessary to combine the attributes of the original voucher with the essence of economic business to improve the concept of the attributes of the original voucher. For some attributes in the original voucher that cannot be generalized, remove this column from the original voucher learning sample database.(4)
Specify the generalization threshold. Compress the attributes by setting the generalization threshold; that is, the progress and efficiency of attribute learning are controlled. For an attribute in the knowledge base table, if the number of types is greater than the specified generalization threshold, it should be further generalized. If the number of tuples of the generalized relationship is still greater than the generalization threshold specified by the user, the relationship should be generalized continuously until the set conditions are met and the algorithm is terminated. Otherwise, remove the attribute from the sample library.(5)
Rule verification: when the type number of the original voucher attribute combination is less than or equal to the set generalization threshold, extract all economic and business data from the accounting voucher database and verify the accounting rules. When all tuples related to the business in the accounting voucher database are true, the accounting rule can be output to the rule base. Otherwise, it is stored in the rule base to be verified, to provide reference for accountants, and AOI algorithm ends.


### 4.3. Improved Algorithm Based on Water Flow of the Water Company

7 learning samples are extracted from the water resources flow database (Table1), and let Minsup be 2. The learning process of the improved algorithm is as follows:(1)
According to the Boolean mapping principle [28], the data of water flow database is binarized, and the generated Boolean mapping matrix is shown in Table 2.(2)
Because the total count of F is less than Minsup threshold, five 1-item set items, A, B, C, D, and E, are formed after deleting F column from the matrix. T6 is deleted from the matrix because the subtotal of T6 transaction is less than 2.(3)
Adopt Apriori_gen function to connect A, B, C, D, and E and generate candidate set C2. As the learning samples are all “one-to-many” estimates, and both A and B belong to the rights of water entities, the AB combination is an empty set, which is directly shielded during the connection process. At the same time, A and D do not constitute a corresponding relationship, so the combination of A and D is an empty set, which should be directly excluded in the connection. The results of vector inner product in candidate set C2 and its corresponding column vector generated by the algorithm are shown in Table3.(4)
The result of vector inner product calculation of candidate set C2 shows that only four combinations of BC, BD, BE, and CE meet Minsup threshold, so the algorithm adopts Apriori_gen function again, and according to four frequent 2-item sets, candidate set C3 is generated after connection. Table4 shows the result of vector inner product calculation.(5)
Only BCE in candidate set C3 meets the Minsup threshold, so BCE is the frequent item set; that is, the combination of entity water quantity with the highest frequency leads to the termination of Apriori improved algorithm learning.(6)
Extract all the original voucher sample data related to BCE from the original voucher database, and AOI algorithm is selected to learn.(7)
After deleting the numerical variables (such as “Unused water-surface water –river” and “Unused water - surface water –reservoir”) that have no influence on accounting rules in the original voucher attribute database, count the number of attribute values of original vouchers in each column where “Unused water-surface water” is 5 “Unused water consumption-groundwater” is 1; “Unused water-other water sources” is 2.(8)
Set the attribute learning threshold as 2, and generalize the attribute values with attribute types greater than 2 in the database, upgrading each attribute of “unused water-surface water” to “water resources” and upgrading the attribute of “unused water-groundwater” to “water entity.” So the attribute types in all columns are less than or equal to the set threshold.(9)
Extract all economic businesses in the water consumption database to verify the output rules and whether the accounting account combination in the corresponding accounting voucher is frequent item set BCE. If true, the rule is a strong rule that can be stored in the rule base, and the intelligent accounting algorithm is successfully learned. If false, the rule is weak and can be stored in the rule base to be verified.Table 1
Learning sample of water resources flow (unit: million cubic meters).
Order numberItemStock increaseStock decrease1Water of productive use6002Domestic water1503Environmental water0274Import705Export06.36Purchase507Other departments0.73Table 2
Boolean mapping matrix based on learning samples.
Do the rightNot supplyEmissionUncompensated useActual waterOthersTotalABCDEFT10110103T20111104T30110002T41010002T51000102T60100012T70101002Total254231Table 3
Results of the C2 inner product.
OrderACAEBCBDBECDCEDE100101010200111111300100000410000000501000000600010000Total11322121Table 4
Results of the C3 inner product.
OrderBCDBCEBDE101021113000400050006000Total122


## 4.1. Improved Apriori Algorithm

The basic idea of Apriori algorithm is a machine learning intelligent algorithm based on frequency set theory [25], which mines frequent item sets through layer-by-layer search iteration method. Considering that Apriori algorithm will generate a large number of candidate sets in the iterative process, the intersection of some accounting accounts is empty in practice. Therefore, the iterative process of Apriori algorithm will generate a large number of invalid candidate sets. At the same time, Apriori algorithm needs to scan the database frequently to complete pruning and frequency statistics, which will greatly reduce the mining efficiency [26].In view of the shortcomings of traditional Apriori algorithm, this paper proposes an improved Apriori algorithm based on Boolean mapping matrix, combining with combination rules of accounting account. The improvement ideas are as follows:(1)
Build a Boolean account combination matrix, in which the first column represents the number of transaction set W, the second to penultimate columns represent each item in item setR, and the last column is the total number of items in each transaction. Boolean mapping rule is as follows: if an item appears in transaction Ti, the matrix elements in the I-th row of Boolean account combination matrix and the column where the item is located are mapped to “1.” Then map the matrix elements in the column where the item does not appear in row I to “0” and carry out vector inner product operation on the constructed Boolean account combination matrix. The improved Apriori algorithm can complete the required calculation and statistical work only by scanning the database once, and the algorithm efficiency is significantly improved.(2)
In view of the problem that the traditional Apriori algorithm will generate a large number of invalid candidate sets in the iterative process, this paper puts forward an improved strategy of building candidate sets based on the combination rule of accounting accounts: first, after the compound accounting entries are decomposed into simple accounting entries, all transactions in the set are of three types, namely, one-to-one, one-to-many, and many-to-one. According to the statistical rules of water consumption, when a one-to-many transaction candidate set is built, no more than two statistical combinations can appear in all candidate sets at the same time. Similarly, when a “many-to-one” transaction candidate set is built, no more than two combinations can appear in all candidate sets at the same time. The second is to investigate the correspondence between accounting accounts and make full use of the situation that the account portfolio is empty set to shield invalid candidate sets. Third, in the iterative process of the algorithm, if there is only one item in a transaction, the transaction should be deleted from the learning sample.After the improved Apriori algorithm designed in this paper optimizes the construction of combined candidate set through the above three strategies, the invalid candidate set generated by the improved Apriori algorithm will be greatly reduced in the iterative process and the running efficiency of the algorithm has been significantly improved. The flow chart and pseudocode of Apriori improved algorithm is shown in Algorithm1 based on Boolean mapping matrix.Algorithm 1: Improved Apriori Algorithm.
Input:Am×n, Minsupfor (k = 2, Lk-1≠; k++)//Generating frequent k item sets from frequent k-1 item setsbeginC_k = apriori_gen (Lk-1);//Call the apriori_gen function to generate Ck by Lk-1For all transactionsT ∈ DdobeginCt = subset (Ck, t);//t contains the candidate setFor all candidates C ∈ CTmi = M (,i1) M (,i2)//Calculate the vector inner product of the corresponding items in the candidate set, where i is the number of columns of matrix A.qi = COUNT (mi)//Statistics the summary of column i itemsIf qi < Minsup Then Delect, I//calculate to generateAm,n-x row intersection matrix Cm×m m.k = k + 1Go To Line3Lk = {c ∈ Ct&boxv;c.qi ≥ Minsup}//Output frequent itemset LOutput:LENDapriori_genselectp.it1,p.it2,…,p.itk-1from Lk-1p,.Lk-1q,Wherep.it1 = p.it2,…,p.itk-2 = p.itk-2,p.itk-1<p.itk-1;For all itsets c ∈ Ck do//pruning stepIfc ∉ Lk-1or c ∈ Anti_B_R//If it does not belong to Lk-1 or violates the rules of correspondence between accounting direction and accountThen deletec from Ck//Delete cEnd


## 4.2. AOI Algorithm Improvement

In order to explore the relationship between the original water consumption attributes, attribute values, and the combination of accounting accounts, AOI algorithm is introduced. On the basis of attribute compression of attribute values proposed by Hanetal [27], macrotuples are generated step by step and corresponding rules are output by upgrading the concept level of attributes:(1)
Build an original voucher attribute to extract all tuples related to frequent item sets from the original voucher database, take the original voucher name and attribute combination as column names, and make the attribute values corresponding to the combination as column values. In addition, the original certificate attributes also include attributes and attribute value combinations newly added by the company for internal management.(2)
Count the number of attribute value types in each column. If the number of attribute value types is equal to 1, it means that the combination of the original voucher is positively correlated with the frequent item sets by 100%; at the same time, if the number of attribute value types is equal to the number of tuples, it means that the original voucher and attribute combination are not related to frequent item sets. Finally, if the attribute value type number is between 1 and tuple number, it means that the combination of the original voucher is related to frequent item sets to some extent, but the degree of their correlation is not high.(3)
Attribute-oriented generalization: for the case where the number of attribute value types is greater than 1, it is necessary to combine the attributes of the original voucher with the essence of economic business to improve the concept of the attributes of the original voucher. For some attributes in the original voucher that cannot be generalized, remove this column from the original voucher learning sample database.(4)
Specify the generalization threshold. Compress the attributes by setting the generalization threshold; that is, the progress and efficiency of attribute learning are controlled. For an attribute in the knowledge base table, if the number of types is greater than the specified generalization threshold, it should be further generalized. If the number of tuples of the generalized relationship is still greater than the generalization threshold specified by the user, the relationship should be generalized continuously until the set conditions are met and the algorithm is terminated. Otherwise, remove the attribute from the sample library.(5)
Rule verification: when the type number of the original voucher attribute combination is less than or equal to the set generalization threshold, extract all economic and business data from the accounting voucher database and verify the accounting rules. When all tuples related to the business in the accounting voucher database are true, the accounting rule can be output to the rule base. Otherwise, it is stored in the rule base to be verified, to provide reference for accountants, and AOI algorithm ends.


## 4.3. Improved Algorithm Based on Water Flow of the Water Company

7 learning samples are extracted from the water resources flow database (Table1), and let Minsup be 2. The learning process of the improved algorithm is as follows:(1)
According to the Boolean mapping principle [28], the data of water flow database is binarized, and the generated Boolean mapping matrix is shown in Table 2.(2)
Because the total count of F is less than Minsup threshold, five 1-item set items, A, B, C, D, and E, are formed after deleting F column from the matrix. T6 is deleted from the matrix because the subtotal of T6 transaction is less than 2.(3)
Adopt Apriori_gen function to connect A, B, C, D, and E and generate candidate set C2. As the learning samples are all “one-to-many” estimates, and both A and B belong to the rights of water entities, the AB combination is an empty set, which is directly shielded during the connection process. At the same time, A and D do not constitute a corresponding relationship, so the combination of A and D is an empty set, which should be directly excluded in the connection. The results of vector inner product in candidate set C2 and its corresponding column vector generated by the algorithm are shown in Table3.(4)
The result of vector inner product calculation of candidate set C2 shows that only four combinations of BC, BD, BE, and CE meet Minsup threshold, so the algorithm adopts Apriori_gen function again, and according to four frequent 2-item sets, candidate set C3 is generated after connection. Table4 shows the result of vector inner product calculation.(5)
Only BCE in candidate set C3 meets the Minsup threshold, so BCE is the frequent item set; that is, the combination of entity water quantity with the highest frequency leads to the termination of Apriori improved algorithm learning.(6)
Extract all the original voucher sample data related to BCE from the original voucher database, and AOI algorithm is selected to learn.(7)
After deleting the numerical variables (such as “Unused water-surface water –river” and “Unused water - surface water –reservoir”) that have no influence on accounting rules in the original voucher attribute database, count the number of attribute values of original vouchers in each column where “Unused water-surface water” is 5 “Unused water consumption-groundwater” is 1; “Unused water-other water sources” is 2.(8)
Set the attribute learning threshold as 2, and generalize the attribute values with attribute types greater than 2 in the database, upgrading each attribute of “unused water-surface water” to “water resources” and upgrading the attribute of “unused water-groundwater” to “water entity.” So the attribute types in all columns are less than or equal to the set threshold.(9)
Extract all economic businesses in the water consumption database to verify the output rules and whether the accounting account combination in the corresponding accounting voucher is frequent item set BCE. If true, the rule is a strong rule that can be stored in the rule base, and the intelligent accounting algorithm is successfully learned. If false, the rule is weak and can be stored in the rule base to be verified.Table 1
Learning sample of water resources flow (unit: million cubic meters).
Order numberItemStock increaseStock decrease1Water of productive use6002Domestic water1503Environmental water0274Import705Export06.36Purchase507Other departments0.73Table 2
Boolean mapping matrix based on learning samples.
Do the rightNot supplyEmissionUncompensated useActual waterOthersTotalABCDEFT10110103T20111104T30110002T41010002T51000102T60100012T70101002Total254231Table 3
Results of the C2 inner product.
OrderACAEBCBDBECDCEDE100101010200111111300100000410000000501000000600010000Total11322121Table 4
Results of the C3 inner product.
OrderBCDBCEBDE101021113000400050006000Total122


## 5. Design of the Accounting System of Water Company Based on the Combination Model

According to the accounting practice process and the demand of intelligent accounting [29], the architecture of accounting information system of water company designed in this paper is shown in Figure 5, and the main functional modules are as follows:(1)
System definition and maintenance: this functional module mainly includes the basic work such as account initialization, accounting period definition, and personnel authority management. At the same time, the system also needs to collect and store a large amount of basic data such as personnel information, organization information, and water rights trading information, which lays the foundation for realizing computer intelligent judgment.(2)
The management of water consumption is an important part of intelligent accounting system which is different from ordinary accounting information system. A large amount of original voucher information needed for the learning and training of intelligent accounting system is collected and stored through this link. With the help of OCR text recognition technology and other intelligent data collection technologies, learning samples can be obtained efficiently and accurately for AOI algorithm [30].(3)
Intelligent learning system is the most important module in the intelligent accounting system, which mainly learns and extracts relevant rules from the database of original vouchers and accounting vouchers. First, preprocess learning sample data, including setting control parameters for intelligent learning of the system and creating Boolean mapping matrix according to the accounting voucher database. Second, mine association rules by calling Apriori's improved algorithm, and output frequent accounting account combination item sets to provide basic data for the original voucher attribute learning. Third, learn the attribute of original water consumption after extracting the learning sample data from the original voucher database. Finally, the inference engine automatically calculates and realizes the important function of automatically compiling accounting vouchers [31].Figure 5
Architecture of the accounting information system.


## 6. Conclusion

With the in-depth application of artificial intelligence technology in accounting field, accounting intelligence has become one of the hottest topics in the development of accounting industry at present. Focusing on the intellectualization of accounting, by taking computer intelligent judgment as the direction to replace professional judgment of accounting experts, this paper comprehensively applies improved Apriori algorithm and improved AOI algorithm based on Boolean mapping matrix. In addition, data mining is carried out on the relationship between the original water consumption attribute, attribute value, and water right transaction, and a water accounting rule base is formed. On this basis, the computer self-learning under unsupervised mode, intelligent judgment reasoning, and intelligent accounting of self-updating rule base are realized.



---

*Source: 3373420-2022-04-11.xml*