Primary and secondary database allocation method based on bill knowledge graph and related equipment

Through the primary and secondary database allocation method based on the bill knowledge graph, the problem of untimely update of traditional financial information is solved, real-time update of bill information is achieved, and invoice efficiency and data accuracy are improved.

CN112380321BActive Publication Date: 2025-04-04SHENZHEN JILIAN TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202011303250.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-19
Publication Date
2025-04-04
Estimated Expiration
2040-11-19

AI Technical Summary

Technical Problem

In the business cooperation of large collective companies, traditional financial information is not updated in time, resulting in untimely changes in financial information docking, resulting in invoice errors and time-consuming financial processes.

Method used

Through the primary and secondary database allocation method based on the bill knowledge graph, the BERT classification model with optical character recognition, event extraction and pre-trained will be updated in real time, and the storage location of the data fields will be dynamically adjusted to improve the real-time and accuracy of bill information.

Benefits of technology

It realizes that enterprises obtain real-time bill information, improves invoice efficiency, reduces the time-consuming process of financial links, and ensures timely updates and accuracy of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112380321B_ABST
    Figure CN112380321B_ABST
Patent Text Reader

Abstract

The present invention provides a method for allocating primary and secondary databases based on a bill knowledge graph and related equipment, including: performing optical character recognition on a company's bills to obtain multiple data fields in the bills; constructing a bill field-related knowledge graph based on multiple data fields; obtaining a news text corresponding to the company, and performing event extraction on the news text to obtain the company's growth events; calling a pre-trained BERT pre-trained classification model to perform classification based on growth events to obtain the change probability of the bill; updating the bill field-related knowledge graph based on the change probability; writing the data field corresponding to the change probability less than a preset probability threshold in the updated bill field-related knowledge graph into the primary database, and writing the data field corresponding to the change probability greater than or equal to the preset probability threshold into the secondary database. The present invention can allocate primary and secondary databases based on the bill knowledge graph, so that enterprises can obtain real-time bill information and improve billing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer application technology, and in particular to a primary and secondary database allocation method, system and electronic device based on a bill knowledge graph. Background Art

[0002] In the business cooperation of large collective companies, it is often necessary to conduct financial transactions with cooperative companies. In this process, when the company's business volume is large, or even often conducts business with thousands of companies, it is necessary to manage the relevant bill information of these companies. Especially when there are electronic invoices and automation systems, the bill information will be maintained in an important database to facilitate the query of these companies' data and realize automation when issuing invoices.

[0003] Generally, invoice information is stable and does not change easily, but financial information may change. After traditional financial personnel update the financial information, they may not necessarily notify all employees of the company. It is easy for the financial information to be changed in a timely manner and the invoice to be issued incorrectly, causing the financial process to take a long time.

[0004] Therefore, it is necessary to provide a solution for allocating primary and secondary databases of the invoicing system. Summary of the invention

[0005] In view of the above, the present invention provides a primary and secondary database allocation method, system and electronic device based on the bill knowledge graph, which allocates primary and secondary databases based on the bill knowledge graph, so that enterprises can obtain real-time bill information and improve billing efficiency.

[0006] A first aspect of the present invention provides a primary and secondary database allocation method based on a bill knowledge graph, the method comprising:

[0007] Performing optical character recognition on the company's bills to obtain multiple data fields in the bills;

[0008] Constructing a bill field association knowledge graph according to the multiple data fields;

[0009] Acquire a news text corresponding to the company, and extract events from the news text to obtain growth events of the company;

[0010] Calling a pre-trained BERT classification model to classify the growth event to obtain the change probability of the bill;

[0011] Update the ticket field associated knowledge graph based on the change probability;

[0012] The data fields corresponding to the change probabilities less than the preset probability threshold in the updated bill field association knowledge graph are written into the master database, and the data fields corresponding to the change probabilities greater than or equal to the preset probability threshold are written into the slave database.

[0013] According to an optional embodiment of the present invention, constructing a bill field association knowledge graph according to the multiple data fields includes:

[0014] determining a note type of the note;

[0015] Calculate the rate of change based on the name of the company, the type of bill, and each data field;

[0016] Constructing a quadruple according to the name of the company, the bill type, each data field and the corresponding change rate;

[0017] A bill field association knowledge graph is constructed based on the four-tuple.

[0018] According to an optional embodiment of the present invention, the calculating the change rate according to the name of the company, the bill type and each data field includes:

[0019] Obtaining the number of changes of the data field and the total number of times the data field is used from a preset data field change table;

