Data storage management method and device and electronic equipment
Patent Information
- Application Number
- CN202411818187.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-01-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing invoice management system lacks an effective mechanism to automatically classify and organize invoice data, resulting in messy and inefficient retrieval.
By obtaining original invoices in multiple formats, extracting key field information and converting them into standardized invoice structure data, generating invoice entry databases, and using forward maximum matching algorithms and word frequency statistics and correlation calculations, the intelligent retrieval of invoices and exhibit.
It improves the efficiency and user experience of invoices, realizes standardized storage and intelligent management of invoices, and enhances the comprehensibility and operability of data.
Smart Images

Figure CN119311787A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a data storage management method, device and electronic device. Background Art
[0002] With the acceleration of digital transformation, enterprises have a growing demand for electronic invoices from paper. In financial management, tax audits, and daily operations, electronic invoice processing can not only improve the efficiency of data processing, but also reduce human errors and enhance data security. Therefore, the demand for electronic invoice technology is increasing, especially in processing high-volume and diversified invoice formats.
[0003] Currently, the current invoice management system lacks an effective mechanism to automatically classify and organize invoice data. Invoice information is often stored in a disorganized manner, lacking systematic labels and indexes. This lack of organization makes it difficult for users to quickly locate specific invoices or related data when needed, resulting in low invoice retrieval efficiency.
[0004] Therefore, there is an urgent need for a data storage management method, device and electronic device. Summary of the invention
[0005] The present application provides a data storage management method, device and electronic device, which improves the efficiency of invoice retrieval.
[0006] In a first aspect of the present application, a data storage management method is provided, the method comprising: obtaining original invoices in multiple formats; extracting the original invoices to obtain key field information, and converting the original invoices into standardized invoice structure data according to the key field information; generating invoice terms for each of the original invoices according to the invoice structure data, and constructing an invoice term library according to each of the invoice terms; obtaining target characters input by a user; matching the target characters with each of the invoice terms to obtain multiple matching terms, and displaying the multiple matching terms to the user; determining a target term from the multiple matching terms, and obtaining a target invoice corresponding to the target term; and displaying the target invoice and the target invoice structure data corresponding to the target invoice to the user.
[0007] By adopting the above technical solution, by obtaining original invoices in various formats, extracting and standardizing them, structured invoice structure data is obtained, which is convenient for subsequent storage, retrieval and display. The extracted key field information is used to generate invoice entries, and an invoice entry library is constructed, which provides a basis for users to search for invoices. When the user enters the target characters, the relevant target invoices can be found quickly and accurately by matching with the invoice entry library, thereby improving the search efficiency. Finally, the target invoice and its target invoice structure data are displayed to the user, so that the user can clearly and comprehensively understand the invoice information, which is convenient for the user to view and use. This method realizes the standardized storage and intelligent retrieval of invoices, effectively improving the efficiency of invoice management and user experience.
[0008] Optionally, matching the target character with each of the invoice terms to obtain a plurality of matching terms specifically includes: searching the invoice term library for candidate terms with the target character as the first letter through a forward maximum matching algorithm; performing word frequency statistics and relevance calculations on each of the candidate terms to obtain a relevance result; sorting the candidate terms in descending order according to the relevance result, and determining a preset number of matching terms.
[0009] By adopting the above technical solution, when matching the target character and the invoice entry, by adopting the forward maximum matching algorithm, the candidate entry with the target character as the first letter can be found quickly and accurately, narrowing the search range and improving the matching efficiency. The candidate entries are counted for word frequency and relevance, and sorted according to the relevance results, so that the most relevant and most likely to be selected by the user can be displayed first, thereby improving the success rate and satisfaction of the user's search. At the same time, by setting a preset number of matching entries, it can provide users with enough choices without being confused by too many entries, making the search results more accurate and practical.
[0010] Optionally, the frequency statistics and relevance calculations are performed on each of the candidate terms to obtain a relevance result, specifically including: counting the frequency of occurrence of each of the candidate terms in the invoice term library to obtain the frequency of each of the candidate terms; calculating the similarity between each of the candidate terms and the user's historical input terms to obtain the relevance of each of the candidate terms; based on a preset weight database, calculating the comprehensive relevance of each of the candidate terms according to the frequency and relevance of each of the candidate terms, and using the comprehensive relevance as the relevance result.
[0011] By adopting the above technical solution, when calculating the relevance of candidate terms, the frequency of the invoice terms and the similarity with the user's historical input terms are comprehensively considered, thereby comprehensively and accurately evaluating the degree of match between the invoice terms and user needs. Among them, the frequency of the terms reflects the commonness and importance of the terms in the invoice term library, and the relevance reflects the degree of fit between the terms and the user's personal habits and preferences. By introducing a preset weight database, the proportion of the frequency and relevance in the comprehensive relevance can be flexibly adjusted, making the search results more personalized and intelligent. Comprehensive relevance is used as the final sorting basis, which can recommend the best quality and most user-friendly terms to users, significantly improving the user's search experience and efficiency.
[0012] Optionally, the extracting the original invoice to obtain key field information specifically includes: performing OCR recognition on the original invoice to obtain text content in the original invoice; using a preset invoice field model to analyze the text content to obtain key field information corresponding to each of the original invoices.
[0013] By adopting the above technical solution, when extracting the key field information of the original invoice, the OCR recognition technology can be used to automatically and quickly convert the invoice image into text content, avoiding the tediousness and errors of manual entry. At the same time, by analyzing the text content using the preset invoice field model, the key fields in the invoice, such as invoice code, invoice number, invoice date, seller name, buyer name, amount, etc., can be accurately identified, laying the foundation for the subsequent structuring of invoice data. This method greatly improves the efficiency and accuracy of key field extraction, reduces the occurrence of errors and omissions, and ensures the quality and availability of invoice data.
[0014] Optionally, converting the original invoice into standardized invoice structure data based on the key field information specifically includes: performing type identification and format conversion on the key field information to obtain standardized key field data; filling the key field data into corresponding data items according to preset invoice structure data to generate the invoice structure data.
[0015] By adopting the above technical solution, the extracted key field information is converted into standardized invoice structure data, which is the key to realizing the standardized storage and application of invoice data. By identifying the type and converting the format of the key field information, the originally disorganized data is converted into a unified and standardized format, which is convenient for subsequent processing and calculation. According to the preset invoice structure data template, the key field data is filled into the corresponding data item to form structured and standardized invoice structure data, which is convenient for storage, query, statistics and analysis. This method improves the comprehensibility and operability of invoice data, and provides a data foundation for the intelligent management and application of invoices.
[0016] Optionally, determining a target term from a plurality of matching terms and obtaining a target invoice corresponding to the target term specifically includes: obtaining characters continuously input by a user to generate a dynamic search string; matching the dynamic search string with a plurality of matching terms to obtain a relevance result between the dynamic search string and each of the matching terms; sorting the plurality of matching terms from large to small according to the relevance result to obtain a sorting result, and displaying the sorting result to the user, the target term ranked first in the sorting result; when the user completes the input or selects the target term from the sorting result, obtaining the target invoice corresponding to the target term to complete the search.
[0017] By adopting the above technical solution and introducing a dynamic search mechanism, a dynamic search string is generated in the process of continuous character input by the user, and it is matched with the matching terms in real time, which can continuously optimize the search results and provide real-time feedback to the user. As the user inputs more and more characters, the matching accuracy becomes higher and higher, and the user can quickly locate the target term, which greatly improves the search efficiency. At the same time, according to the relevance results of the dynamic search string and the matching terms, the most matching and relevant terms can be displayed at the front, giving the user the best search suggestions. The user does not need to fully enter the complete search content, but only needs to click on the target term in the sorted results to complete the search. The whole process is simple, fast and intelligent, which greatly improves the user's search experience.
[0018] Optionally, the step of obtaining the target character input by the user specifically includes: obtaining a first character, which is the first character input by the user after the user's input action is detected; determining whether the first character matches a preset character; if it is determined that the first character matches the preset character, using the first character as the target character; if it is determined that the first character does not match the preset character, using a second character as the target character, which is the first character after the first character that matches the preset character.
[0019] By adopting the above technical solution, when obtaining the target character input by the user, the first character matching mechanism can be used to quickly determine whether the user's input intention is related to the invoice search. If the first character input by the user is a preset character, the invoice search process can be triggered immediately to improve the response speed; if the first character does not match, the subsequent characters will continue to be matched until the matching target character is found. This method sets preset characters to predict and filter user input, avoids invalid searches and waste of resources, and also reduces the input burden of users.
[0020] In a second aspect of the present application, a data storage management device is provided, which includes: an acquisition module and a processing module, wherein: the acquisition module is used to acquire original invoices in various formats; the processing module is used to extract the original invoice, obtain key field information, and convert the original invoice into standardized invoice structure data according to the key field information; the processing module is also used to generate invoice terms for each of the original invoices according to the invoice structure data, and construct an invoice term library according to each of the invoice terms; the acquisition module is also used to acquire target characters input by the user; the processing module is also used to match the target characters with each of the invoice terms to obtain multiple matching terms, and display the multiple matching terms to the user; the processing module is also used to determine the target term from the multiple matching terms, and acquire the target invoice corresponding to the target term; the processing module is also used to display the target invoice and the target invoice structure data corresponding to the target invoice to the user.
[0021] In the third aspect of the present application, an electronic device is provided, including a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are both used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes any one of the methods described above.
[0022] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores instructions, and when the instructions are executed, any of the methods described above is executed.
[0023] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. By obtaining original invoices in various formats, extracting and standardizing them, we can obtain structured invoice structure data, which is convenient for subsequent storage, retrieval and display. We use the extracted key field information to generate invoice entries and build an invoice entry library, which provides a basis for users to search for invoices. When the user enters the target characters, by matching with the invoice entry library, the relevant target invoice can be found quickly and accurately, which improves the search efficiency. Finally, the target invoice and its target invoice structure data are displayed to the user, so that the user can clearly and comprehensively understand the invoice information, which is convenient for the user to view and use. This method realizes the standardized storage and intelligent retrieval of invoices, effectively improving the efficiency of invoice management and user experience.
[0024] 2. When matching the target characters and invoice terms, by adopting the forward maximum matching algorithm, the candidate terms with the target characters as the first letter can be found quickly and accurately, narrowing the search scope and improving the matching efficiency. The candidate terms are counted for word frequency and relevance, and sorted according to the relevance results. The most relevant terms that are most likely to be selected by users can be displayed first, improving the success rate and satisfaction of user searches. At the same time, by setting a preset number of matching terms, it can provide users with enough choices without being confused by too many terms, making the search results more accurate and practical.
[0025] 3. When calculating the relevance of candidate terms, the frequency of the invoice terms and the similarity with the user's historical input terms are comprehensively considered, so as to comprehensively and accurately evaluate the degree of match between the invoice terms and user needs. Among them, the frequency of the terms reflects the commonness and importance of the terms in the invoice term library, and the relevance reflects the fit between the terms and the user's personal habits and preferences. By introducing a preset weight database, the proportion of the frequency and relevance in the comprehensive relevance can be flexibly adjusted, making the search results more personalized and intelligent. The comprehensive relevance is used as the final sorting basis, which can recommend the best and most user-friendly terms to users, significantly improving the user's search experience and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 It is a flowchart of a data storage management method disclosed in an embodiment of the present application; Figure 2 It is a module schematic diagram of a data storage management device disclosed in an embodiment of the present application; Figure 3 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present application.
[0027] Explanation of the reference numerals: 201, acquisition module; 202, processing module; 300, electronic device; 301, processor; 302, communication bus; 303, user interface; 304, network interface; 305, memory. DETAILED DESCRIPTION
[0028] In order to enable technicians in this field to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.
[0029] In the description of the embodiments of the present application, words such as "for example" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "for example" or "for example" is intended to present related concepts in a specific way.
[0030] In the description of the embodiments of the present application, the meaning of the term "multiple" refers to two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0031] This application provides a data storage management method, referring to Figure 1 , Figure 1 1 is a flow chart of a data storage management method provided in an embodiment of the present application. The method is applied to a server, which is a server that executes a data storage management program. The server can be a single server, or a server cluster composed of multiple servers, or a cloud computing service center. The method includes steps S101 to S107, which are as follows: Step S101: Obtain original invoices in multiple formats.
[0032] In step S101, the server connects with the financial management system within the enterprise to synchronize invoice data regularly. The financial management system stores various types of invoices issued and collected by the enterprise on a daily basis, including value-added tax invoices, ordinary invoices, and electronic invoices. These invoices are saved in formats such as PDF, OFD, and images. The server obtains original invoices in various formats by calling the API interface of the financial management system.
[0033] Step S102: extract the original invoice to obtain key field information, and convert the original invoice into standardized invoice structure data according to the key field information.
[0034] In step S102, the original invoice is extracted to obtain key field information, which specifically includes: performing OCR recognition on the original invoice to obtain the text content in the original invoice; using the preset invoice field model to analyze the text content to obtain the key field information corresponding to each original invoice. The original invoice is converted into standardized invoice structure data according to the key field information, which specifically includes: performing type recognition and format conversion on the key field information to obtain standardized key field data; according to the preset invoice structure data, the key field data is filled into the corresponding data item to generate the invoice structure data.
[0035] Specifically, the server extracts and converts the original invoice, and finally obtains structured and standardized invoice structure data. The specific process is divided into two sub-steps: The first sub-step is to extract the key field information of the invoice. The server can extract the original invoice by using natural language processing (NLP) technology, end-to-end invoice information extraction based on convolutional neural network (CNN), and OCR technology. Preferably, in the embodiment of the present application, OCR technology is used to extract the original invoice. Specifically, the server first performs OCR, i.e. optical character recognition, on the original invoice to convert the invoice image into an editable and searchable text format. OCR technology extracts the printed or handwritten text content on the original invoice by preprocessing, layout analysis, and character segmentation operations on the invoice image, and converts it into a text form that can be processed by the computer. Then, the server uses a preset invoice field model to perform semantic analysis and key information extraction on the text content extracted by OCR. The preset invoice field model is constructed using a rule-based, keyword matching-based, or machine learning-based method. The rule-based method summarizes the fixed pattern between the invoice layout and the field to form a set of parsing rules; the keyword matching-based method defines the keywords of each field, and searches and locates the target field through these keywords; the machine learning-based method uses deep learning algorithms such as LSTM and BERT to train the preset invoice field model through a large number of labeled invoice samples. The server uses the preset invoice field model to scan and analyze the text content line by line, and identifies key fields such as invoice number, invoice date, seller name, buyer name, product name, amount, tax rate, and tax amount. The extracted key field information is stored in the form of Key-Value, where Key is the field name and Value is the field value. The server converts the unstructured invoice text content into semi-structured key field information through the above steps.
[0036] The second sub-step is to convert the extracted invoice key fields into standardized invoice structure data. The server first identifies the type and converts the format of the value of each invoice key field. Then, the server fills the key field data into the corresponding data item according to the preset invoice structure data. The preset invoice structure data is defined in common data formats such as JSON and XML, which specifies the various data items of the invoice and the hierarchical relationship between the various data items. There is a one-to-one mapping or a one-to-many mapping between data items and fields. The server fills the key field data into the corresponding data item. Finally, the server generates a data object that conforms to the standard invoice structure data, and each invoice forms a unique invoice structure data.
[0037] Step S103: Generate invoice terms for each original invoice according to the invoice structure data, and construct an invoice term library according to each invoice term.
[0038] In step S103, the server further generates invoice terms based on the standardized invoice structure data and builds an invoice term library to provide a basis for subsequent invoice intelligent analysis and query retrieval. The specific process is as follows: First, the server traverses each data item in the invoice structure data, extracts key information, and generates corresponding invoice entries. Invoice entries are highly refined and semantic representations of invoice structure data, consisting of several keywords or phrases, and attached with necessary modification information such as values, dates, tags, etc.
[0039] For example, for the "seller name" data item in the invoice structure data, extract its value and form the entry "seller: Company A"; for the "invoice date" data item, extract its value and form the entry "invoice date: 2022-04-01"; for the "amount" data item, extract its value and form the entry "invoice amount: 10000.00 yuan". One invoice can generate multiple entries, covering various important information points of the invoice.
[0040] Next, the server aggregates the invoice entries generated by each invoice and constructs an invoice entry library. On the one hand, the invoice entry library takes each invoice entry as the central perspective and records each invoice entry and its corresponding invoice ID list. For example, the entry "Seller: Company A" corresponds to the invoice ID list [1001, 1002, 1005], and the entry "Invoice Date: 2022-04-01" corresponds to the invoice ID list [1001, 1003, 1006, 1008]. This form of data organization allows you to quickly find all related invoices based on the entry.
[0041] On the other hand, the invoice term library also contains a forward index with the invoice ID as the central perspective, recording all the invoice terms contained in each invoice. For example: invoice ID 1001 contains the terms ["seller: Company A", "invoice date: 2022-04-01", "invoice amount: 10,000.00 yuan"], invoice ID 1002 contains the terms ["seller: Company A", "invoice date: 2022-04-05", "invoice amount: 5,000.00 yuan"]. The invoice term library combines the inverted index and the forward index to construct a multi-dimensional mapping relationship between invoice terms, invoice IDs, and invoice structure data.
[0042] For example, the server extracts 5 seller entries, 6 buyer entries, 8 invoice date entries, and 10 invoice amount entries from the data structure of 10 value-added tax invoices. The constructed invoice entry library contains the following data: the inverted index is: "Seller: Company A": [1001, 1003, 1006, 1009, 1015, ...]; "Seller: Company B": [1002, 1007, 1011, 1019, 1023, ...]; the forward index is 1001: ["Seller: Company A", "Buyer: Company E", "Invoice date: 2022-01-01", "Invoice amount: 10,000.00 yuan"]; 1002: ["Seller: Company B", "Buyer: Company F", "Invoice date: 2022-01-05", "Invoice amount: 10,000.00 yuan"].
[0043] Using the invoice entry database, you can quickly conduct a variety of business queries, such as finding all invoices issued by Company A in January and counting the number of invoices with an invoice amount exceeding 10,000 yuan in January.
[0044] Step S104: Obtain the target character input by the user.
[0045] In step S104, the target character input by the user is obtained, specifically including: obtaining a first character, the first character being the first character input by the user after the user's input action is detected; determining whether the first character matches a preset character; if it is determined that the first character matches the preset character, the first character is used as the target character; if it is determined that the first character does not match the preset character, the second character is used as the target character, the second character being the first character after the first character that matches the preset character.
[0046] Specifically, the server provides a user interaction interface, such as a web search box, a mobile APP input box, etc., for the user to enter characters for querying invoices. When the server detects the user's input action, such as tapping the keyboard, clicking the input box, etc., it is considered that the user starts to enter the query condition. Then, the server obtains the first character entered by the user, that is, the first character, as a candidate target character. The server captures each character entered by the user by monitoring the input event. The first character entered by the user may be Chinese, English letters, numbers or special characters. The server determines whether the first character entered by the user matches the preset characters. The preset characters usually include Chinese characters, letters, numbers, etc., and invalid characters such as line breaks and control characters are filtered out. The server compares the first character with the preset character set. If it is determined that the first character matches the preset character, the first character is regarded as a valid character, otherwise it is regarded as an invalid character. If the first character is valid, the server uses it as the target character for subsequent entry retrieval. The first character entered by the user can usually express his query intention. For example, if the word "sales" is entered, it means that the invoice related to the seller is to be queried; the word "1" means that the invoice for January is to be queried; the word "A" means that the invoice of Company A is to be queried.
[0047] If the first character is invalid, the server continues to obtain the subsequent characters entered by the user until it encounters the first valid character, that is, the second character, and uses it as the target character. For example, if the user enters a line break by mistake, the server automatically ignores it and takes the next valid character as the target character; if the user enters an emoticon, the server also automatically ignores it and continues to obtain the following valid characters as the target character.
[0048] Step S105: Match the target character with each invoice term to obtain multiple matching terms, and display the multiple matching terms to the user.
[0049] In step S105, the forward maximum matching algorithm is used to search for candidate entries with the target character as the first letter in the invoice entry library; the frequency statistics and relevance calculations are performed on each candidate entry to obtain the relevance results; the candidate entries are sorted in descending order according to the relevance results, and a preset number of matching entries are determined.
[0050] Specifically, the server uses a forward maximum matching algorithm to search for candidate terms containing the target character in the inverted index of the invoice term library. The forward maximum matching algorithm starts with the first letter of the target character, searches for all invoice terms with the letter as the first letter in the term library, and continues to match the subsequent letters of the target character until no match is found, and returns the longest matching term.
[0051] For example, if the target character is "Ab", the server will first search for all entries starting with "A", such as "AMC Trade", "Abc Technology", "A Company", etc.; then continue to match the character "b", and find that "AMC Trade" cannot be matched, but "Abc Technology" and "A Company" can be matched, so "Abc Technology" is the longest entry currently matched; then match the space character, and find that none of the entries can be matched, so the longest matching entry finally returned is "Abc Technology". If the user continues to enter "c Technology", the target character is updated to "Abc Technology", and the longest matching entry is also updated to "Abc Technology Company".
[0052] The forward maximum match can dynamically adjust the candidate entries to match according to the constant changes of the target characters, avoiding too many irrelevant entries when the target characters are too short, and matching more accurate entries when the target characters are long enough. Secondly, the server further screens and sorts the matched candidate entries, and selects the most relevant invoice entries as the recommended results. The sorting is mainly based on the two indicators of the frequency of use and relevance of the invoice entries.
[0053] On the one hand, the server counts the frequency of each candidate term, that is, counts the number of times the candidate term appears in the invoice term library. On the other hand, the server uses text similarity algorithms such as TF-IDF to calculate the relevance of each candidate term with the similarity of the user's historical input terms. Finally, the server combines the frequency and relevance indicators to weight and sort the candidate terms. The frequency and relevance are multiplied by the preset weight coefficients respectively, and the two are added to obtain the comprehensive relevance. The weight coefficient can be adjusted according to actual business needs. For example, if the frequency of use is more valued, the frequency weight is increased, and if the word form similarity is more valued, the relevance weight is increased. This application does not limit this. The server uses the comprehensive relevance as the relevance result, sorts the candidate terms in order from high to low, and selects a preset number (such as 5 or 10) of invoice terms with the highest scores as the final matching terms. Users can also select the content they want to query from the matching terms and submit a query request directly.
[0054] In one possible implementation, the frequency of occurrence of each candidate term in the invoice term library is counted to obtain the term frequency of each candidate term; the similarity between each candidate term and the user's historical input terms is calculated to obtain the relevance of each candidate term; based on a preset weight database, the comprehensive relevance of each candidate term is calculated according to the term frequency and relevance of each candidate term, and the comprehensive relevance is used as the relevance result.
[0055] Specifically, the server traverses each invoice in the invoice term library, counts the number of invoices in which each candidate term appears, and then divides it by the total number of invoices to obtain the term frequency of the candidate term. For example, if "Seller: Company A" appears in 10 invoices, and the invoice term library has a total of 100 invoices, its term frequency is 10 / 100=0.1. Secondly, the server calculates the similarity between each candidate term and the user's historical input terms to obtain their relevance. The relevance reflects the degree of match between the candidate term and the user's past input habits. The server records the user's historical input terms and uses word embedding models such as Word2Vec and FastText to convert both the candidate term and the historical input terms into vector representations. Then, the server calculates the cosine similarity between the candidate term vector and the historical input term vector, and takes the maximum value as the relevance of the candidate term. For example, the user's historical search terms include "Company A", "Company B", and "Company C", which are converted into three vectors v1, v2, and v3. The candidate term "seller: Company A" is converted to vector v4, and the following calculations are made: the cosine similarity between v4 and v1 is 0.9; the cosine similarity between v4 and v2 is 0.5; the cosine similarity between v4 and v3 is 0.1; the server takes the maximum value of 0.9 as the relevance of "seller: Company A". Finally, the server weights the frequency and relevance of the candidate terms and obtains the comprehensive relevance as the final relevance result.
[0056] Step S106: Determine a target term from multiple matching terms, and obtain a target invoice corresponding to the target term.
[0057] In step S106, a target term is determined from multiple matching terms, and a target invoice corresponding to the target term is obtained, specifically including: obtaining characters continuously input by a user to generate a dynamic search string; matching the dynamic search string with multiple matching terms to obtain a relevance result between the dynamic search string and each matching term; sorting the multiple matching terms from large to small according to the relevance result to obtain a sorting result, and displaying the sorting result to the user, wherein the first term in the sorting result is the target term; when the user completes the input or selects the target term from the sorting result, the target invoice corresponding to the target term is obtained to complete the search.
[0058] Specifically, the server dynamically updates the ranking of matching terms based on the user's further input, ultimately determines the target term, and obtains the target invoice corresponding to the target term as a search result and returns it to the user. Specifically, the server continuously monitors the user's input, obtains the characters continuously input by the user after the initial target character, and generates a dynamic search string. For example, the user initially inputs "sales", and the server displays several matching terms. At this time, the user continues to input "party", and the dynamic search string is "sales party". The user enters "A", and the dynamic search string is updated to "sales party A". The dynamic search string is a search keyword that changes based on the target character and is associated with the user's real-time input. Next, the server matches the dynamic search string with the current matching terms again, calculates their relevance, and reorders the matching terms based on the relevance. Every time the dynamic search string changes, the server updates the ranking of the matching terms.
[0059] The server uses a method similar to step S105 to calculate the relevance of the dynamic search string and the matching terms. The server sorts the matching terms from large to small according to the relevance to the dynamic search string to obtain a new sorting result. The matching terms in the front are more consistent with the user's latest input and are displayed first. Then, the server displays the updated matching terms sorting results to the user in real time for reference and selection. The sorting results are displayed in the form of a drop-down list. When the sorting results are updated, the user can see that the order of the terms in the drop-down list changes accordingly, and the most relevant terms are always placed at the front. This dynamically updated display method can guide the user to find the desired search results as soon as possible. Finally, the server determines the target term and returns the search results in two ways: one is that the user completes the input and presses the enter key, and the other is that the user actively selects the target term from the sorting results.
[0060] When the user completes the input, it generally means that the dynamic search string has completely matched the search term the user wants. At this time, the server uses the dynamic search string itself as the target term, searches the invoice term library, obtains the invoice data that completely matches the target term, and returns it to the user as the target invoice. For example, if the user enters "Seller: Company A" and presses Enter, the server uses "Seller: Company A" as the target term and returns all invoices where the seller is Company A.
[0061] When a user actively selects a matching term from the sorted results, it is usually because the user feels that the matching term is closest to his or her search intent. At this time, regardless of whether the user input is complete or not, the server will use the selected matching term as the target term, search the invoice term library, obtain the invoice data that fully matches the target term, and return it to the user as the target invoice. For example, if the user only enters "sales" but directly selects "sold by: Company B" from the drop-down list, the server will use "sold by: Company B" as the target term and return all invoices whose seller is Company B. Throughout the entire process, the server uses real-time matching, sorting, and display of dynamic search strings and matching terms, as well as flexible target term determination methods, so that users can quickly find the desired search results and improve the user experience.
[0062] Step S107: Display the target invoice and the target invoice structure data corresponding to the target invoice to the user.
[0063] In step S107, the server displays the target invoice and its corresponding structured data obtained by the user's search to the user in a clear and friendly manner, so that the user can quickly obtain the required information.
[0064] Reference Figure 2 The present application also provides a data storage management device, which is a server, and the server includes an acquisition module 201 and a processing module 202, wherein: the acquisition module 201 is used to acquire original invoices in various formats; the processing module 202 is used to extract the original invoice, obtain key field information, and convert the original invoice into standardized invoice structure data according to the key field information; the processing module 202 is also used to generate invoice terms of each original invoice according to the invoice structure data, and build an invoice term library according to each invoice term; the acquisition module 201 is also used to acquire target characters input by the user; the processing module 202 is also used to match the target characters with each invoice term to obtain multiple matching terms, and display the multiple matching terms to the user; the processing module 202 is also used to determine the target term from the multiple matching terms, and acquire the target invoice corresponding to the target term; the processing module 202 is also used to display the target invoice and the target invoice structure data corresponding to the target invoice to the user.
[0065] In a possible implementation, the processing module 202 matches the target character with each invoice term to obtain multiple matching terms, specifically including: the processing module 202 searches for candidate terms with the target character as the first letter in the invoice term library through a forward maximum matching algorithm; the processing module 202 performs word frequency statistics and relevance calculations on each candidate term to obtain a relevance result; the processing module 202 sorts the candidate terms in descending order according to the relevance result, and determines a preset number of matching terms.
[0066] In one possible implementation, the processing module 202 performs word frequency statistics and relevance calculations on each candidate term to obtain a relevance result, which specifically includes: the processing module 202 counts the frequency of each candidate term appearing in the invoice term library to obtain the word frequency of each candidate term; the processing module 202 calculates the similarity between each candidate term and the user's historical input terms to obtain the relevance of each candidate term; the processing module 202 calculates the comprehensive relevance of each candidate term based on the preset weight database, according to the word frequency and relevance of each candidate term, and uses the comprehensive relevance as the relevance result.
[0067] In a possible implementation, the processing module 202 extracts the original invoice to obtain key field information, specifically including: the processing module 202 performs OCR recognition on the original invoice to obtain the text content in the original invoice; the processing module 202 uses a preset invoice field model to analyze the text content to obtain the key field information corresponding to each original invoice.
[0068] In one possible implementation, the processing module 202 converts the original invoice into standardized invoice structure data according to the key field information, specifically including: the processing module 202 performs type identification and format conversion on the key field information to obtain standardized key field data; the processing module 202 fills the key field data into the corresponding data item according to the preset invoice structure data to generate the invoice structure data.
[0069] In one possible implementation, the processing module 202 determines a target term from a plurality of matching terms and obtains a target invoice corresponding to the target term, specifically comprising: the obtaining module 201 obtains characters continuously input by a user to generate a dynamic search string; the processing module 202 matches the dynamic search string with a plurality of matching terms to obtain a relevance result between the dynamic search string and each matching term; the processing module 202 sorts the plurality of matching terms from large to small according to the relevance result to obtain a sorting result, and displays the sorting result to the user, the first term in the sorting result being the target term; when the user completes the input or selects the target term from the sorting result, the obtaining module 201 obtains the target invoice corresponding to the target term to complete the search.
[0070] In a possible implementation, the acquisition module 201 acquires the target character input by the user, specifically including: the acquisition module 201 acquires the first character, which is the first character input by the user after the user's input action is detected; the processing module 202 determines whether the first character matches the preset character; if the processing module 202 determines that the first character matches the preset character, the first character is used as the target character; if the processing module 202 determines that the first character does not match the preset character, the second character is used as the target character, and the second character is the first character after the first character that matches the preset character.
[0071] It should be noted that: when the device provided in the above embodiment realizes its function, only the division of the above functional modules is used as an example. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0072] The present application also provides an electronic device. Figure 3 , Figure 3 The electronic device 300 may include: at least one processor 301 , at least one network interface 304 , a user interface 303 , a memory 305 , and at least one communication bus 302 .
[0073] The communication bus 302 is used to realize the connection and communication between these components.
[0074] The user interface 303 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 303 may also include a standard wired interface and a wireless interface.
[0075] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0076] Among them, the processor 301 may include one or more processing cores. The processor 301 uses various interfaces and lines to connect various parts in the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 305, and calling data stored in the memory 305. Optionally, the processor 301 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 301 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 301, and it can be implemented separately through a chip.
[0077] Among them, the memory 305 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 305 includes a non-transitory computer-readable storage medium. The memory 305 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 305 may optionally also be at least one storage device located away from the aforementioned processor 301. Refer to Figure 3 , the memory 305 as a computer storage medium may include an operating system, a network communication module, a user interface module and an application program of a data storage management method.
[0078] exist Figure 3In the electronic device 300 shown, the user interface 303 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 301 can be used to call an application program storing a data storage management method in the memory 305, and when executed by one or more processors 301, the electronic device 300 executes one or more of the methods described in the above embodiments. It should be noted that for the aforementioned method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.
[0079] The present application also provides a computer-readable storage medium, which stores instructions. When executed by one or more processors 301, the electronic device 300 executes one or more of the methods described in the above embodiments.
[0080] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0081] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0082] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0083] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0084] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: various media that can store program codes, such as USB flash drives, mobile hard drives, magnetic disks or optical disks.
[0085] The above is only an exemplary embodiment of the present disclosure and cannot be used to limit the scope of the present disclosure. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the disclosure of the specification and the truth of practice, those skilled in the art will easily think of other embodiments of the present disclosure.
[0086] This application is intended to cover any variation, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the art not described in the present disclosure. The description and examples are to be regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.
Claims
1. A data storage management method, characterized in that: The method comprises: Get original invoices in multiple formats; Extracting the original invoice to obtain key field information, and converting the original invoice into standardized invoice structure data according to the key field information; Generate invoice entries for each of the original invoices according to the invoice structure data, and construct an invoice entry library according to each of the invoice entries; Get the target character input by the user; Matching the target character with each of the invoice terms to obtain a plurality of matching terms, and displaying the plurality of matching terms to the user; Determine a target term from the plurality of matching terms, and obtain a target invoice corresponding to the target term; The target invoice and the target invoice structure data corresponding to the target invoice are displayed to the user.
2. The method according to claim 1, characterized in that The matching of the target character with each of the invoice terms to obtain a plurality of matching terms specifically includes: Retrieving candidate entries with the target character as the first letter in the invoice entry database by using a forward maximum matching algorithm; Performing word frequency statistics and relevance calculations on each of the candidate terms to obtain a relevance result; The candidate terms are sorted in descending order according to the relevance results, and a preset number of matching terms are determined.
3. The method according to claim 2, characterized in that The frequency statistics and relevance calculation of each candidate word are performed to obtain the relevance result, specifically including: Counting the frequency of occurrence of each candidate term in the invoice term library to obtain the term frequency of each candidate term; Calculate the similarity between each candidate term and the user's historical input terms to obtain the relevance of each candidate term; Based on a preset weight database, the comprehensive relevance of each candidate term is calculated according to the word frequency and relevance of each candidate term, and the comprehensive relevance is used as the relevance result.
4. The method according to claim 1, characterized in that: The extracting of the original invoice to obtain key field information specifically includes: Performing OCR recognition on the original invoice to obtain the text content in the original invoice; The preset invoice field model is used to analyze the text content to obtain key field information corresponding to each of the original invoices.
5. The method according to claim 1, characterized in that The converting the original invoice into standardized invoice structure data according to the key field information specifically includes: Performing type identification and format conversion on the key field information to obtain standardized key field data; According to the preset invoice structure data, the key field data is filled into the corresponding data item to generate the invoice structure data.
6. The method according to claim 1, characterized in that The step of determining a target term from the plurality of matching terms and obtaining a target invoice corresponding to the target term specifically includes: Get the characters continuously input by the user and generate a dynamic search string; Matching the dynamic search string with the plurality of matching terms to obtain a correlation result between the dynamic search string and each matching term; Sort the plurality of matching terms from largest to smallest according to the relevance result to obtain a sorting result, and display the sorting result to the user, wherein the first term in the sorting result is the target term; When the user completes input or selects a target term from the sorted results, the target invoice corresponding to the target term is obtained to complete the search.
7. The method according to claim 1, characterized in that The step of obtaining the target character input by the user specifically includes: Obtaining a first character, where the first character is the first character input by the user after the user's input action is detected; Determining whether the first character matches a preset character; If it is determined that the first character matches the preset character, taking the first character as the target character; If it is determined that the first character does not match the preset character, a second character is used as the target character, where the second character is the first character after the first character that matches the preset character.
8. A data storage management device, characterized in that: The device comprises an acquisition module (201) and a processing module (202), wherein: The acquisition module (201) is used to acquire original invoices in various formats; The processing module (202) is used to extract the original invoice, obtain key field information, and convert the original invoice into standardized invoice structure data according to the key field information; The processing module (202) is further used to generate invoice terms of each of the original invoices according to the invoice structure data, and to construct an invoice term library according to each of the invoice terms; The acquisition module (201) is also used to acquire the target character input by the user; The processing module (202) is further used to match the target character with each of the invoice terms to obtain a plurality of matching terms, and to display the plurality of matching terms to the user; The processing module (202) is further used to determine a target term from the plurality of matching terms, and obtain a target invoice corresponding to the target term; The processing module (202) is further used to display the target invoice and the target invoice structure data corresponding to the target invoice to the user.
9. An electronic device, characterized in that: The electronic device (300) comprises a processor (301), a memory (305), a user interface (303) and a network interface (304), wherein the memory (305) is used to store instructions, the user interface (303) and the network interface (304) are used to communicate with other devices, and the processor (301) is used to execute the instructions stored in the memory (305) so that the electronic device (300) executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 7 is executed.
Citation Information
Patent Citations
Invoice data processing method and equipment
CN112329814A
Bill information identification method, device and equipment based on OCR (Optical Character Recognition) and storage medium
CN118397642A
Systems and methods for automatically recommending account codes
US20240177244A1