An accounting data alignment method and system in a multi-service scenario
By constructing a homogeneous accounting feature dataset and summary field set, and combining a hidden Markov model and Viterbi decoding, the problem of low reconciliation efficiency of multi-source heterogeneous accounting data is solved, and accurate alignment and automated processing of accounting data in multiple business scenarios are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 江西环境工程职业学院
- Filing Date
- 2026-02-28
- Publication Date
- 2026-05-29
AI Technical Summary
Existing financial data integration technologies are ill-suited to the rapidly changing business processes and multi-source heterogeneous data environments, resulting in low efficiency in accounting data reconciliation and difficulty in detecting errors and omissions. This severely restricts the real-time performance and accuracy of auditing, risk monitoring, and financial analysis.
By constructing a homogeneous accounting feature dataset and summary field set, keywords are extracted using named entity recognition and word embedding techniques, and combined with hidden Markov models and Viterbi decoding, unified preprocessing and accurate alignment of heterogeneous accounting data are achieved.
It enables automated and accurate alignment of accounting data across multiple business scenarios, effectively tolerating missing fields, inconsistent identifiers, and semantic differences, thereby improving the efficiency and accuracy of accounting data reconciliation.
Smart Images

Figure CN122115135A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and specifically to a method and system for aligning accounting data in multiple business scenarios. Background Technology
[0002] As enterprise informatization deepens, different business lines are deploying specialized subsystems such as procurement management, asset management, and payment management. Each system independently generates accounting data such as original vouchers and accounting vouchers within its own domain. While these data share similarities in basic elements such as voucher number, transaction timestamp, transaction type, summary description, and debit / credit amounts, they often exhibit problems such as missing fields, inconsistent coding, and semantic deviations due to differences in business processes, coding rules, and field design within the various systems. For example, the expression of "research fee" recorded in the equipment procurement subsystem differs from "preliminary research fee" in the asset management subsystem, and "travel expenses" in the payment management subsystem in the summary description. Relying on traditional manual rules or fixed mapping tables for alignment is not only costly to maintain and results in delayed updates, but also ineffective in handling scenarios with missing fields and semantic inconsistencies.
[0003] Existing financial data integration technologies mostly rely on unified accounting subject mapping, manually configured field correspondences, or simple accounting consolidation tools. These technologies are difficult to adapt to frequently changing business processes and multi-source heterogeneous data environments, resulting in low efficiency in accounting data reconciliation, difficulty in detecting errors and omissions, and seriously restricting the real-time performance and accuracy of auditing, risk monitoring, and financial analysis. Summary of the Invention
[0004] This invention extracts structured features such as voucher codes, department codes, accounting object types, debit amounts, and credit amounts from raw voucher data generated by different business subsystems (equipment procurement, asset management, payment management, etc.) within a preset accounting period. It also extracts a set of keywords from the summary description using named entity recognition and word embedding techniques to construct a homogeneous accounting feature dataset and summary field set, achieving unified preprocessing of heterogeneous raw accounting data. Then, based on the overlap of summary keywords, intermediate state observability is defined, and feature records that may belong to the same business object are initially divided into several candidate subsets, effectively tolerating... The system addresses issues such as missing fields, inconsistent identifiers, and semantic differences by loosely aggregating multi-source data. Next, a Hidden Markov Model (HMM) combining discrete feature category distributions and continuous feature Gaussian distributions is applied to each candidate subset. The overall likelihood of the sequence is calculated using a forward algorithm, and the state transition accuracy of Viterbi decoding is combined to dynamically mask and assess the completeness of the candidate subsets. Accounting features inconsistent with the core state sequence are iteratively eliminated, achieving fine-grained alignment of candidate boundaries. Finally, the converged candidate subsets are used as the same business object accounting dataset, enabling automated and accurate alignment of accounting information across subsystems in multiple business scenarios.
[0005] This invention provides a method for aligning accounting data in multiple business scenarios, including: Acquire raw accounting data from different business scenarios within a preset period, and combine the raw accounting data into a raw accounting dataset. Annotate the raw accounting data using transaction timestamps, accounting feature data, and summary field sets, and associate the accounting feature data and summary field sets. Based on intermediate state observability, candidate subsets are constructed from the accounting feature dataset to obtain several candidate subsets. Each candidate subset includes several accounting feature data. Intermediate state observability refers to the degree of overlap of related keywords in the accounting feature data. Iterate through all candidate subsets and perform the following operations for each subset: iterate through the accounting feature data in the candidate subset, record the selected accounting feature data as the target accounting feature data, mask the target accounting feature data in the candidate subset, perform a completeness check on the masked candidate subset, if the masked candidate subset meets the completeness check, delete the target accounting feature data from the candidate subset and add the target accounting feature data to the candidate subset construction pool for the next candidate subset construction, if the masked candidate subset does not meet the completeness check, cancel the masking operation; after all accounting feature data in the candidate subset has been traversed, iterate through the accounting feature data in the candidate subset again from the beginning until the completeness of the candidate subset converges, record the candidate subset as a business object set, and combine the original accounting data corresponding to all accounting feature data in the business object set to form a unified business object accounting dataset, thus achieving the alignment of accounting data.
[0006] Preferably, candidate subsets are constructed from the accounting feature dataset based on the observability of intermediate states, resulting in several candidate subsets, specifically including the following: All accounting feature data were subjected to cluster analysis using the K-means algorithm, resulting in several clusters of accounting feature data. It should be noted that during the execution of the K-means algorithm, the similarity between accounting features was used as the distance, and the similarity was calculated using the cosine similarity algorithm. For each accounting feature data cluster, perform a union operation on the summary field sets associated with all accounting feature data in the cluster to obtain the comprehensive field set corresponding to the cluster. Then, iterate through all accounting feature data in the dataset except those corresponding to the cluster. For each selected accounting feature data, match the summary field set associated with the selected data with the comprehensive field set. The matching method is to calculate the similarity between the keywords in the summary field set and the keywords in the comprehensive field set, and record it as the matching value. If the largest matching value for a keyword in the summary field set is higher than the matching threshold, it is considered a successful match. Calculate the ratio of the number of successfully matched keywords in the summary field set to the total number of keywords in the summary field set, and record it as the intermediate state observability. If the intermediate state observability is higher than the observation threshold, add the selected accounting feature data to the cluster. This process continues until all accounting feature data in the dataset except those corresponding to the cluster has been traversed, and the cluster is then designated as a candidate subset.
[0007] Preferably, the completeness determination is performed on the masked candidate subset, specifically including the following steps: All accounting feature data in the masked candidate subset are arranged in chronological order according to the associated transaction timestamps to construct an accounting feature data sequence; The accounting feature data sequence is analyzed based on the trained accounting feature data sequence analysis model to determine the overall likelihood and state transition accuracy of the sequence. The completeness is obtained by weighted summation of the overall likelihood and state transition accuracy. If the completeness is higher than the completeness threshold, which is set by the operator, it is considered to meet the completeness judgment. The accounting feature data sequence analysis model is trained using an accounting feature data sequence set. The accounting feature data sequence set is constructed as follows: for each candidate subset, accounting feature data in the candidate subset is sequentially masked. For each masked accounting feature data, an accounting feature data sequence sample is constructed. All constructed accounting feature data sequence samples are combined to form the accounting feature data sequence set.
[0008] Preferably, training an accounting feature data sequence analysis model using an accounting feature data sequence sample set specifically includes the following steps: Step S1: Select the number M of hidden states from the set of hidden states, and initialize the transition matrix, initial distribution, and emission distribution. The transition matrix is an M×M matrix, where the transition probability from the i-th hidden state to the j-th hidden state is described in the i-th row and j-th column. The initial distribution is the probability distribution of all hidden states corresponding to the first transaction timestamp, and the emission distribution is the probability distribution of accounting feature data corresponding to each transaction timestamp under each hidden state. The transition matrix, initial distribution, and emission distribution together form the accounting feature data sequence analysis model. Step S2: Forward computation; Step S2.1: For the first transaction timestamp, calculate the emission probability of each hidden state based on the accounting feature data corresponding to the first transaction timestamp through the emission distribution. Iterate through all hidden states. For each hidden state, obtain the initial distribution probability of the initial distribution in the hidden state, and calculate the product of the initial distribution probability and the emission probability to obtain the initial forward probability in the hidden state. Step S2.1: Traverse from the second transaction timestamp to the last transaction timestamp. For the t-th transaction timestamp, calculate the emission probability of each hidden state based on the accounting feature data corresponding to the transaction timestamp using the emission distribution. Traverse all hidden states. For the j-th hidden state, calculate the cumulative forward probability corresponding to the i-th hidden state in the previous transaction timestamp and the transition probability from the i-th hidden state to the j-th hidden state to obtain the intermediate forward probability corresponding to the i-th hidden state in the previous transaction timestamp. Then, multiply the sum of the intermediate forward probabilities corresponding to all hidden states in the previous transaction timestamp and the emission probability of the j-th hidden state as the cumulative forward probability corresponding to the j-th hidden state in the t-th transaction timestamp. The cumulative forward probability corresponding to the j-th hidden state in the second transaction timestamp is the corresponding initial forward probability. Step S3: Backward computation; Step S3.1: For the last transaction timestamp, set the initial backward probability of each hidden state using a constant, generally set to 1; Step S3.2: Traverse from the second-to-last transaction timestamp to the first transaction timestamp. For the t-th transaction timestamp, calculate the emission probability of each hidden state based on the accounting feature data corresponding to the (t+1)-th transaction timestamp using the emission distribution. For the i-th hidden state of the t-th transaction timestamp, traverse all hidden states. For the j-th hidden state, calculate the product of the transition probability from the i-th hidden state to the j-th hidden state, the emission probability of the j-th hidden state of the (t+1)-th transaction timestamp, and the cumulative backward probability of the j-th hidden state corresponding to the (t+1)-th transaction timestamp. This product is recorded as the intermediate backward probability corresponding to the j-th hidden state in the (t+1)-th transaction timestamp. The sum of the intermediate backward probabilities corresponding to all hidden states in the (t+1)-th transaction timestamp is recorded as the cumulative forward and backward probability corresponding to the i-th hidden state of the t-th transaction timestamp. The cumulative backward probability corresponding to the i-th hidden state of the last transaction timestamp is the corresponding initial backward probability. Step S4: For the i-th hidden state at the t-th transaction timestamp, divide the product of the accumulated forward probability and the accumulated backward probability corresponding to the i-th hidden state at the t-th transaction timestamp by the sum of all accumulated forward probabilities corresponding to the last transaction timestamp to obtain the posterior probability corresponding to the i-th hidden state at the t-th transaction timestamp. For the i-th and j-th hidden states at the t-th transaction timestamp, record the product of the accumulated forward probability corresponding to the i-th hidden state at the t-th transaction timestamp, the transition probability from the i-th hidden state to the j-th hidden state, the emission probability of the j-th hidden state at the (t+1)-th transaction timestamp, and the accumulated backward probability of the j-th hidden state corresponding to the (t+1)-th transaction timestamp as the posterior intermediate quantity. Then divide the posterior intermediate quantity by the sum of all accumulated forward probabilities corresponding to the last transaction timestamp to obtain the posterior probability of the transition between the i-th and j-th hidden states at the t-th transaction timestamp. Step S5: Replace the initial distribution with the posterior probabilities of all hidden states corresponding to the first transaction timestamp to update the initial distribution; for the i-th hidden state and the j-th hidden state, sum the posterior probabilities of the transitions corresponding to all transaction timestamps to obtain the expected value corresponding to the i-th hidden state and the j-th hidden state, and record the sum of the posterior probabilities of all transaction timestamps corresponding to the i-th hidden state as the total expected value corresponding to the i-th hidden state and the j-th hidden state, and replace the expected value corresponding to the i-th hidden state and the j-th hidden state with the ratio of the expected value corresponding to the i-th hidden state and the j-th hidden state to the total expected value, and update the transition matrix; Step S6: Repeat steps S2-S5 until the sum of all accumulated forward probabilities corresponding to the last transaction timestamp converges, and obtain the accounting feature data sequence analysis model corresponding to the number of hidden states M. Return to step S1 and select the next number of hidden states M. Step S7: Calculate the Bayesian information criterion index of the accounting feature data sequence analysis model corresponding to each number of hidden states M, and select the accounting feature data sequence analysis model corresponding to the smallest Bayesian information criterion index for output.
[0009] Preferably, when updating the transition matrix, a fixed value is added to the expected value corresponding to the i-th hidden state and the j-th hidden state to avoid the situation where the transition probability is 0, thereby improving the generalization ability of the accounting feature data sequence analysis model to new data. Preferably, determining the overall likelihood and state transition accuracy of the sequence specifically includes the following steps: The accounting feature data sequence is analyzed by the forward computation part of the accounting feature data sequence analysis model, and the sum of all accumulated forward probabilities corresponding to the last transaction timestamp is obtained, which is the overall likelihood of the sequence. The Viterbi algorithm is used to decode the best hidden state corresponding to each transaction timestamp in the accounting feature data sequence. For any two best hidden states corresponding to adjacent transaction timestamps, if the transition probability of the two best hidden states in the transition matrix of the accounting feature data sequence analysis model is higher than the transition threshold, it is a normal transition. The number of normal transitions is recorded, and the ratio of the number of normal transitions to the total number of transitions is recorded as the state transition accuracy.
[0010] This invention also provides an accounting data alignment system for multiple business scenarios, comprising: The accounting data preprocessing module is used to acquire raw accounting data from different business scenarios within a preset period, and to assemble the raw accounting data into a raw accounting dataset. The raw accounting data is labeled with transaction timestamps, accounting feature data and summary field sets, and the accounting feature data and summary field sets are associated. The candidate subset construction module is used to construct candidate subsets of the accounting feature dataset based on intermediate state observability, resulting in several candidate subsets. Each candidate subset includes several accounting feature data, and intermediate state observability is the degree of overlap of related keywords in the accounting feature data. The completeness analysis module iterates through all candidate subsets and performs the following operations for each subset: iterates through the accounting feature data in the subset, records the selected accounting feature data as the target accounting feature data, masks the target accounting feature data in the subset, performs a completeness check on the masked subset, if the masked subset meets the completeness check, removes the target accounting feature data from the subset and adds it to the candidate subset construction pool for the next candidate subset construction, if the masked subset does not meet the completeness check, cancels the masking operation; after all accounting feature data in the candidate subset has been traversed, it iterates through the accounting feature data in the candidate subset again from the beginning until the completeness of the candidate subset converges, records the candidate subset as a business object set, and combines the original accounting data corresponding to all accounting feature data in the business object set into a unified business object accounting dataset, thus achieving the alignment of accounting data.
[0011] The present invention has the following advantages: This invention extracts structured features such as voucher codes, department codes, accounting object types, debit amounts, and credit amounts from raw voucher data generated by different business subsystems (equipment procurement, asset management, payment management, etc.) within a preset accounting period. It also extracts a set of keywords from the summary description using named entity recognition and word embedding techniques to construct a homogeneous accounting feature dataset and summary field set, achieving unified preprocessing of heterogeneous raw accounting data. Then, based on the overlap of summary keywords, intermediate state observability is defined, and feature records that may belong to the same business object are initially divided into several candidate subsets, effectively tolerating... The system addresses issues such as missing fields, inconsistent identifiers, and semantic differences by loosely aggregating multi-source data. Next, a Hidden Markov Model (HMM) combining discrete feature category distributions and continuous feature Gaussian distributions is applied to each candidate subset. The overall likelihood of the sequence is calculated using a forward algorithm, and the state transition accuracy of Viterbi decoding is combined to dynamically mask and assess the completeness of the candidate subsets. Accounting features inconsistent with the core state sequence are iteratively eliminated, achieving fine-grained alignment of candidate boundaries. Finally, the converged candidate subsets are used as the same business object accounting dataset, enabling automated and accurate alignment of accounting information across subsystems in multiple business scenarios. Attached Figure Description
[0012] Figure 1 This is a schematic diagram of the structure of the accounting data alignment system under multiple business scenarios used in an embodiment of the present invention. Detailed Implementation
[0013] To enable those skilled in the art to better understand the technical solutions of this invention, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of this invention.
[0014] Example 1: A method for aligning accounting data in multiple business scenarios, comprising: The process involves acquiring raw accounting data from different business scenarios within a preset period and assembling this data into a raw accounting dataset. The preset period, typically set to one month, is designed by operators based on financial settlement schedules. Different business scenarios refer to different business subsystems within the same enterprise, such as a procurement subsystem related to equipment purchase, an asset management subsystem recording asset establishment, depreciation, and disposal, and a payment management subsystem recording payments and final settlements. These different subsystems generate different raw accounting data, such as original vouchers and accounting vouchers. This raw accounting data generally includes the corresponding voucher number, transaction timestamp, transaction type code, summary description, and transaction amount. The summary description is the accounting-related information in the raw accounting data, such as "purchased steel from supplier Company A." The raw accounting data is annotated using transaction timestamps, accounting feature data, and summary field sets, and these are linked. The accounting feature data is extracted from the raw accounting data and generally includes voucher code, department code, accounting object type, accounting debit amount, and accounting credit amount. The accounting object type refers to the original voucher... The data is categorized into three object types: assets, liabilities, and revenues. In accounting, debit and credit refer to the left and right sides of the double-entry bookkeeping system. Asset debits are positive, and asset credits are negative; liability debits are negative, and liability credits are positive. These are the rules of accounting. By annotating the raw accounting data with accounting characteristics, the raw accounting data can be abstracted into unified and clearly defined analytical data, providing a data reference for subsequent accounting data alignment and mapping all raw accounting data to... The accounting feature dataset is composed of accounting feature data. The summary field set is a set of keywords extracted from the summary description of the original accounting data through named entity recognition. Here, named entity recognition generally adopts the CRF model, and the extracted keywords are digitized through word embedding. Among them, voucher code, department code, and accounting object type are discrete coded data and are regarded as discrete features, while accounting debit amount and accounting credit amount are continuous numerical data and are regarded as continuous features. Furthermore, due to the possible field missing issues, some missing data in the accounting feature data are directly set to 0. Based on intermediate state observability, candidate subsets are constructed from the accounting feature dataset, resulting in several candidate subsets. Each candidate subset includes several accounting feature data. Intermediate state observability refers to the degree of overlap of related keywords in the accounting feature data. It should be noted that, considering that the original accounting data of the same object in different business scenarios may have missing fields, inconsistent fields, or different field semantics, for example, when executing a project, the project may not be determined, but travel expenses, consulting fees, and preliminary research fees incurred during the project research may have already been generated. The business object corresponding to these expenses is not determined, resulting in missing corresponding fields. At the same time, different business systems or business processes may use different identification methods or field values for the same business object, resulting in inconsistent fields. In addition, even if the field names are the same, their business meaning and the level of the object they point to may be different in different business scenarios, resulting in semantic differences in fields. Therefore, the degree of overlap of related keywords in the accounting feature data is used to delineate the boundaries of the original accounting data that may belong to the same business object, in order to facilitate subsequent completeness judgment. Iterate through all candidate subsets and perform the following operations for each subset: Iterate through the accounting feature data in the candidate subset, and mark the selected accounting feature data as the target accounting feature data. Mask the target accounting feature data within the candidate subset. Perform a completeness check on the masked candidate subset. The completeness check is based on a Hidden Markov Model and can determine whether all accounting feature data in the masked candidate subset conforms to the state transition of the same object. If the masked candidate subset conforms to the completeness check, it means that all accounting feature data in the masked candidate subset better conforms to the state transition of the same object. Therefore, the original accounting data corresponding to the masked accounting feature data is inconsistent with the business object corresponding to the candidate subset as a whole. Delete the target accounting feature data from the candidate subset and set the target accounting feature data to the target accounting feature data. Feature data is added to the candidate subset construction pool for the next candidate subset construction. If the masked candidate subset does not meet the completeness judgment, it means that under the premise that there is original accounting data corresponding to other business objects in the candidate subset, all accounting feature data in the masked candidate subset cannot be further judged as to whether they conform to the state transition of the same object. The target accounting feature data of this masking is likely to belong to the business object corresponding to the candidate subset as a whole, and the masking operation is canceled. After all the accounting feature data in the candidate subset has been traversed, the accounting feature data in the candidate subset is traversed again from the beginning until the completeness of the candidate subset converges. The candidate subset is recorded as a business object set, and the original accounting data corresponding to all accounting feature data in the business object set are combined into a unified business object accounting dataset, thus realizing the alignment of accounting data.
[0015] Based on the observability of intermediate states, candidate subsets are constructed from the accounting feature dataset, resulting in several candidate subsets, specifically including the following: All accounting feature data were subjected to cluster analysis using the K-means algorithm, resulting in several clusters of accounting feature data. It should be noted that during the execution of the K-means algorithm, the similarity between accounting features was used as the distance, and the similarity was calculated using the cosine similarity algorithm. For each accounting feature data cluster, a union operation is performed on the summary field sets associated with all accounting feature data within the cluster to obtain a comprehensive field set corresponding to the cluster. This comprehensive field set is considered an intermediate state corresponding to the cluster, representing the overall distribution of the descriptive content. Then, the accounting feature data in the dataset, excluding all accounting feature data associated with the cluster, is traversed. For each selected accounting feature data, the summary field set associated with that data is matched against the comprehensive field set. The matching method involves calculating the similarity between keywords in the summary field set associated with the selected data and keywords in the comprehensive field set, and recording this as the matching value. If the keywords in the summary field set associated with the selected data are similar to the keywords in the comprehensive field set, then the matching value is considered a match. If the largest matching value is higher than the matching threshold (set by the operator), it is considered a successful match. The ratio of the number of successfully matched keywords in the summary field set to the total number of keywords in the summary field set is calculated and recorded as the intermediate state observability. If the intermediate state observability is higher than the observation threshold (set by the operator), it indicates that there is a high probability that they can be considered to belong to the same business object. The selected accounting feature data is then added to the accounting feature data cluster. This process continues until all accounting feature data in the accounting feature dataset except for all accounting feature data corresponding to the accounting feature data cluster has been traversed. The accounting feature data cluster is then recorded as a candidate subset. It should be noted that the candidate subset defines a boundary that may belong to the same business object, which facilitates subsequent completeness judgment. There may be overlapping accounting feature data between candidate subsets.
[0016] Perform a completeness check on the masked candidate subset, which includes the following steps: All accounting feature data in the masked candidate subset are arranged in chronological order according to the associated transaction timestamps to construct an accounting feature data sequence; The accounting feature data sequence is analyzed based on a pre-trained accounting feature data sequence analysis model to determine the overall likelihood and state transition accuracy of the sequence. The completeness is obtained by weighted summation of the overall likelihood and state transition accuracy. The overall likelihood describes the degree to which the accounting feature data sequence conforms to the state transition of accounting feature data of the same business object, while the state transition accuracy describes the accuracy with which adjacent accounting feature data in the accounting feature data sequence conform to the state transition. If the completeness is higher than the completeness threshold, which is set by the operator, it is considered to meet the completeness judgment. The accounting feature data sequence analysis model is trained using an accounting feature data sequence set. The accounting feature data sequence set is constructed as follows: for each candidate subset, accounting feature data in the candidate subset is sequentially masked. For each masked accounting feature data, an accounting feature data sequence sample is constructed. All constructed accounting feature data sequence samples are combined to form the accounting feature data sequence set. The accounting feature data sequence analysis model adopts the Hidden Markov Model (HMM) model, and the training method uses the EM algorithm.
[0017] Training an accounting feature data sequence analysis model using a sample set of accounting feature data sequences involves the following steps: Step S1: Select the number M of hidden states from the set of hidden states. The set of hidden states is generally set to {2, 3, 4, ..., 8}. Hidden states are used to describe different stages of business objects, such as "pending payment", "balance paid", "partial payment received", "final settlement", etc.; and initialize the transition matrix, initial distribution and emission distribution. The transition matrix is an M×M matrix, where the transition probability from the i-th hidden state to the j-th hidden state is described in the i-th row and j-th column. The initial distribution is the probability distribution of all hidden states corresponding to the first transaction timestamp. The emission distribution is the probability distribution of accounting feature data corresponding to each transaction timestamp under each hidden state. The transition matrix, initial distribution and emission distribution together form the accounting feature data sequence analysis model. The initialization of the accounting feature data sequence analysis model is determined by the operator based on experience. It should be noted that accounting feature data includes discrete and continuous parts. For the discrete part, in the latent state, each dimension of each discrete feature follows a categorical distribution. For the continuous part, in the latent state, each continuous feature follows a Gaussian distribution. Step S2: Forward computation; Step S2.1: For the first transaction timestamp, calculate the emission probability of each hidden state based on the accounting feature data corresponding to the first transaction timestamp through the emission distribution. Iterate through all hidden states. For each hidden state, obtain the initial distribution probability of the initial distribution in the hidden state, and calculate the product of the initial distribution probability and the emission probability to obtain the initial forward probability in the hidden state. It should be noted that, when determining the emission probability, for each discrete feature in the accounting feature data, the corresponding category distribution is looked up in a table, and all the probabilities obtained are multiplied to obtain the discrete probability. For each continuous feature in the accounting feature data, the continuous probability is obtained by sampling through a Gaussian distribution, and the sum of all continuous probabilities is multiplied by the discrete probability to obtain the emission probability. Step S2.1: Traverse from the second transaction timestamp to the last transaction timestamp. For the t-th transaction timestamp, calculate the emission probability of each hidden state based on the accounting feature data corresponding to the transaction timestamp using the emission distribution. Traverse all hidden states. For the j-th hidden state, calculate the cumulative forward probability corresponding to the i-th hidden state in the previous transaction timestamp and the transition probability from the i-th hidden state to the j-th hidden state to obtain the intermediate forward probability corresponding to the i-th hidden state in the previous transaction timestamp. Then, multiply the sum of the intermediate forward probabilities corresponding to all hidden states in the previous transaction timestamp and the emission probability of the j-th hidden state as the cumulative forward probability corresponding to the j-th hidden state in the t-th transaction timestamp. The cumulative forward probability corresponding to the j-th hidden state in the second transaction timestamp is the corresponding initial forward probability. Step S3: Backward computation; Step S3.1: For the last transaction timestamp, set the initial backward probability of each hidden state using a constant, generally set to 1; Step S3.2: Traverse from the second-to-last transaction timestamp to the first transaction timestamp. For the t-th transaction timestamp, calculate the emission probability of each hidden state based on the accounting feature data corresponding to the (t+1)-th transaction timestamp using the emission distribution. For the i-th hidden state of the t-th transaction timestamp, traverse all hidden states. For the j-th hidden state, calculate the product of the transition probability from the i-th hidden state to the j-th hidden state, the emission probability of the j-th hidden state of the (t+1)-th transaction timestamp, and the cumulative backward probability of the j-th hidden state corresponding to the (t+1)-th transaction timestamp. This product is recorded as the intermediate backward probability corresponding to the j-th hidden state in the (t+1)-th transaction timestamp. The sum of the intermediate backward probabilities corresponding to all hidden states in the (t+1)-th transaction timestamp is recorded as the cumulative forward and backward probability corresponding to the i-th hidden state of the t-th transaction timestamp. The cumulative backward probability corresponding to the i-th hidden state of the last transaction timestamp is the corresponding initial backward probability. Step S4: For the i-th hidden state at the t-th transaction timestamp, divide the product of the accumulated forward probability and the accumulated backward probability corresponding to the i-th hidden state at the t-th transaction timestamp by the sum of all accumulated forward probabilities corresponding to the last transaction timestamp to obtain the posterior probability corresponding to the i-th hidden state at the t-th transaction timestamp. For the i-th and j-th hidden states at the t-th transaction timestamp, record the product of the accumulated forward probability corresponding to the i-th hidden state at the t-th transaction timestamp, the transition probability from the i-th hidden state to the j-th hidden state, the emission probability of the j-th hidden state at the (t+1)-th transaction timestamp, and the accumulated backward probability of the j-th hidden state corresponding to the (t+1)-th transaction timestamp as the posterior intermediate quantity. Then divide the posterior intermediate quantity by the sum of all accumulated forward probabilities corresponding to the last transaction timestamp to obtain the posterior probability of the transition between the i-th and j-th hidden states at the t-th transaction timestamp. Step S5: Replace the initial distribution with the posterior probabilities of all hidden states corresponding to the first transaction timestamp to update the initial distribution; for the i-th and j-th hidden states, sum the posterior probabilities of the transitions corresponding to all transaction timestamps to obtain the expected values corresponding to the i-th and j-th hidden states. Record the sum of the posterior probabilities of all transaction timestamps corresponding to the i-th hidden state as the total expected value corresponding to the i-th and j-th hidden states. Replace the expected value of the i-th and j-th hidden states with the total expected value as the transition probability from the i-th to the j-th hidden state, and update the transition matrix; furthermore, to avoid overfitting, a fixed value can be added to the expected value of the i-th and j-th hidden states when updating the transition matrix. This fixed value is set by the operator to avoid a transition probability of 0, thus improving the generalization ability of the accounting feature data sequence analysis model to new data; Step S6: Repeat steps S2-S5 until the sum of all accumulated forward probabilities corresponding to the last transaction timestamp converges, and obtain the accounting feature data sequence analysis model corresponding to the number of hidden states M. Return to step S1 and select the next number of hidden states M. Step S7: Calculate the Bayesian information criterion index of the accounting feature data sequence analysis model corresponding to each number of hidden states M, and select the accounting feature data sequence analysis model corresponding to the smallest Bayesian information criterion index for output; Since HMM is a probabilistic model that generates observations based on hidden states, it maps heterogeneous discrete labels, numerical features, and text embeddings from multiple sources to a shared set of hidden states. It evaluates the matching degree of observations at each time step by modeling each attribute separately and taking the joint probability in the emission distribution B, thus not relying on strict field alignment. When encountering missing fields, the corresponding items can be marginalized or skipped in the emission probability calculation. When encountering semantic or encoding inconsistencies, it is only necessary to map them to the same discrete category or similar continuous distribution. The model can still aggregate observation patterns in different scenarios through posterior probability and identify the common state transition trajectory of the same object in different business processes.
[0018] Determining the overall likelihood and state transition accuracy of a sequence involves the following steps: The accounting feature data sequence is analyzed by the forward computation part of the accounting feature data sequence analysis model, and the sum of all accumulated forward probabilities corresponding to the last transaction timestamp is obtained, which is the overall likelihood of the sequence. The Viterbi algorithm is used to decode the best hidden state corresponding to each transaction timestamp in the accounting feature data sequence. For any two best hidden states corresponding to adjacent transaction timestamps, if the transition probability of the two best hidden states in the transition matrix of the accounting feature data sequence analysis model is higher than the transition threshold (the transition threshold is set manually), it means that the accounting feature data corresponding to the two transaction timestamps conforms to the state transition of the same business object, which is a normal transition. The number of normal transitions is recorded, and the ratio of the number of normal transitions to the total number of transitions is recorded as the state transition accuracy.
[0019] This application achieves unified preprocessing of heterogeneous raw accounting data by uniformly extracting structured features such as voucher codes, department codes, accounting object types, debit amounts, and credit amounts from original voucher data generated by different business subsystems such as equipment procurement, asset management, and payment management within a preset accounting period. It also constructs a homogeneous accounting feature dataset and summary field set by extracting a set of keywords from the summary description using named entity recognition and word embedding technologies. Then, based on the overlap of summary keywords, intermediate state observability is defined, and feature records that may belong to the same business object are initially divided into several candidate subsets, effectively tolerating... The system addresses issues such as missing fields, inconsistent identifiers, and semantic differences by loosely aggregating multi-source data. Next, a Hidden Markov Model (HMM) combining discrete feature category distributions and continuous feature Gaussian distributions is applied to each candidate subset. The overall likelihood of the sequence is calculated using a forward algorithm, and the state transition accuracy of Viterbi decoding is combined to dynamically mask and assess the completeness of the candidate subsets. Accounting features inconsistent with the core state sequence are iteratively eliminated, achieving fine-grained alignment of candidate boundaries. Finally, the converged candidate subsets are used as the same business object accounting dataset, enabling automated and accurate alignment of accounting information across subsystems in multiple business scenarios.
[0020] Example 2: An accounting data alignment system for multiple business scenarios, such as... Figure 1 As shown, it includes: The accounting data preprocessing module is used to acquire raw accounting data from different business scenarios within a preset period and assemble the raw accounting data into a raw accounting dataset. The preset period is designed by operators based on the financial settlement time, typically set to one month. Different business scenarios refer to different business subsystems within the same enterprise, such as a procurement subsystem related to equipment purchase, an asset management subsystem recording asset establishment, depreciation, and scrapping, and a payment management subsystem recording payments and final settlements. These different business subsystems generate different raw accounting data, such as original vouchers and accounting vouchers. This raw accounting data generally includes the corresponding voucher number, transaction timestamp, transaction type code, summary description, and transaction amount. The summary description is the accounting-related explanation in the raw accounting data, such as "purchased steel from supplier Company A". The raw accounting data is annotated using transaction timestamps, accounting feature data, and summary field sets, and the accounting feature data and summary field sets are associated. The accounting feature data is extracted from the raw accounting data and generally includes voucher code, department code, accounting object type, accounting debit amount, and accounting credit amount. This refers to the object type to which the original accounting data belongs, including asset, liability, and revenue categories. In accounting debit and credit amounts, debit and credit refer to the left and right sides of double-entry bookkeeping. Asset debit amounts are positive, and asset credit amounts are negative; liability debit amounts are negative, and liability credit amounts are positive. These are all rules in accounting. By labeling the original accounting data with accounting characteristic data, the original accounting data can be abstracted into unified and clearly defined analytical data, providing data reference for subsequent accounting data alignment and unifying all original accounting entries. The accounting feature dataset is composed of corresponding accounting feature data. The summary field set is a set of keywords extracted from the summary description of the original accounting data through named entity recognition. Here, named entity recognition generally adopts the CRF model, and the extracted keywords are digitized through word embedding. Among them, voucher code, department code, and accounting object type are discrete coded data and are regarded as discrete features, while accounting debit amount and accounting credit amount are continuous numerical data and are regarded as continuous features. Furthermore, due to the possible field missing issues, some missing data in the accounting feature data are directly set to 0. The candidate subset construction module is used to construct candidate subsets from the accounting feature dataset based on intermediate state observability, resulting in several candidate subsets. Each candidate subset includes several accounting feature data. Intermediate state observability refers to the degree of overlap of related keywords in the accounting feature data. It should be noted that, considering that the original accounting data of the same object in different business scenarios may have missing fields, inconsistent fields, or different field semantics, for example, when executing a project, the project may not be determined, but travel expenses, consulting fees, and preliminary research fees incurred during the project research may have already been generated. The business object corresponding to these expenses is not determined, resulting in missing corresponding fields. At the same time, different business systems or business processes may use different identification methods or field values for the same business object, resulting in inconsistent fields. In addition, even if the field names are the same, their business meaning and the level of the object they point to may be different in different business scenarios, resulting in semantic differences in fields. Therefore, the degree of overlap of related keywords in the accounting feature data is used to delineate the boundaries of the original accounting data that may belong to the same business object, so as to facilitate the subsequent completeness judgment. The completeness analysis module iterates through all candidate subsets and performs the following operations for each subset: It iterates through the accounting feature data within the subset, designates the selected accounting feature data as the target accounting feature data, masks the target accounting feature data within the subset, and performs a completeness check on the masked subset. This completeness check, based on a Hidden Markov Model, determines whether all accounting feature data in the masked subset conforms to the state transition of the same object. If the masked subset conforms to the completeness check, it means that all accounting feature data in the masked subset better conforms to the state transition of the same object. Therefore, the original accounting data corresponding to the masked accounting feature data is inconsistent with the business object corresponding to the entire candidate subset, and the target accounting feature data is deleted from the candidate subset. The target accounting feature data is added to the candidate subset construction pool for the next candidate subset construction. If the masked candidate subset does not meet the completeness judgment, it means that under the premise that there is original accounting data corresponding to other business objects in the candidate subset, all accounting feature data in the masked candidate subset cannot be further judged as to whether they meet the state transition of the same object. The masked target accounting feature data is likely to belong to the business object corresponding to the candidate subset as a whole, and the masking operation is canceled. After all the accounting feature data in the candidate subset has been traversed, the accounting feature data in the candidate subset is traversed again from the beginning until the completeness of the candidate subset converges. The candidate subset is recorded as a business object set, and the original accounting data corresponding to all accounting feature data in the business object set are combined into a unified business object accounting dataset, thus realizing the alignment of accounting data.
[0021] It should be understood that those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims. Parts not described in detail in this specification are prior art known to those skilled in the art.
Claims
1. A method for aligning accounting data across multiple business scenarios, characterized in that, include: Acquire raw accounting data from different business scenarios within a preset period, and combine the raw accounting data into a raw accounting dataset. Annotate the raw accounting data using transaction timestamps, accounting feature data, and summary field sets, and associate the accounting feature data and summary field sets. Based on intermediate state observability, candidate subsets are constructed from the accounting feature dataset to obtain several candidate subsets. Each candidate subset includes several accounting feature data. Intermediate state observability refers to the degree of overlap of related keywords in the accounting feature data. Iterate through all candidate subsets and perform the following operations for each subset: iterate through the accounting feature data in the candidate subset, record the selected accounting feature data as the target accounting feature data, mask the target accounting feature data in the candidate subset, perform a completeness check on the masked candidate subset, if the masked candidate subset meets the completeness check, delete the target accounting feature data from the candidate subset and add the target accounting feature data to the candidate subset construction pool for the next candidate subset construction, if the masked candidate subset does not meet the completeness check, cancel the masking operation; after all accounting feature data in the candidate subset has been traversed, iterate through the accounting feature data in the candidate subset again from the beginning until the completeness of the candidate subset converges, record the candidate subset as a business object set, and combine the original accounting data corresponding to all accounting feature data in the business object set to form a unified business object accounting dataset, thus achieving the alignment of accounting data.
2. The accounting data alignment method under multiple business scenarios according to claim 1, characterized in that, Based on the observability of intermediate states, candidate subsets are constructed from the accounting feature dataset, resulting in several candidate subsets, specifically including the following: Perform cluster analysis on all accounting feature data to obtain several accounting feature data clusters; For each accounting feature data cluster, perform a union operation on the summary field sets associated with all accounting feature data in the cluster to obtain the comprehensive field set corresponding to the cluster. Then, iterate through all accounting feature data in the dataset except those corresponding to the cluster. For each selected accounting feature data, match the summary field set associated with the selected data with the comprehensive field set. The matching method is to calculate the similarity between the keywords in the summary field set and the keywords in the comprehensive field set, and record it as the matching value. If the largest matching value for a keyword in the summary field set is higher than the matching threshold, it is considered a successful match. Calculate the ratio of the number of successfully matched keywords in the summary field set to the total number of keywords in the summary field set, and record it as the intermediate state observability. If the intermediate state observability is higher than the observation threshold, add the selected accounting feature data to the cluster. This process continues until all accounting feature data in the dataset except those corresponding to the cluster has been traversed, and the cluster is then designated as a candidate subset.
3. The accounting data alignment method under multiple business scenarios according to claim 2, characterized in that, Perform a completeness check on the masked candidate subset, which includes the following steps: All accounting feature data in the masked candidate subset are arranged in chronological order according to the associated transaction timestamps to construct an accounting feature data sequence; The accounting feature data sequence is analyzed based on the trained accounting feature data sequence analysis model to determine the overall likelihood and state transition accuracy of the sequence. The completeness is obtained by weighted summation of the overall likelihood and state transition accuracy. If the completeness is higher than the completeness threshold, it is considered to meet the completeness judgment. The accounting feature data sequence analysis model is trained using an accounting feature data sequence set. The accounting feature data sequence set is constructed as follows: for each candidate subset, accounting feature data in the candidate subset is sequentially masked. For each masked accounting feature data, an accounting feature data sequence sample is constructed. All constructed accounting feature data sequence samples are combined to form the accounting feature data sequence set.
4. The accounting data alignment method under multiple business scenarios according to claim 3, characterized in that, Training an accounting feature data sequence analysis model using a sample set of accounting feature data sequences involves the following steps: Step S1: Select the number M of hidden states from the set of hidden states, and initialize the transition matrix, initial distribution, and emission distribution. The transition matrix is an M×M matrix, where the transition probability from the i-th hidden state to the j-th hidden state is described in the i-th row and j-th column. The initial distribution is the probability distribution of all hidden states corresponding to the first transaction timestamp, and the emission distribution is the probability distribution of accounting feature data corresponding to each transaction timestamp under each hidden state. The transition matrix, initial distribution, and emission distribution together form the accounting feature data sequence analysis model. Step S2: Forward computation; Step S2.1: For the first transaction timestamp, calculate the emission probability of each hidden state based on the accounting feature data corresponding to the first transaction timestamp through the emission distribution. Iterate through all hidden states. For each hidden state, obtain the initial distribution probability of the initial distribution in the hidden state, and calculate the product of the initial distribution probability and the emission probability to obtain the initial forward probability in the hidden state. Step S2.1: Traverse from the second transaction timestamp to the last transaction timestamp. For the t-th transaction timestamp, calculate the emission probability of each hidden state based on the accounting feature data corresponding to the transaction timestamp using the emission distribution. Traverse all hidden states. For the j-th hidden state, calculate the cumulative forward probability corresponding to the i-th hidden state in the previous transaction timestamp and the transition probability from the i-th hidden state to the j-th hidden state to obtain the intermediate forward probability corresponding to the i-th hidden state in the previous transaction timestamp. Then, multiply the sum of the intermediate forward probabilities corresponding to all hidden states in the previous transaction timestamp and the emission probability of the j-th hidden state as the cumulative forward probability corresponding to the j-th hidden state in the t-th transaction timestamp. The cumulative forward probability corresponding to the j-th hidden state in the second transaction timestamp is the corresponding initial forward probability. Step S3: Backward computation; Step S3.1: For the last transaction timestamp, set the initial backward probability of each hidden state using constants; Step S3.2: Traverse from the second-to-last transaction timestamp to the first transaction timestamp. For the t-th transaction timestamp, calculate the emission probability of each hidden state based on the accounting feature data corresponding to the (t+1)-th transaction timestamp using the emission distribution. For the i-th hidden state of the t-th transaction timestamp, traverse all hidden states. For the j-th hidden state, calculate the product of the transition probability from the i-th hidden state to the j-th hidden state, the emission probability of the j-th hidden state of the (t+1)-th transaction timestamp, and the cumulative backward probability of the j-th hidden state corresponding to the (t+1)-th transaction timestamp. This product is recorded as the intermediate backward probability corresponding to the j-th hidden state in the (t+1)-th transaction timestamp. The sum of the intermediate backward probabilities corresponding to all hidden states in the (t+1)-th transaction timestamp is recorded as the cumulative forward and backward probability corresponding to the i-th hidden state of the t-th transaction timestamp. The cumulative backward probability corresponding to the i-th hidden state of the last transaction timestamp is the corresponding initial backward probability. Step S4: For the i-th hidden state at the t-th transaction timestamp, divide the product of the accumulated forward probability and the accumulated backward probability corresponding to the i-th hidden state at the t-th transaction timestamp by the sum of all accumulated forward probabilities corresponding to the last transaction timestamp to obtain the posterior probability corresponding to the i-th hidden state at the t-th transaction timestamp. For the i-th and j-th hidden states at the t-th transaction timestamp, record the product of the accumulated forward probability corresponding to the i-th hidden state at the t-th transaction timestamp, the transition probability from the i-th hidden state to the j-th hidden state, the emission probability of the j-th hidden state at the (t+1)-th transaction timestamp, and the accumulated backward probability of the j-th hidden state corresponding to the (t+1)-th transaction timestamp as the posterior intermediate quantity. Then divide the posterior intermediate quantity by the sum of all accumulated forward probabilities corresponding to the last transaction timestamp to obtain the posterior probability of the transition between the i-th and j-th hidden states at the t-th transaction timestamp. Step S5: Replace the initial distribution with the posterior probabilities of all hidden states corresponding to the first transaction timestamp to update the initial distribution; for the i-th hidden state and the j-th hidden state, sum the posterior probabilities of the transitions corresponding to all transaction timestamps to obtain the expected value corresponding to the i-th hidden state and the j-th hidden state, and record the sum of the posterior probabilities of all transaction timestamps corresponding to the i-th hidden state as the total expected value corresponding to the i-th hidden state and the j-th hidden state, and replace the expected value corresponding to the i-th hidden state and the j-th hidden state with the ratio of the expected value corresponding to the i-th hidden state and the j-th hidden state to the total expected value, and update the transition matrix; Step S6: Repeat steps S2-S5 until the sum of all accumulated forward probabilities corresponding to the last transaction timestamp converges, and obtain the accounting feature data sequence analysis model corresponding to the number of hidden states M. Return to step S1 and select the next number of hidden states M. Step S7: Calculate the Bayesian information criterion index of the accounting feature data sequence analysis model corresponding to each number of hidden states M, and select the accounting feature data sequence analysis model corresponding to the smallest Bayesian information criterion index for output.
5. The accounting data alignment method under multiple business scenarios according to claim 4, characterized in that, When updating the transition matrix, a fixed value is added to the expected value corresponding to the i-th hidden state and the j-th hidden state.
6. The accounting data alignment method under multiple business scenarios according to claim 5, characterized in that, Determining the overall likelihood and state transition accuracy of a sequence involves the following steps: The accounting feature data sequence is analyzed by the forward computation part of the accounting feature data sequence analysis model, and the sum of all accumulated forward probabilities corresponding to the last transaction timestamp is obtained, which is the overall likelihood of the sequence. The Viterbi algorithm is used to decode the best hidden state corresponding to each transaction timestamp in the accounting feature data sequence. For any two best hidden states corresponding to adjacent transaction timestamps, if the transition probability of the two best hidden states in the transition matrix of the accounting feature data sequence analysis model is higher than the transition threshold, it is a normal transition. The number of normal transitions is recorded, and the ratio of the number of normal transitions to the total number of transitions is recorded as the state transition accuracy.
7. An accounting data alignment system for multiple business scenarios, characterized in that, The system applies the accounting data alignment method for multi-business scenarios described in any one of claims 1-6, including: The accounting data preprocessing module is used to acquire raw accounting data from different business scenarios within a preset period, and to assemble the raw accounting data into a raw accounting dataset. The raw accounting data is labeled with transaction timestamps, accounting feature data and summary field sets, and the accounting feature data and summary field sets are associated. The candidate subset construction module is used to construct candidate subsets of the accounting feature dataset based on intermediate state observability, resulting in several candidate subsets. Each candidate subset includes several accounting feature data, and intermediate state observability is the degree of overlap of related keywords in the accounting feature data. The completeness analysis module iterates through all candidate subsets and performs the following operations for each subset: iterates through the accounting feature data in the subset, records the selected accounting feature data as the target accounting feature data, masks the target accounting feature data in the subset, performs a completeness check on the masked subset, if the masked subset meets the completeness check, removes the target accounting feature data from the subset and adds it to the candidate subset construction pool for the next candidate subset construction, if the masked subset does not meet the completeness check, cancels the masking operation; after all accounting feature data in the candidate subset has been traversed, it iterates through the accounting feature data in the candidate subset again from the beginning until the completeness of the candidate subset converges, records the candidate subset as a business object set, and combines the original accounting data corresponding to all accounting feature data in the business object set into a unified business object accounting dataset, thus achieving the alignment of accounting data.