[0020] The change rate of the data field is calculated according to the number of changes of the data field and the total number of times the data field is used.

[0021] According to an optional embodiment of the present invention, the acquiring of the news text corresponding to the company includes:

[0022] Crawl multiple news texts;

[0023] For each news text, using named entity recognition technology to identify multiple company named entities in the news text;

[0024] Count the number of named entities for each company;

[0025] Taking the company named entity with the largest number as the target company described in the news text;

[0026] The target company is selected as the news text corresponding to the company.

[0027] According to an optional embodiment of the present invention, extracting events from the news text to obtain the growth events of the company includes:

[0028] Extracting event trigger words from the news text;

[0029] Determine whether the subject on which the event trigger word depends is the company;

[0030] When the subject on which the event trigger word depends is the company, the event trigger word is determined to be a growth event of the company.

[0031] According to an optional embodiment of the present invention, calling a pre-trained BERT pre-trained classification model to perform classification based on the growth event to obtain the change probability of the bill includes:

[0032] Segmenting the news text and converting it into word vectors;

[0033] Concatenating the word vector and the growth event to obtain a text description;

[0034] The text description is input into the pre-trained BERT classification model for classification to obtain the change probability of the bill.

[0035] According to an optional embodiment of the present invention, the word segmentation of the news text and converting it into a word vector comprises:

[0036] Using the jieba word segmenter to segment the news text to obtain multiple word segments;

[0037] Word2vec is used to convert the multiple word segmentations into word vectors.

[0038] According to an optional embodiment of the present invention, the training process of the BERT pre-trained classification model includes:

[0039] Acquire historical news texts and historical growth events of multiple companies, and obtain historical text descriptions based on the historical news texts and the historical growth events;

[0040] Determining whether the content of the notes of each company has changed within a preset time period after each growth event of the company;

[0041] Setting a first label for the changed bill content and a second label for the unchanged bill content;

[0042] A BERT model is trained based on the historical text description and the first label or the second label to obtain a BERT pre-trained classification model.

[0043] A second aspect of the present invention provides a primary and secondary database allocation system based on a bill knowledge graph, the system comprising:

[0044] A recognition module, used for performing optical character recognition on the company's bills to obtain a plurality of data fields in the bills;

[0045] A construction module, used to construct a bill field association knowledge graph based on the multiple data fields;

[0046] An extraction module, used to obtain news text corresponding to the company, and extract events from the news text to obtain growth events of the company;

[0047] A classification module, used for calling a pre-trained BERT classification model to classify the growth event and obtain a change probability of the bill;

[0048] An updating module, used for updating the bill field associated knowledge graph based on the change probability;

[0049] A writing module is used to write the data fields corresponding to the change probabilities less than the preset probability threshold in the updated bill field associated knowledge graph into the main database, and to write the data fields corresponding to the change probabilities greater than or equal to the preset probability threshold into the slave database.

[0050] A third aspect of the present invention provides an electronic device, comprising:

[0051] Memory for storing computer programs;

[0052] A processor is used to implement the primary and secondary database allocation method based on the bill knowledge graph when processing the computer program.

[0053] The present invention performs optical character recognition on the company's bills to obtain multiple data fields in the bills, and constructs a bill field-related knowledge graph based on the multiple data fields, so that the knowledge graph can better match, associate and retrieve and infer the multivariate data therein; obtains the news text corresponding to the company, and extracts events from the news text to obtain the company's growth events, calls the pre-trained BERT pre-trained classification model to perform classification based on the growth events, obtains the change probability of the bill, and updates the bill field-related knowledge graph based on the change probability, that is, through the machine learning method, further supplements the obtained knowledge graph with data or updates the initial value therein, so that the content of the entire knowledge graph is further optimized; writes the data field corresponding to the change probability less than the preset probability threshold in the updated bill field-related knowledge graph into the main database, and writes the data field corresponding to the change probability greater than or equal to the preset probability threshold into the slave database, and with the advantage of the relational database, it can achieve faster query, so that the enterprise can obtain real-time bill information and improve the efficiency of invoicing. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 A flowchart of a primary and secondary database allocation method based on a bill knowledge graph provided in an embodiment of the present invention.

[0055] Figure 2 A structural diagram of the primary and secondary database allocation system based on the bill knowledge graph provided in an embodiment of the present invention.

[0056] Figure 3 A structural diagram of an electronic device for implementing a primary and secondary database allocation method based on a bill knowledge graph provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0058] Figure 1 Flow chart of the primary and secondary database allocation method based on the bill knowledge graph provided by the embodiment of the present invention. Figure 1 As shown, the primary and secondary database allocation method based on the bill knowledge graph of this embodiment may specifically include the following steps:

[0059] The present invention provides a primary and secondary database allocation method and system based on bill knowledge graph, which mainly includes the following steps:

[0060] S11, performing optical character recognition on the company's bills to obtain multiple data fields in the bills.

[0061] Among them, the bills may include value-added tax bills, bank receipt bills, special bills, bridge toll bills, shopping receipts, medical bills, bank bills and the like.

[0062] The invoices that the enterprise personnel need to reimburse are processed through optical character recognition (OCR) technology. The OCR technology analyzes and recognizes the input invoice image and returns multiple data fields on the invoice. The OCR technology can use Baidu's OCR text recognition interface.

[0063] For example, the amount displayed on the VAT receipt is 3,000 yuan. When the image of the VAT receipt is input into OCR, the VAT receipt will be analyzed and processed. First, the type of receipt that can be recognized is 'VAT', and secondly, the amount on the image can be recognized as 3,000. The data fields 'amount' and '3000' will be returned in the form of text.

[0064] S12, constructing a bill field association knowledge graph based on the multiple data fields.

[0065] According to the bill company name, bill type and data fields obtained from S11, a bill field association knowledge graph is constructed.

[0066] In an optional embodiment, constructing the bill field association knowledge graph according to the multiple data fields includes: determining the bill type of the bill; calculating a change rate according to the name of the company, the bill type, and each data field; constructing a quadruple according to the name of the company, the bill type, each data field, and the corresponding change rate; and constructing the bill field association knowledge graph based on the quadruple.

[0067] Wherein, the change rate is a statistical value calculated based on the changes of the first three data fields in the quadruple within a preset time period.

[0068] Due to different businesses of the company, the data fields corresponding to the same bill type are sometimes different for the company. By statistically analyzing the changes in the data fields corresponding to the same bill type over a period of time, the change rate of the data fields in this bill type under the company can be obtained. Through a preset data field change table, the number of changes of the data field and the total number of times the data field is used can be obtained, and the change rate of the data field is calculated based on the number of changes of the data field and the total number of times the data field is used, that is, the element value of the fourth element in the bill company in the bill field association knowledge graph is obtained.

[0069] For example, Zhang San, an employee in Company X, spent 1000 yuan on shopping for Event A. The amount of 1000 yuan for shopping was obtained through OCR technology in S11. Then the constructed quadruple is <Company X, shopping receipt, 1000, change rate>.

[0070] In an optional embodiment, the method may further include: for each quadruple corresponding to a data field, determining whether the quadruple exists in the bill field association knowledge graph; when it is determined that the quadruple does not exist in the bill field association knowledge graph, adding the quadruple to the bill field association knowledge graph.

[0071] The bill field association knowledge graph can be constructed and stored using RDF or OWL ontology tools.

[0072] S13, obtaining news texts corresponding to the company, and performing event extraction on the news texts to obtain growth events of the company.

[0073] All information of the company is crawled from websites such as Qichacha and ITjuzi through python crawler technology, and investment and growth events of the company are extracted from all the crawled information through domain-limited event extraction technology.

[0074] In an optional embodiment, obtaining the news text corresponding to the company includes: crawling multiple news texts; for each news text, using named entity recognition technology to identify multiple company named entities in the news text; calculating the number of each company named entity; taking the company named entity with the largest number as the target company described in the news text; and selecting the target company as the news text corresponding to the company.

[0075] In the specific implementation, for any crawled news text, a named entity recognition technology is used to identify multiple company named entities in the any news text, and the number of occurrences of each company named entity is calculated; the company named entity with the largest number is used as the company name described in the any news text. The LPT tool of Harbin Institute of Technology can be used as the named entity recognition technology.

[0076] In an optional embodiment, the event extraction of the news text to obtain the growth event of the company includes: extracting event trigger words in the news text; determining whether the subject on which the event trigger words depend is the company; when the subject on which the event trigger words depend is the company, determining that the event trigger words are the growth event of the company.

[0077] Among them, the event trigger words are set, such as investment, mergers and acquisitions, profits, losses, etc. Based on these event trigger words combined with dependency syntactic analysis, it is determined whether the subject on which the event trigger word depends is the corresponding company name. The dependency syntactic analysis tool can use the LTP tool of Harbin Institute of Technology. If the subject on which the event trigger word depends is the company, it is determined that the company's growth event is the company event described by the event trigger word; if the subject on which the event trigger word depends is not the company, it means that the event trigger word is not describing the company, so it is skipped.

[0078] S14, calling the pre-trained BERT pre-trained classification model to perform classification based on the growth event to obtain the change probability of the bill.

[0079] After determining the company's growth events, the news text and the growth events are spliced ​​together, and the spliced ​​text is used as training data and input into the pre-trained BERT pre-trained classification model for classification.

[0080] In an optional embodiment, the calling of a pre-trained BERT pre-trained classification model for classification based on the growth event to obtain the probability of change of the bill includes: segmenting the news text and converting it into word vectors; concatenating the word vectors with the growth event to obtain a text description; inputting the text description into the pre-trained BERT pre-trained classification model for classification to obtain the probability of change of the bill.

[0081] Specifically, the crawled news text of the company is segmented and converted into word vectors. Jieba word segmenter can be used for word segmentation, and word2vec can be used for word vector conversion.

[0082] Among them, the training process of the BERT pre-trained classification model includes: obtaining historical news texts and historical growth events of multiple companies, and obtaining historical text descriptions based on the historical news texts and the historical growth events; within a preset time period after each growth event of each company, determining whether the content of the company's bills has changed; setting a first label for the changed bill content, and setting a second label for the unchanged bill content; training the BERT model based on the historical text description and the first label or the second label to obtain the BERT pre-trained classification model.

[0083] Each time within a preset time period after a company is reported to have a growth event, if the content of the company's notes changes, the growth event is identified as a 'trigger event' and marked as the first label, for example, 1; if the content of the company's notes does not change, the growth event is identified as a 'non-trigger event' and marked as the second label, for example, 0.

[0084] By taking the extracted company news text and growth events as features and whether the company's invoice content has changed as a label, the model is input into the Bert pre-trained classification model for training. Through back propagation, the parameters in the Bert pre-trained classification model are continuously optimized. After a specified number of iterations or steps, the optimal parameters of the Bert pre-trained classification model and the model corresponding to the optimal parameters are obtained, and the model corresponding to the optimal parameters is stored. When used online, the company's news articles and growth events are input into the model to determine whether the company will cause changes in the invoice content within a preset time period after the growth event.

[0085] For example, crawl all the news texts of Company X from Qichacha and ITjuzi websites through crawler technology. Assuming that "In 2020, Company X invested 300,000 yuan in Project B in A" is a sentence in the website news text, when training the RNN+Attention neural network event extraction model, the event trigger word marked is: investment; and through LTP dependency syntactic analysis, it is determined that there is a dependency relationship between Company X and investment. The event trigger word "investment" is the growth event of Company A. The extracted news text and the growth event are spliced ​​to obtain the text description "Company X is investing", which is input as a feature into the Bert pre-trained classification model for training. After having the features, the target of the Bert pre-trained classification model needs to be defined. Determine whether the content of the bill of the company has changed within 1 month or a preset time period after the news report. If the content of the bill has changed, it means that the growth event will have an impact on the content of the bill. For example, if the enterprise is upgraded from a small scale to a large scale enterprise, or a general taxpayer is upgraded from a small scale, the content of the bill will change. The upgrade of the enterprise must be due to the huge development caused by some financing, hot products or news events, so there is a great relationship between them. Classification prediction can be performed through text mining methods. It can also be trained based on BERT classification tools, such as the tool BERT-Chinese-classification-task on GitHub. The trained model can determine whether the content of the company's bill is likely to change under this growth event.

[0086] S15: Update the bill field associated knowledge graph based on the change probability.

[0087] The change probability obtained based on the growth event prediction is used to optimize the initial value in the knowledge graph associated with the bill field.

[0088] Since the change rate of the fourth element in the knowledge graph associated with the bill field of the company is an initial value obtained by statistical means, it is not accurate enough. The probability of change in the content of the company's bill is not static, but is predicted based on the company's growth events. Therefore, there is no need to fully update the knowledge graph, which has the characteristic of being easier to partially update the knowledge graph.

[0089] The initial values ​​in the bill field-related knowledge graph reflect the changing rules of those fields that are not closely related to the company's development. For example, product prices, quantities, and other fields that are easy to change are acquired and counted to form a knowledge graph; while tax rates, company addresses, specifications, and models may not change much at the beginning, but as the company develops, the company address will change because the initial company is small, and the tax rate will increase due to events such as the company's "small to large" and so on. These will change due to the company's development. If the company does not develop for a long time, the probability of change may be much smaller. Moreover, the frequency and content of changes in different industries and different invoices will be different. Therefore, it is necessary to use machine learning methods to train the probability of changes in the content of various types of bills, and further supplement the data of the obtained knowledge graph or update the initial values ​​in it, so that the content of the entire knowledge graph can be further optimized.

[0090] S16, write the data fields corresponding to the change probabilities less than the preset probability threshold in the updated bill field associated knowledge graph into the master database, and write the data fields corresponding to the change probabilities greater than or equal to the preset probability threshold into the slave database.

[0091] The determination of data fields with high probability of change depends not only on the data fields themselves, but also on the correlation between company growth and changes in bill content. When the field is easy to change and the field itself are maintained in the knowledge graph quadruple, more knowledge reasoning and construction can be performed based on the ontology owl and rdf algorithms in the knowledge graph. And the data can be better extracted and updated. Therefore, when a data field with a high probability of change is mined in the knowledge graph, it can be extracted and placed in the slave database. Put the data field with a low probability of change in the master database.

[0092] The difference between the graph database of the knowledge graph and the relational database is that although they both store data, the knowledge graph can better match, associate, retrieve and reason about the multivariate data. The advantage of the relational database is that the query is fast and stable, and it can provide performance advantages and data association and better integration with the website front end.

[0093] Continuously obtain news or reports about companies that have business relationships with our company. By matching the company name in the knowledge graph, all fields of the company's bills can be obtained. The change probability of the quadruple is determined based on the last element in the knowledge graph quadruple. When the change probability is greater than or equal to the preset probability threshold (for example, 0.8), the data field is placed in the slave database; when the change probability is less than the preset probability threshold, the data field is placed in the master database.

[0094] Figure 2It is a structural diagram of the primary and secondary database allocation system based on the bill knowledge graph provided for an embodiment of the present invention.

[0095] In this embodiment, the primary and secondary database allocation system 20 based on the bill knowledge graph can be divided into multiple functional modules according to the functions it performs. The functional modules may include: an identification module 201, a construction module 202, an extraction module 203, a classification module 204, an update module 205 and a write module 206. The module referred to in the present invention refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, which are stored in a memory. In this embodiment, the functions of each module will be described in detail in subsequent embodiments.

[0096] The recognition module 201 is used to perform optical character recognition on the company's bills to obtain multiple data fields in the bills.

[0097] Among them, the bills may include value-added tax bills, bank receipt bills, special bills, bridge toll bills, shopping receipts, medical bills, bank bills and the like.

[0098] The invoices that the enterprise personnel need to reimburse are processed through optical character recognition (OCR) technology. The OCR technology analyzes and recognizes the input invoice image and returns multiple data fields on the invoice. The OCR technology can use Baidu's OCR text recognition interface.

[0099] For example, the amount displayed on the VAT receipt is 3,000 yuan. When the image of the VAT receipt is input into OCR, the VAT receipt will be analyzed and processed. First, the type of receipt that can be recognized is 'VAT', and secondly, the amount on the image can be recognized as 3,000. The data fields 'amount' and '3000' will be returned in the form of text.

[0100] The construction module 202 is used to construct a bill field association knowledge graph based on the multiple data fields.

[0101] According to the bill company name, bill type and data fields obtained from S11, a bill field association knowledge graph is constructed.

[0102] In an optional embodiment, constructing a bill field association knowledge graph based on the multiple data fields includes: determining the bill type of the bill; calculating the change rate based on the company name, the bill type and each data field; constructing a quadruple based on the company name, the bill type, each data field and the corresponding change rate; and constructing a bill field association knowledge graph based on the quadruple.

[0103] Among them, the change rate refers to a statistical value calculated based on the changes of the first three data fields in the quadruple within a preset time period.

[0104] Due to different businesses of the company, the data fields corresponding to the same bill type are sometimes different in the company. The changes of the data fields corresponding to the same bill type are statistically counted within a period of time to obtain the change rate of the data fields in this bill type under the company. Through a preset data field change table, the number of changes of the data field and the total number of times the data field is used can be obtained. The change rate of the data field is calculated based on the number of changes of the data field and the total number of times the data field is used, that is, the element value of the fourth element in the bill company's bill field association knowledge graph is obtained.

[0105] For example, Zhang San, an employee in Company X, spent 1,000 yuan on shopping for Activity A. The amount of 1,000 yuan spent in the shopping receipt was obtained through OCR technology in S11. Then the constructed quadruple is <Company X, shopping receipt, 1,000, change rate>.

[0106] In an optional embodiment, the method may further include: for each quadruple corresponding to a data field, determining whether the quadruple exists in the bill field association knowledge graph; when it is determined that the quadruple does not exist in the bill field association knowledge graph, adding the quadruple to the bill field association knowledge graph.

[0107] The bill field association knowledge graph can be constructed and stored using RDF or OWL ontology tools.

[0108] The extraction module 203 is configured to obtain news texts corresponding to the company and perform event extraction on the news texts to obtain growth events of the company.

[0109] All information of the company is crawled from websites such as Qichacha and ITjuzi through python web crawler technology, and investment and growth events of the company are extracted from all the crawled information through domain-limited event extraction technology.

[0110] In an optional embodiment, the obtaining of the news texts corresponding to the company includes: crawling multiple news texts; for each news text, using named entity recognition technology to identify multiple company named entities in the news text; calculating the number of each company named entity; using the company named entity with the largest number as the target company described in the news text; selecting the target company as the news text corresponding to the company.

[0111] In the specific implementation, for any crawled news text, a named entity recognition technology is used to identify multiple company named entities in the any news text, and the number of occurrences of each company named entity is calculated; the company named entity with the largest number is used as the company name described in the any news text. The LPT tool of Harbin Institute of Technology can be used as the named entity recognition technology.

[0112] In an optional embodiment, the event extraction of the news text to obtain the growth event of the company includes: extracting event trigger words in the news text; determining whether the subject on which the event trigger words depend is the company; when the subject on which the event trigger words depend is the company, determining that the event trigger words are the growth event of the company.

[0113] Among them, the event trigger words are set, such as investment, mergers and acquisitions, profits, losses, etc. Based on these event trigger words combined with dependency syntactic analysis, it is determined whether the subject on which the event trigger word depends is the corresponding company name. The dependency syntactic analysis tool can use the LTP tool of Harbin Institute of Technology. If the subject on which the event trigger word depends is the company, it is determined that the company's growth event is the company event described by the event trigger word; if the subject on which the event trigger word depends is not the company, it means that the event trigger word is not describing the company, so it is skipped.

[0114] The classification module 204 is used to call the pre-trained BERT classification model to perform classification based on the growth event to obtain the change probability of the bill.

[0115] After determining the company's growth events, the news text and the growth events are spliced ​​together, and the spliced ​​text is used as training data and input into the pre-trained BERT pre-trained classification model for classification.

[0116] In an optional embodiment, calling a pre-trained BERT pre-trained classification model to classify based on the growth event to obtain the change probability of the bill includes:

[0117] Segmenting the news text and converting it into word vectors;

[0118] Concatenating the word vector and the growth event to obtain a text description;

[0119] The text description is input into the pre-trained BERT classification model for classification to obtain the change probability of the bill.

[0120] Specifically, the crawled news text of the company is segmented and converted into word vectors. Jieba word segmenter can be used for word segmentation, and word2vec can be used for word vector conversion.

[0121] The training process of the BERT pre-trained classification model includes:

[0122] Acquire historical news texts and historical growth events of multiple companies, and obtain historical text descriptions based on the historical news texts and the historical growth events;

[0123] Determining whether the content of the notes of each company has changed within a preset time period after each growth event of the company;

[0124] Setting a first label for the changed bill content and a second label for the unchanged bill content;

[0125] A BERT model is trained based on the historical text description and the first label or the second label to obtain a BERT pre-trained classification model.

[0126] Each time within a preset time period after a company is reported to have a growth event, if the content of the company's notes changes, the growth event is identified as a 'trigger event' and marked as the first label, for example, 1; if the content of the company's notes does not change, the growth event is identified as a 'non-trigger event' and marked as the second label, for example, 0.

[0127] By taking the extracted company news text and growth events as features and whether the company's invoice content has changed as a label, the model is input into the Bert pre-trained classification model for training. Through back propagation, the parameters in the Bert pre-trained classification model are continuously optimized. After a specified number of iterations or steps, the optimal parameters of the Bert pre-trained classification model and the model corresponding to the optimal parameters are obtained, and the model corresponding to the optimal parameters is stored. When used online, the company's news articles and growth events are input into the model to determine whether the company will cause changes in the invoice content within a preset time period after the growth event.

[0128] For example, crawl all the news texts of Company X from Qichacha and ITjuzi websites through crawler technology. Assuming that "In 2020, Company X invested 300,000 yuan in Project B in A" is a sentence in the website news text, when training the RNN+Attention neural network event extraction model, the event trigger word marked is: investment; and through LTP dependency syntactic analysis, it is determined that there is a dependency relationship between Company X and investment. The event trigger word "investment" is the growth event of Company A. The extracted news text and the growth event are spliced ​​to obtain the text description "Company X is investing", which is input as a feature into the Bert pre-trained classification model for training. After having the features, the target of the Bert pre-trained classification model needs to be defined. Determine whether the content of the bill of the company has changed within 1 month or a preset time period after the news report. If the content of the bill has changed, it means that the growth event will have an impact on the content of the bill. For example, if the enterprise is upgraded from a small scale to a large scale enterprise, or a general taxpayer is upgraded from a small scale, the content of the bill will change. The upgrade of the enterprise must be due to the huge development caused by some financing, hot products or news events, so there is a great relationship between them. Classification prediction can be performed through text mining methods. It can also be trained based on BERT classification tools, such as the tool BERT-Chinese-classification-task on GitHub. The trained model can determine whether the content of the company's bill is likely to change under this growth event.

[0129] The updating module 205 is used to update the bill field associated knowledge graph based on the change probability.

[0130] The change probability obtained based on the growth event prediction is used to optimize the initial value in the knowledge graph associated with the bill field.

[0131] Since the change rate of the fourth element in the knowledge graph associated with the bill field of the company is an initial value obtained by statistical means, it is not accurate enough. The probability of change in the content of the company's bill is not static, but is predicted based on the company's growth events. Therefore, there is no need to fully update the knowledge graph, which has the characteristic of being easier to partially update the knowledge graph.

[0132] The initial values ​​in the bill field-related knowledge graph reflect the changing rules of those fields that are not closely related to the company's development. For example, product prices, quantities, and other fields that are easy to change are acquired and counted to form a knowledge graph; while tax rates, company addresses, specifications, and models may not change much at the beginning, but as the company develops, the company address will change because the initial company is small, and the tax rate will increase due to events such as the company's "small to large" and so on. These will change due to the company's development. If the company does not develop for a long time, the probability of change may be much smaller. Moreover, the frequency and content of changes in different industries and different invoices will be different. Therefore, it is necessary to use machine learning methods to train the probability of changes in the content of various types of bills, and further supplement the data of the obtained knowledge graph or update the initial values ​​in it, so that the content of the entire knowledge graph can be further optimized.

[0133] The writing module 206 is used to write the data fields corresponding to the change probabilities less than the preset probability threshold in the updated bill field associated knowledge graph into the main database, and write the data fields corresponding to the change probabilities greater than or equal to the preset probability threshold into the slave database.

[0134] The determination of data fields with high probability of change depends not only on the data fields themselves, but also on the correlation between company growth and changes in bill content. When the field is easy to change and the field itself are maintained in the knowledge graph quadruple, more knowledge reasoning and construction can be performed based on the ontology owl and rdf algorithms in the knowledge graph. And the data can be better extracted and updated. Therefore, when a data field with a high probability of change is mined in the knowledge graph, it can be extracted and placed in the slave database. Put the data field with a low probability of change in the master database.

[0135] The difference between the graph database of the knowledge graph and the relational database is that although they both store data, the knowledge graph can better match, associate, retrieve and reason about the multivariate data. The advantage of the relational database is that the query is fast and stable, and it can provide performance advantages and data association and better integration with the website front end.

[0136] Continuously obtain news or reports about companies that have business relationships with our company. By matching the company name in the knowledge graph, all fields of the company's bills can be obtained. The change probability of the quadruple is determined based on the last element in the knowledge graph quadruple. When the change probability is greater than or equal to the preset probability threshold (for example, 0.8), the data field is placed in the slave database; when the change probability is less than the preset probability threshold, the data field is placed in the master database.

[0137] See also Figure 3As shown, it is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. In a preferred embodiment of the present invention, the electronic device 3 includes a memory 31, at least one processor 32, at least one communication bus 33 and a transceiver 34. The electronic device 3 is used to implement all or part of the steps in the primary and secondary database allocation method based on the bill knowledge graph, or to run all or part of the functions in the primary and secondary database allocation system based on the bill knowledge graph.

[0138] Those skilled in the art should understand that Figure 3 The structure of the electronic device shown does not constitute a limitation of the embodiments of the present invention, and may be a bus structure or a star structure. The electronic device 3 may also include more or less other hardware or software than shown in the figure, or a different component arrangement.

[0139] In some embodiments, the electronic device 3 is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits, programmable gate arrays, digital processors, and embedded devices. The electronic device 3 may also include client devices, which include but are not limited to any electronic product that can interact with a client through a keyboard, mouse, remote control, touchpad, or voice-controlled device, such as a personal computer, tablet computer, smart phone, digital camera, etc.

[0140] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiments can be implemented by software, or by means of software plus necessary general hardware platforms. Based on such understanding, the technical solutions of the above embodiments can be embodied in the form of software products, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including several instructions for enabling an electronic device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0141] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A primary and secondary database allocation method based on bill knowledge graph, characterized in that: The method comprises: Performing optical character recognition on the company's bills to obtain multiple data fields in the bills; Constructing a bill field association knowledge graph according to the multiple data fields; Acquire a news text corresponding to the company, and extract events from the news text to obtain growth events of the company; Calling a pre-trained BERT classification model to classify the growth event to obtain the change probability of the bill; Update the bill field associated knowledge graph based on the change probability; Write the data fields corresponding to the change probabilities less than the preset probability threshold in the updated bill field associated knowledge graph into the master database, and write the data fields corresponding to the change probabilities greater than or equal to the preset probability threshold into the slave database; The event extraction from the news text to obtain the company's growth events includes: Extracting event trigger words from the news text; Determine whether the subject on which the event trigger word depends is the company; When the subject on which the event trigger word depends is the company, the event trigger word is determined to be a growth event of the company; The calling of the pre-trained BERT pre-trained classification model to classify based on the growth event to obtain the change probability of the bill includes: Segmenting the news text and converting it into word vectors; Concatenating the word vector and the growth event to obtain a text description; The text description is input into the pre-trained BERT classification model for classification to obtain the change probability of the bill.

2. The primary and secondary database allocation method based on the bill knowledge graph according to claim 1 is characterized in that: The step of constructing a bill field association knowledge graph based on the multiple data fields includes: determining a note type of the note; Calculate the rate of change based on the name of the company, the type of bill, and each data field; Constructing a quadruple according to the name of the company, the bill type, each data field and the corresponding change rate; A bill field association knowledge graph is constructed based on the four-tuple.

3. The primary and secondary database allocation method based on the bill knowledge graph according to claim 2 is characterized in that: The calculation of the change rate according to the name of the company, the bill type and each data field includes: Obtaining the number of changes of the data field and the total number of times the data field is used from a preset data field change table; The change rate of the data field is calculated according to the number of changes of the data field and the total number of times the data field is used.

4. The method for allocating primary and secondary databases based on bill knowledge graph according to claim 1, characterized in that: The obtaining of the news text corresponding to the company comprises: Crawl multiple news texts; For each news text, using named entity recognition technology to identify multiple company named entities in the news text; Count the number of named entities for each company; Taking the company named entity with the largest number as the target company described in the news text; The target company is selected as the news text corresponding to the company.

5. The method for allocating primary and secondary databases based on bill knowledge graph according to claim 1, characterized in that: The word segmentation of the news text and conversion into word vectors comprises: Using the jieba word segmenter to segment the news text to obtain multiple word segments; Word2vec is used to convert the multiple word segmentations into word vectors.

6. The method for allocating primary and secondary databases based on bill knowledge graph according to claim 5, characterized in that: The training process of the BERT pre-trained classification model includes: Acquire historical news texts and historical growth events of multiple companies, and obtain historical text descriptions based on the historical news texts and the historical growth events; Determining whether the content of the notes of each company has changed within a preset time period after each growth event of the company; Setting a first label for the changed bill content and a second label for the unchanged bill content; A BERT model is trained based on the historical text description and the first label or the second label to obtain a BERT pre-trained classification model.

7. A primary and secondary database allocation system based on bill knowledge graph, applying the primary and secondary database allocation method based on bill knowledge graph as claimed in any one of claims 1 to 6, characterized in that: The system comprises: A recognition module, used for performing optical character recognition on the company's bills to obtain multiple data fields in the bills; A construction module, used to construct a bill field association knowledge graph based on the multiple data fields; An extraction module, used to obtain news text corresponding to the company, and extract events from the news text to obtain growth events of the company; A classification module, used for calling a pre-trained BERT classification model to classify the growth event and obtain a change probability of the bill; An updating module, used for updating the bill field associated knowledge graph based on the change probability; A writing module is used to write the data fields corresponding to the change probabilities less than the preset probability threshold in the updated bill field associated knowledge graph into the main database, and to write the data fields corresponding to the change probabilities greater than or equal to the preset probability threshold into the slave database.

8. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, used to implement the primary and secondary database allocation method based on the bill knowledge graph as described in any one of claims 1 to 6 when processing the computer program.

Citation Information

Patent Citations

  • Risk assessment method, device and terminal

    CN110162976A

  • Bill information detection method and device and computer device

    CN111143512A

  • Financial same-industry public opinion analysis method and system based on deep learning algorithm

    CN111639183A