Invoice information query method and device, computer equipment and readable storage medium

By semantic granular segmentation and feature extraction of invoice information, combined with language model processing, the problems of low efficiency and poor adaptability in the prior art are solved, and efficient and adaptable invoice information query are achieved.

CN119166649APending Publication Date: 2024-12-20SHENZHEN GAODENGYUN TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411207636.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

Existing invoice information query methods are difficult to achieve efficient processing in large-scale data and are difficult to adapt to personalized retrieval needs. The data storage form of relational databases limits query performance.

Method used

By performing different semantic granularity segmentation and feature extraction of invoice information, feature information is generated and stored in the same data set, and query requests and target feature information are processed using language models to achieve efficient and adaptive query.

Benefits of technology

It improves the efficiency and adaptability of invoice information query, can accurately match query feature information in the database, and provide high-quality answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119166649A_ABST
    Figure CN119166649A_ABST
Patent Text Reader

Abstract

The invention relates to an invoice information query method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the steps of obtaining a query request corresponding to target invoice information, and performing feature extraction on the query request to obtain query feature information corresponding to the query request; matching the query feature information with feature information of each data set in a database to obtain target feature information corresponding to the query feature information; wherein the feature information is obtained by performing segmentation and feature extraction on the invoice information in advance according to different semantic granularities, and the feature information corresponding to the same semantic granularity is stored in the same data set; and inputting the target feature information and the query request into a language model for processing to obtain answer information corresponding to the target invoice information. By adopting the method, the efficiency and adaptability of inquiring the invoice information can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of invoice technology, and in particular to a method, device, computer equipment, computer-readable storage medium and computer program product for querying invoice information. Background Art

[0002] In the field of invoice technology, invoice information is usually queried in a database storing the invoice information.

[0003] However, the current method for querying invoice information is to store invoice information through a relational database. However, the relational database and the data storage format therein greatly limit the query performance of invoice information. On the one hand, it is difficult to achieve efficient processing in large-scale data. On the other hand, it is difficult to achieve adaptive query for personalized retrieval needs. Summary of the invention

[0004] Based on this, it is necessary to provide an invoice information query method, device, computer equipment, computer-readable storage medium and computer program product that can improve the efficiency and adaptability of invoice information query in response to the above technical problems.

[0005] In a first aspect, the present application provides a method for querying invoice information, comprising:

[0006] Obtaining a query request corresponding to the target invoice information, performing feature extraction on the query request, and obtaining query feature information corresponding to the query request;

[0007] Matching the query feature information with the feature information of each data set in the database respectively to obtain target feature information corresponding to the query feature information; wherein the feature information is obtained by pre-segmenting and feature extracting the invoice information according to different semantic granularities, and the feature information corresponding to the same semantic granularity is stored in the same data set;

[0008] The target feature information and the query request are input into a language model for processing to obtain answer information corresponding to the target invoice information.

[0009] In one embodiment, matching the query feature information with feature information of each data set in the database to obtain target feature information corresponding to the query feature information includes:

[0010] Obtaining similarities between the query feature information and each feature information respectively, and sorting each feature information according to the similarity to obtain a plurality of first feature information in a first preset order;

[0011] According to a preset evaluation index, similarity evaluation results between the query feature information and each first feature information are obtained, and each first feature information is sorted according to the similarity evaluation result to obtain second feature information in a second preset order, and the second feature information is used as the target feature information corresponding to the query feature information.

[0012] In one of the embodiments, before obtaining the query request corresponding to the target invoice information, it also includes: obtaining the invoice information, identifying the seller identification and the buyer identification corresponding to the invoice information in the invoice information; obtaining the first enterprise information corresponding to the seller identification and the second enterprise information corresponding to the buyer identification in the enterprise information platform through the communication interface corresponding to the enterprise information platform; segmenting and extracting features from the invoice information, the first enterprise information and the second enterprise information according to different semantic granularities to obtain feature information, and storing the feature information of the same semantic granularity in the same data set.

[0013] In one of the embodiments, segmenting the invoice information, the first enterprise information and the second enterprise information according to different semantic granularities and extracting features to obtain feature information, and storing the feature information of the same semantic granularity in the same data set, includes: segmenting the invoice information, the first enterprise information and the second enterprise information according to semantic units of different levels to obtain segmented data, and storing the segmented data corresponding to the semantic units of the same level in the same data set; the levels of the semantic units include document level, paragraph level, line level, word level and character level; extracting features from the segmented data of each data set to obtain feature information, and fusing the feature information of the same data set to obtain data sets represented in the form of vector matrices.

[0014] In one of the embodiments, the invoice information, the first enterprise information and the second enterprise information are segmented and feature extracted according to different semantic granularities to obtain feature information, and the feature information of the same semantic granularity is stored in the same data set, including: generating data processing tasks corresponding to each semantic granularity according to different semantic granularities, and the data processing tasks are tasks that sequentially perform segmentation processing, feature extraction processing, and writing processing to a database on the data; and determining the task execution status corresponding to each data processing task according to the current operating environment, so that each data processing task is executed in parallel according to the corresponding task execution status.

[0015] In one of the embodiments, matching the query feature information with the feature information of each data set in the database to obtain target feature information corresponding to the query feature information includes: generating data matching tasks corresponding to each data set according to different data sets, wherein the data matching tasks are tasks for matching the query feature information with the feature information of the data set; and determining the task execution status corresponding to each data matching task according to the current operating environment, so that each data matching task is executed in parallel according to the corresponding task execution status.

[0016] In a second aspect, the present application also provides a device for querying invoice information, including:

[0017] An acquisition module, used to acquire a query request corresponding to the target invoice information, perform feature extraction on the query request, and obtain query feature information corresponding to the query request;

[0018] A matching module, used to match the query feature information with the feature information of each data set in the database, respectively, to obtain target feature information corresponding to the query feature information; wherein the feature information is obtained by pre-segmenting and feature extracting the invoice information according to different semantic granularities, and the feature information corresponding to the same semantic granularity is stored in the same data set;

[0019] The model processing module is used to input the target feature information and the query request into the language model for processing to obtain the answer information corresponding to the target invoice information.

[0020] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the above steps when executing the computer program.

[0021] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the above steps when executed by a processor.

[0022] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the above steps when executed by a processor.

[0023] The above-mentioned invoice information query method, device, computer equipment, computer-readable storage medium and computer program product pre-segment the invoice information according to different semantic granularities and extract features to obtain feature information corresponding to each data set, and obtain target feature information corresponding to the query feature information by matching the query feature information corresponding to the query request with the feature information in the database respectively, so as to use the target feature information and the query request as the input of the language model to obtain output answer information; based on this, on the one hand, in the dimension of feature information matching, the target feature information corresponding to the query feature information is accurately and efficiently matched in the database, and on the other hand, in the dimension of semantic granularity matching, the query feature information is adaptively and hierarchically matched with the feature information of different semantic granularities to obtain the target feature information, so as to accurately obtain the answer information according to the matched target feature information, so as to improve the efficiency and adaptability of invoice information query. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0025] Figure 1 A schematic diagram of a flow chart of a method for querying invoice information in one embodiment;

[0026] Figure 2 A timing diagram of a method for querying invoice information in one embodiment;

[0027] Figure 3 It is a structural block diagram of a device for querying invoice information in an embodiment;

[0028] Figure 4 is an internal structure diagram of a computer device in one embodiment;

[0029] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0031] In one embodiment, Figure 1As shown, a method for querying invoice information is provided. This embodiment uses the method applied to a server as an example for illustration. It can be understood that the method can also be applied to a terminal, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps S102 to S106, wherein:

[0032] Step S102, obtaining a query request corresponding to the target invoice information, performing feature extraction on the query request, and obtaining query feature information corresponding to the query request.

[0033] Among them, invoice information can represent the various contents and data recorded on the invoice, such as invoice type, invoice code and number, invoice date, product or service information, amount, purchaser information, seller information, remarks information and other contents recorded on the invoice.

[0034] The target invoice information may represent the invoice information specified for query; the query request is used to request a query on the target invoice information.

[0035] Exemplarily, the query feature information may represent the semantic feature information corresponding to the query request, that is, the query feature information may represent information describing the nature, scope and purpose of the query, such as: the query conditions such as the invoice type, time range, amount range, specific supplier or customer involved in the query; the application scenarios such as financial statistics, tax declaration, invoice verification, etc. involved in the query; the query types such as exact match, fuzzy search, range query, etc. involved in the query.

[0036] Step S104, matching the query feature information with the feature information of each data set in the database respectively, to obtain the target feature information corresponding to the query feature information; wherein the feature information is obtained by pre-segmenting and feature extracting the invoice information according to different semantic granularities, and the feature information corresponding to the same semantic granularity is stored in the same data set.

[0037] Among them, semantic granularity can represent the degree of precision in segmenting text information.

[0038] Exemplarily, semantic granularity may indicate the degree of fineness of segmentation of text information according to the text level, that is: segmenting the invoice information according to the coarsest granularity, each segmented information may correspond to an invoice, that is, to all the information of the invoice; segmenting the invoice information according to the medium granularity, each segmented information may correspond to the main information block in the invoice, for example, to the invoice header information, the invoice bottom information, etc.; segmenting the invoice information according to the fine granularity, each segmented information may correspond to a specific information item in the invoice, for example, to the invoice type, invoice code, invoice number, invoice date, etc.; segmenting the invoice information according to the finest granularity, each segmented information may correspond to a single data item in the invoice, for example, to a specific numerical value, text or code, etc.

[0039] Optionally, the semantic granularity represents the degree of precision of segmenting text information according to the complexity of semantic relationships, that is: semantic relationships may include simple parallel relationships, for example, an invoice includes product name, unit price and quantity; semantic relationships may include causal relationships, for example, a preferential price can be enjoyed because the purchase volume is large; semantic relationships may include conditional relationships, for example, if the total amount exceeds 10,000 yuan, the freight is free; semantic relationships may include multiple cross-relationships, such as the relationship between invoice amount, tax rate, discount and final payable.

[0040] Exemplarily, the feature information in the database may represent semantic feature information corresponding to the segmented invoice information, that is, the feature information of the invoice information may represent information for a deep understanding and interpretation of the content in the invoice, for example: it may represent the meaning of each data item, for example, "amount" represents the value of the transaction; it may represent the relationship between data items, for example, the product of unit price and quantity is equal to the amount; it may represent the classification of information, for example, classifying "paper towels" as "office supplies"; it may represent the purpose of information, for example, certain fields are used for tax declaration.

[0041] Exemplarily, the feature information corresponding to the segmented invoice information can represent information for in-depth understanding and interpretation of the content in the invoice at different semantic granularities, for example: it can represent character-level semantic features, that is, the semantic attributes of a single character, such as numeric characters representing quantity or amount, special symbols (such as ¥) representing currency units; it can represent word-level semantic features, that is, the semantic meaning of a single word or phrase, for example, "value added tax" represents the invoice type, and "payee" represents a specific role; it can represent field-level semantic features, that is, the semantic meaning of a single data item on the invoice, for example, the "amount" field represents the value of the goods or services, and the "tax rate" field represents the applicable tax rate percentage.

[0042] Optionally, the feature information corresponding to the segmented invoice information can also represent entity-level semantic features, that is, the semantic meaning and attributes of the complete entity on the invoice, such as the purchaser entity including attributes such as name, tax number, address, etc., and the commodity entity including attributes such as name, specification, unit price, quantity, etc.; it can also represent relationship-level semantic features, that is, the semantic relationship between the elements on the invoice, such as the correspondence between the commodity and the amount, and the transaction relationship between the purchaser and the seller; it can also represent document-level semantic features, that is, the overall semantic features of the entire invoice, such as the purpose of the invoice (such as reimbursement, accounting), the legality and validity of the invoice; it can also represent business-level semantic features, that is, the semantic meaning of the invoice in a broader business context, such as the business type to which the invoice belongs (such as procurement, sales), and the relationship between the invoice and other business documents (such as orders, contracts).

[0043] Exemplarily, the query feature information can be matched with the feature information of each data set in the database, or the query feature information can be matched with the feature information of a specified data set in the database; the target feature information corresponding to the query feature information can be obtained from all the feature information, or the target feature information corresponding to the query feature information can be obtained from each data set.

[0044] Optionally, according to the similarity between the query feature information and each feature information, multiple feature information with higher similarity can be used as target feature information; or unique feature information with the highest similarity can be used as target feature information.

[0045] Optionally, the M3E model (Multilingual & Multimodal Embedding) can be used to extract features from the query request to obtain query feature information, or to extract features from the segmented invoice information to obtain feature information; further, based on the M3E model, the query feature information and feature information are converted into vector form to ensure that the semantics and structure of the data are represented in the feature space.

[0046] Optionally, for the M3E model, after pre-training with large-scale data, fine-tuning is performed for a specific invoice information processing task to improve the model performance in the scenario of processing invoice information.

[0047] Alternatively, data feature extraction can be achieved through models in the field of natural language processing, such as Bag of Words (BoW), word embedding models (such as Word2Vec, GloVe), and deep learning models (such as BERT, GPT).

[0048] Step S106, input the target feature information and the query request into the language model for processing, and obtain answer information corresponding to the target invoice information.

[0049] Among them, the language model is a large-scale neural network trained based on deep learning technology, which can understand, generate and operate natural language.

[0050] Exemplarily, the role of using a query request as the input of a language model is to: define the task, i.e., clarify the user's intentions and needs; provide context, i.e., provide a background for the language model to understand and answer questions; guide the direction, i.e., guide the language model to focus on specific topics or information points; determine the output format, i.e., imply the expected type of answer, such as a short answer, a detailed explanation, etc.

[0051] Exemplarily, the role of using query requests as input to a language model is to: provide a knowledge base, that is, to supplement the language model with specific information that may not be in its training data; enhance accuracy, that is, to provide the latest or professional information to improve the accuracy of the answer; support argumentation, that is, to provide factual basis and reference sources for the language model's answer; expand perspective, that is, to provide information from multiple angles to make the answer more comprehensive.

[0052] Exemplarily, the target feature information and query request are combined as the input of the language model to: retrieve information-rich queries, that is, provide additional context for short or vague queries; jointly construct prompts, that is, form a structured input to guide the language model to generate high-quality answers.

[0053] Optionally, text information corresponding to the target feature information and a query request in text form may be used as inputs to the language model; target feature information in feature form and query feature information in feature form may also be used as inputs to the language model.

[0054] Exemplarily, the answer information may include a question part and an answer part, wherein the question part may represent the query text corresponding to the query request, and the answer part may represent the answer text obtained by the language model through data integration and reasoning on the query request and target feature information.

[0055] Optionally, after generating answer information corresponding to the target invoice information, the answer information may be returned to a terminal corresponding to the query request.

[0056] Optionally, the target feature information is retrieved from the database through a query request, and then the target feature information and the query request are used as inputs of the language model. This can be expressed by using the RAG (Retrieval Augmented Generation) retrieval method to retrieve relevant information through the own vertical domain database, and then merge them into a prompt template, so that the language model can generate an accurate answer through the prompt template.

[0057] In the above-mentioned query method for invoice information, the invoice information is pre-segmented and feature extracted according to different semantic granularities to obtain feature information corresponding to each data set, and the query feature information corresponding to the query request is matched with the feature information in the database to obtain the target feature information corresponding to the query feature information, so that the target feature information and the query request are used as the input of the language model to obtain the output answer information; based on this, on the one hand, in the dimension of feature information matching, the target feature information corresponding to the query feature information is accurately and efficiently matched in the database, and on the other hand, in the dimension of semantic granularity matching, the query feature information is adaptively and hierarchically matched with the feature information of different semantic granularities to obtain the target feature information, so as to accurately obtain the answer information according to the matched target feature information, so as to improve the efficiency and adaptability of querying invoice information.

[0058] In an exemplary embodiment, the query feature information is matched with the feature information of each data set in the database to obtain the target feature information corresponding to the query feature information, including steps S202 to S204, wherein:

[0059] Step S202: obtaining similarities between the query feature information and each feature information, and sorting each feature information according to the similarities to obtain a plurality of first feature information in a first preset order.

[0060] Among them, similarity refers to the degree of proximity or similarity of different feature information under a certain metric.

[0061] The first feature information indicates feature information that is sorted into a first preset order after sorting each feature information according to similarity.

[0062] Exemplarily, the similarity between the query feature information and each feature information can be calculated by cosine similarity, which is equivalent to calculating the cosine value of the angle between the query feature information in vector form and each feature information in vector form to obtain the similarity between the query feature information and each feature information.

[0063] Optionally, the similarity between the query feature information and each feature information may be calculated using Euclidean distance, which is equivalent to calculating the straight-line distance between the query feature information in vector form and each feature information in vector form to obtain the similarity between the query feature information and each feature information.

[0064] Optionally, the similarity between the query feature information and each feature information can be calculated through the bag-of-words model, which is equivalent to calculating the straight-line distance between the query feature information in the form of a word frequency vector and each feature information in the form of a word frequency vector to obtain the similarity between the query feature information and each feature information.

[0065] Exemplarily, each feature information is sorted according to similarity, and based on the sorting result, multiple first feature information in a first preset order are obtained, wherein the first preset order can be a fixed value, or a value specified by the user, or a dynamic value determined according to the actual data processing process.

[0066] Optionally, the first preset order may be dynamically determined according to a preset lower threshold of similarity, which is equivalent to that the similarities between the query feature information and each of the first feature information are greater than or equal to the preset lower threshold of similarity.

[0067] Optionally, the first preset order can also be dynamically determined based on the amount of feature information in the database, that is, if the amount of feature information is large, the first preset order can be adjusted up, that is, the number of selected first feature information is increased; if the amount of feature information is small, the first preset order can be adjusted down, that is, the number of selected first feature information is reduced.

[0068] Step S204, according to the preset evaluation index, obtain the similarity evaluation results between the query feature information and each first feature information respectively, sort the first feature information according to the similarity evaluation results, obtain the second feature information of the second preset order, and use the second feature information as the target feature information corresponding to the query feature information.

[0069] The evaluation index represents an index for measuring the similarity between the query feature information and the first feature information; the similarity evaluation result represents a result obtained by evaluating the similarity between the query feature information and the first feature information based on the evaluation index.

[0070] The second feature information represents the first feature information sorted into a second preset order after sorting the first feature information according to the similarity.

[0071] Exemplarily, the evaluation index may represent an evaluation index for evaluating the first feature information, such as: content quality assessment, i.e., performing a quality assessment on the first feature information based on factors such as text length, structure, and readability; semantic integrity assessment, i.e., evaluating the integrity of the semantically key information of the first feature information; terminology standardization assessment, i.e., evaluating whether the terminology corresponding to the first feature information conforms to the standardized business language; semantic anomaly detection, i.e., evaluating whether the first feature information contains uncommon or suspicious information.

[0072] Exemplarily, the evaluation index may represent an evaluation index for evaluating the combination of the query feature information and the first feature information, such as: semantic similarity, i.e., evaluating the semantic similarity between the query feature information and the first feature information; intent recognition, i.e., analyzing the semantic intent of the query feature information to evaluate the relevance between the query feature information and the first feature information; query expansion similarity, i.e., using synonyms, hypernyms or related concepts to expand the original query feature information, and calculating the semantic similarity after expansion; temporal semantic relevance, i.e., understanding the temporal expression in the query feature information to evaluate the temporal semantic similarity between the query feature information and the first feature information.

[0073] Exemplarily, the similarity evaluation result may be expressed in the form of a score from 1 to 10, or in the form of a percentage, or in the form of a high, medium, or low level.

[0074] Optionally, between the query feature information and a first feature information, the sub-scores corresponding to each evaluation indicator can be determined, and the sub-scores corresponding to each evaluation indicator can be weighted to obtain a corresponding comprehensive score, which is equivalent to the similarity evaluation result between the query feature information and the first feature information.

[0075] Exemplarily, each piece of first feature information is sorted according to similarity, and based on the sorting result, second feature information of a second preset order is obtained, wherein the second preset order may be a fixed value, or may represent a value specified by the user, or may represent a dynamic value determined according to the actual data processing process.

[0076] Optionally, the second preset order may be dynamically determined according to the lower threshold of the preset similarity evaluation result with reference to the value-taking method of the first preset order; the second preset order may also be dynamically determined according to the amount of the first feature information.

[0077] Optionally, a plurality of second feature information in a second preset order may be obtained according to the sorting result; or, according to the sorting result, the first feature information ranked first may be used as the second feature information.

[0078] In this embodiment, first, each feature information is sorted according to the similarity between the query feature information and each feature information, so as to preliminarily obtain a plurality of first feature information of a first preset order; secondly, each first feature information is sorted according to the similarity evaluation result between the query feature information and each first feature information, so as to further obtain second feature information of a second preset order; based on this, the feature information in the database is matched and screened hierarchically, so as to accurately obtain the target feature information corresponding to the query feature information.

[0079] In an exemplary embodiment, before obtaining the query request corresponding to the target invoice information, the method further includes steps S302 to S306, wherein:

[0080] Step S302, obtaining invoice information, and identifying the seller identifier and the buyer identifier corresponding to the invoice information in the invoice information.

[0081] Among them, the seller's identification represents the identity information of the party that sells goods or provides services, and the buyer's identification represents the identity information of the party that purchases goods or receives services.

[0082] For example, when the seller or buyer is an enterprise, the seller's identification or buyer's identification may represent identity information such as the enterprise name, taxpayer identification number, enterprise registration address, enterprise contact number, enterprise bank account opening bank and account number, and invoice special stamp.

[0083] Exemplarily, the acquired invoice information may represent the invoice information uploaded by the current user at the current moment or at a historical moment, requesting to issue an invoice based on the invoice information; it may also represent the invoice uploaded by the current user at the current moment or at a historical moment, and the information contained in the invoice.

[0084] Optionally, the acquired invoice information may also represent information obtained after collecting, organizing and uniformly managing the invoice information of the current user scattered in multiple sources or systems.

[0085] Step S304, obtaining the first enterprise information corresponding to the seller's identifier and the second enterprise information corresponding to the buyer's identifier in the enterprise information platform through the communication interface corresponding to the enterprise information platform.

[0086] Among them, the enterprise information platform refers to a platform used to collect, organize and display enterprise information.

[0087] Among them, enterprise information refers to information that describes the enterprise in a structured and standardized manner. For example: it can represent the basic information of the enterprise, such as the company name, registration number, legal representative, etc.; it can represent financial information, such as assets, liabilities, revenue, profit, etc.; it can represent organizational structure, such as department settings, staffing, etc.; it can represent operating information, such as main business, products and services, market share, etc.; it can represent legal information, such as industrial and commercial registration, licenses, litigation records, etc.

[0088] The first enterprise information indicates the enterprise information corresponding to the seller's ID, and the second enterprise information indicates the enterprise information corresponding to the buyer's ID.

[0089] Optionally, if the seller or the buyer is both an enterprise, the first enterprise information corresponding to the seller's identification and the second enterprise information corresponding to the buyer's identification are obtained; if the seller is an enterprise and the buyer is an individual, only the first enterprise information corresponding to the seller's identification is obtained; if the seller is an individual and the buyer is an enterprise, only the second enterprise information corresponding to the buyer's identification is obtained.

[0090] Optionally, a communication connection with the enterprise information platform can be established through a communication interface provided by the enterprise information platform to collect and receive corresponding enterprise information. For example, different types of enterprise information can be collected and received through different types of application programming interfaces (APIs).

[0091] Step S306, segmenting and extracting features from the invoice information, the first enterprise information, and the second enterprise information according to different semantic granularities to obtain feature information, and storing the feature information of the same semantic granularity in the same data set.

[0092] Exemplarily, the invoice information, the first enterprise information and the second enterprise information may be integrated to obtain integrated data, and then the integrated data may be segmented and feature extracted according to different semantic granularities; or the invoice information, the first enterprise information and the second enterprise information may be segmented and feature extracted according to different semantic granularities respectively.

[0093] In this embodiment, by identifying the seller ID and the buyer ID corresponding to the invoice information, the enterprise information corresponding to the seller ID and the buyer ID is matched in the enterprise information platform, so that the enterprise information and invoice information are used as objects for data segmentation and feature extraction, thereby improving the comprehensiveness and completeness of the data, and then being able to accurately and comprehensively match the corresponding target feature information in the database by querying the feature information, thereby improving the recall rate of the retrieval.

[0094] In an exemplary embodiment, the invoice information, the first enterprise information, and the second enterprise information are segmented and feature extracted according to different semantic granularities to obtain feature information, and the feature information of the same semantic granularity is stored in the same data set, including steps S402 to S404, wherein:

[0095] Step S402, segmenting the invoice information, the first enterprise information and the second enterprise information according to semantic units of different levels to obtain segmented data, and storing the segmented data corresponding to the semantic units of the same level in the same data set; the levels of the semantic units include document level, paragraph level, line level, word level and character level.

[0096] Exemplarily, the data is segmented according to different semantic granularities, that is, the data is segmented according to different levels of semantic units; wherein the levels of semantic units include document level, paragraph level, line level, word level and character level.

[0097] Optionally, when the invoice information is segmented at the document level, the entire invoice can be regarded as a whole, that is, the whole includes all the data in the invoice; when the invoice information is segmented at the paragraph level, different parts of the invoice can be regarded as different paragraphs for segmentation, for example, the purchaser information, the seller information, and the product details can be regarded as a paragraph respectively; when the invoice information is segmented at the line level, each word in the invoice can be segmented separately, for example, words such as company name, amount, and product name can be segmented separately; when the invoice information is segmented at the character level, all characters in the invoice can be segmented separately, for example, characters such as numbers, letters, and symbols can be segmented separately.

[0098] Optionally, when enterprise information is segmented at the document level, the entire enterprise archive can be regarded as a whole, that is, the whole includes all the information of the enterprise; when enterprise information is segmented at the paragraph level, different categories of information in the enterprise information can be regarded as different paragraphs for segmentation, for example, registration information, financial information, and legal proceedings information can be respectively regarded as a paragraph; when enterprise information is segmented at the line level, each item of enterprise information can be segmented separately, for example, items such as enterprise name, legal representative, registered capital, business scope, etc. can be segmented separately; when enterprise information is segmented at the word level, key words in the enterprise information can be segmented separately, for example, key words such as enterprise type, industry category, geographical location, etc. can be segmented separately; when enterprise information is segmented at the character level, all characters in the enterprise information can be segmented separately, for example, characters such as numbers, letters, symbols, etc. can be segmented separately.

[0099] Optionally, the hierarchy of semantic units also includes a context level. For example, when current information is identified, the previous and next related information is taken into consideration based on semantics, so that data segmentation is performed based on the current information and the previous and next related information.

[0100] Optionally, the hierarchy of semantic units also includes a relationship level. For example, data segmentation is performed on invoice information based on the transaction relationship between the buyer and the seller in the invoice information, the correspondence between goods and amounts, and the time series relationship between different invoices. Data segmentation is performed on enterprise information based on the relationship between the parent company and subsidiaries, the relationship between the enterprise and suppliers, the relationship between the enterprise and customers, and the relationship between the legal representative and multiple enterprises.

[0101] Optionally, the hierarchy of semantic units also includes entity levels. For example, data segmentation of invoice information is performed based on entities such as company name, amount, date, commodity or service name in the invoice information, and data segmentation of enterprise information is performed based on entities such as enterprise name, legal representative, registered capital, registered address in the enterprise information.

[0102] Step S404 , extracting features from the segmented data of each data set to obtain feature information, and fusing the feature information of the same data set to obtain data sets represented in the form of vector matrices.

[0103] Exemplarily, first, feature extraction can be performed on the segmented data to obtain feature information so as to convert the segmented data into vector expression; secondly, the segmented data represented in vector form in the same data set can be fused to obtain, in each data set, a vector matrix corresponding to the fused segmented data, which is equivalent to representing each data set in the form of a vector matrix.

[0104] Optionally, the M3E model can be used to perform feature extraction and vector conversion processing on the segmented invoice information and enterprise information to obtain feature information represented in vector form.

[0105] Optionally, in each data set, ensure that the vectors corresponding to each segmented data have the same dimension, and splice to obtain the corresponding vector matrix according to the number and dimension of the vectors. For example, each row of the vector matrix represents the vector corresponding to each segmented data, and each column of the vector matrix represents the dimension of each vector.

[0106] Optionally, the query feature information may be converted into a vector form expression accordingly, so that the query feature information can be matched with the feature information in the database in the dimension of matching the vector information.

[0107] In this embodiment, first, the invoice information and enterprise information are segmented according to semantic units of different levels to obtain segmented data, and then, the segmented data of each data set are feature extracted to obtain feature information represented in the form of vectors, and then, the feature information of the same data set is fused to obtain data sets represented in the form of vector matrices; based on this, vector matrices corresponding to different semantic granularities are accurately and hierarchically obtained, so as to achieve precise matching of query feature information with feature information in the database in the dimension of vector information matching.

[0108] In an exemplary embodiment, the invoice information, the first enterprise information, and the second enterprise information are segmented and feature extracted according to different semantic granularities to obtain feature information, and the feature information of the same semantic granularity is stored in the same data set, including steps S502 to S504, wherein:

[0109] Step S502, generating data processing tasks corresponding to different semantic granularities, wherein the data processing tasks are tasks for sequentially performing data segmentation processing, feature extraction processing, and data writing processing.

[0110] Exemplarily, in the data processing tasks corresponding to each semantic granularity, the execution process of a data processing task corresponding to a semantic granularity is to segment the invoice information and enterprise information according to the semantic granularity, then perform feature extraction on the segmented data, and then write the data obtained by feature extraction into the database.

[0111] Optionally, in a data processing task corresponding to a semantic granularity, corresponding subtasks may be generated for a data segmentation process, a data feature extraction process, and a data writing process.

[0112] Step S504: determining the task execution status corresponding to each data processing task according to the current operating environment, so that each data processing task is executed in parallel according to the corresponding task execution status.

[0113] The task execution status of the data processing task indicates the execution status of the data processing task in the current operating environment.

[0114] Among them, the current operating environment may represent the hardware, software, configuration or any combination that supports the execution of data processing tasks, for example, hardware resources such as CPU, memory, storage, software resources such as operating system, application, and configuration resources such as network environment and security environment.

[0115] Exemplarily, based on the demand for parallel processing of each data processing task, the task execution status corresponding to each data processing task in the current operating environment is dynamically adjusted, so that resources are adaptively allocated to each data processing task during the execution process, so that each data processing task is executed in parallel according to the corresponding task execution status, thereby ensuring that the data processing tasks corresponding to each semantic granularity can implement the data segmentation process, data feature extraction process, and database writing process in parallel.

[0116] Optionally, if in each data processing task, corresponding subtasks are generated for the data segmentation process, the data feature extraction process, and the data writing process, then the subtasks corresponding to each data segmentation process can be executed in parallel according to the corresponding task execution status. After each subtask is completed, the subtasks corresponding to each data feature extraction process can be executed in parallel according to the corresponding task execution status. After each subtask is completed, the subtasks corresponding to each database writing process can be executed in parallel according to the corresponding task execution status.

[0117] Exemplarily, the task execution status may represent parameter information of the data processing task at the time management level, such as execution time, response time, and waiting time; the task execution status may also represent parameter information of the data processing task at the resource management level, such as CPU usage and memory usage; the task execution status may also represent parameter information at the task management level, such as the data dependency between the task and other tasks, the degree of parallel processing, etc.; the task execution status may also represent parameter information at the network management level, such as the proportion of network bandwidth resources occupied, the total amount of data transmitted, and the transmission time delay.

[0118] Optionally, the task execution status may also indicate parameter information on the reliability and fault tolerance level, such as the frequency of errors, the number of retries required due to errors or failures, and the recovery time after a failure. The task execution status may also indicate parameter information on the security management level, such as the permissions and security level required for task execution, whether encryption protection is performed, behavior records and audit logs, etc.

[0119] In this embodiment, data processing tasks corresponding to each semantic granularity are generated, and the task execution status corresponding to each data processing task is determined dynamically and in real time according to the current operating environment to ensure that each data processing task is adaptively processed in parallel according to the corresponding task execution status, thereby improving the efficiency of data segmentation, feature extraction, and database writing according to different semantic granularities.

[0120] In an exemplary embodiment, the query feature information is matched with the feature information of each data set in the database to obtain the target feature information corresponding to the query feature information, including steps S602 to S604, wherein:

[0121] Step S602: Generate data matching tasks corresponding to different data sets according to different data sets. The data matching task is a task of matching query feature information with feature information of the data set.

[0122] Step S604: determining the task execution status corresponding to each data matching task according to the current operating environment, so that each data matching task is executed in parallel according to the corresponding task execution status.

[0123] The task execution status of the data matching task indicates the execution status corresponding to the execution of the data matching task in the current operating environment.

[0124] Among them, the current operating environment may represent the hardware, software, configuration or any combination that supports the execution of the data matching task, for example, hardware resources such as CPU, memory, storage, software resources such as operating system, application, and configuration resources such as network environment and security environment.

[0125] Exemplarily, in the data matching tasks corresponding to the respective data sets, the execution process of the data matching task corresponding to a data set is to match the query feature information with the feature information stored in the data set.

[0126] Exemplarily, based on the demand for parallel processing of each data matching task, the task execution status corresponding to each data matching task in the current operating environment is dynamically adjusted, so that resources are adaptively allocated to each data matching task during the execution process, so that each data matching task is executed in parallel according to the corresponding task execution status, thereby ensuring that the data matching tasks corresponding to each data set can realize the data matching process in parallel.

[0127] Optionally, the task execution status of the data matching task may refer to the task execution status of the data processing task in the above-mentioned embodiment, that is, the task execution status of the data matching task may represent parameter information of the data processing task at the time management level, such as execution time, response time, and waiting time; it may also represent parameter information of the data processing task at the resource management level, such as CPU usage and memory usage; it may also represent parameter information at the task management level, such as the data dependency relationship between the task and other tasks, the degree of parallel processing, etc.; it may also represent parameter information at the network management level, such as the proportion of occupied network bandwidth resources, the total amount of data transmitted, and the transmission time delay.

[0128] In this embodiment, data matching tasks corresponding to each data set are generated, and the task execution status corresponding to each data matching task is determined dynamically and in real time according to the current operating environment to ensure that each data matching task is adaptively processed in parallel according to the corresponding task execution status, thereby improving the efficiency of matching data in different data sets.

[0129] In an exemplary embodiment, Figure 2 As shown, the method further comprises the following steps:

[0130] On the one hand, in the scenario of storing invoice information, first, the user inputs an invoice issuance request through a terminal, and the invoice issuance request includes invoice data to be issued; the invoice data from the terminal is collected and sent to the server.

[0131] Furthermore, after receiving the invoice data from the terminal, the server performs text extraction on the invoice data to obtain invoice information, such as invoice type, date, amount, invoice number and code, purchaser information, seller information, invoice details, remarks information, invoice type, issuer information, etc.

[0132] Then, based on the purchaser information and seller information in the invoice information, the enterprise information corresponding to the purchaser information and the enterprise information corresponding to the seller information are obtained from the third-party enterprise information platform.

[0133] Furthermore, the invoice information and enterprise information are input into the M3E model, and the invoice information and enterprise information are segmented in parallel according to different semantic granularities, and the segmented data corresponding to the same semantic granularity are stored in the same data set to obtain data sets corresponding to different semantic granularities; wherein different semantic granularities can represent semantic units at different levels such as entity level, word level, sentence level, etc.; wherein the M3E model has been fine-tuned for the application scenario of invoice information processing.

[0134] The segmented data in each data set is then subjected to feature extraction and converted into feature vectors to obtain data sets represented in the form of vector matrices.

[0135] Finally, each data set represented in the form of a vector matrix is ​​written in parallel into a vector database, such as PgSQL (open source object-relational database system, PostgreSQL).

[0136] On the other hand, in the scenario of querying invoice information, first, the user inputs the query information through the terminal, and the terminal sends the query information to the server.

[0137] Secondly, after receiving the query information, the server inputs the query information into the M3E model, extracts features from the query information and converts it into an Embedding vector.

[0138] Furthermore, by calculating the cosine similarity, in the vector database, the similarity between the query information and the data in the data set is calculated in parallel, that is, in the vector dimension, the similarity between the query information in the form of feature vectors and the data in the form of feature vectors in the database is calculated in parallel.

[0139] Furthermore, the data in the form of feature vectors in the database are sorted according to the similarity from high to low, and the first N data are selected as the result A; wherein N can be represented by N=100 or N=1000.

[0140] By using the Reranker sorting method, the data in result A is re-sorted according to the similarity from high to low, and the first M data are selected as result B; wherein the value range of M can represent M≤5.

[0141] Finally, the query information and result B are input into a large language model (LLM) for processing to obtain answer information, which is then returned from the server to the terminal.

[0142] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0143] Based on the same inventive concept, the embodiment of the present application also provides an invoice information query device for implementing the invoice information query method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of one or more invoice information query devices provided below can refer to the limitations of the invoice information query method above, and will not be repeated here.

[0144] In an exemplary embodiment, Figure 3 As shown, a device for querying invoice information is provided, including: an acquisition module 302, a matching module 304 and a model processing module 306, wherein:

[0145] An acquisition module 302 is used to acquire a query request corresponding to the target invoice information, perform feature extraction on the query request, and obtain query feature information corresponding to the query request;

[0146] The matching module 304 is used to match the query feature information with the feature information of each data set in the database, and obtain the target feature information corresponding to the query feature information; wherein the feature information is obtained by pre-segmenting and feature extracting the invoice information according to different semantic granularities, and the feature information corresponding to the same semantic granularity is stored in the same data set;

[0147] The model processing module 306 is used to input the target feature information and the query request into the language model for processing to obtain the answer information corresponding to the target invoice information.

[0148] In an exemplary embodiment, the matching module 304 is also used to: obtain the similarity between the query feature information and each feature information respectively, sort each feature information according to the similarity, and obtain multiple first feature information in a first preset order; according to a preset evaluation index, obtain the similarity evaluation results between the query feature information and each first feature information respectively, sort each first feature information according to the similarity evaluation results, and obtain second feature information in a second preset order, and use the second feature information as the target feature information corresponding to the query feature information.

[0149] In an exemplary embodiment, the device also includes a storage module, which is used to: obtain invoice information, identify the seller identification and buyer identification corresponding to the invoice information in the invoice information; obtain the first enterprise information corresponding to the seller identification and the second enterprise information corresponding to the buyer identification in the enterprise information platform through the communication interface corresponding to the enterprise information platform; segment and extract features from the invoice information, the first enterprise information and the second enterprise information according to different semantic granularities to obtain feature information, and store the feature information of the same semantic granularity in the same data set.

[0150] In an exemplary embodiment, the storage module is also used to: segment the invoice information, the first enterprise information and the second enterprise information according to semantic units of different levels to obtain segmented data, and store the segmented data corresponding to the semantic units of the same level in the same data set; the levels of semantic units include document level, paragraph level, line level, word level and character level; perform feature extraction on the segmented data of each data set to obtain feature information, and fuse the feature information of the same data set to obtain each data set represented in the form of a vector matrix.

[0151] In an exemplary embodiment, the storage module is also used to: generate data processing tasks corresponding to each semantic granularity according to different semantic granularities, where the data processing tasks are tasks of sequentially performing data segmentation, feature extraction, and writing to a database; determine the task execution status corresponding to each data processing task according to the current operating environment, so that each data processing task can be executed in parallel according to the corresponding task execution status.

[0152] In an exemplary embodiment, the matching module 304 is also used to: generate data matching tasks corresponding to each data set according to different data sets, and the data matching task is a task of matching query feature information with feature information of the data set; determine the task execution status corresponding to each data matching task according to the current operating environment, so that each data matching task is executed in parallel according to the corresponding task execution status.

[0153] Each module in the above-mentioned invoice information query device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0154] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 4 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data for processing invoice information. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for querying invoice information is implemented.

[0155] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 5As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a method for querying invoice information is realized. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0156] Those skilled in the art will understand that Figure 4 or Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0157] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0158] Obtaining a query request corresponding to the target invoice information, performing feature extraction on the query request, and obtaining query feature information corresponding to the query request;

[0159] Match the query feature information with the feature information of each data set in the database respectively to obtain the target feature information corresponding to the query feature information; wherein the feature information is obtained by pre-segmenting and feature extracting the invoice information according to different semantic granularities, and the feature information corresponding to the same semantic granularity is stored in the same data set;

[0160] The target feature information and query request are input into the language model for processing to obtain the answer information corresponding to the target invoice information.

[0161] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining the similarity between the query feature information and each feature information respectively, sorting each feature information according to the similarity, and obtaining multiple first feature information in a first preset order; according to a preset evaluation index, obtaining the similarity evaluation results between the query feature information and each first feature information respectively, sorting each first feature information according to the similarity evaluation results, and obtaining second feature information in a second preset order, and using the second feature information as the target feature information corresponding to the query feature information.

[0162] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining invoice information, identifying the seller identification and the buyer identification corresponding to the invoice information in the invoice information; obtaining the first enterprise information corresponding to the seller identification and the second enterprise information corresponding to the buyer identification in the enterprise information platform through the communication interface corresponding to the enterprise information platform; segmenting and extracting features from the invoice information, the first enterprise information and the second enterprise information according to different semantic granularities to obtain feature information, and storing the feature information of the same semantic granularity in the same data set.

[0163] In one embodiment, when the processor executes the computer program, the following steps are also implemented: the invoice information, the first enterprise information and the second enterprise information are segmented according to semantic units of different levels to obtain segmented data, and the segmented data corresponding to the semantic units of the same level are stored in the same data set; the levels of the semantic units include document level, paragraph level, line level, word level and character level; the segmented data of each data set are feature extracted to obtain feature information, and the feature information of the same data set is fused to obtain each data set represented in the form of a vector matrix.

[0164] In one embodiment, when the processor executes the computer program, the following steps are also implemented: according to different semantic granularities, data processing tasks corresponding to each semantic granularity are generated, and the data processing tasks are tasks that sequentially perform data segmentation processing, feature extraction processing, and data writing processing; according to the current operating environment, the task execution status corresponding to each data processing task is determined, so that each data processing task is executed in parallel according to the corresponding task execution status.

[0165] In one embodiment, when the processor executes the computer program, the following steps are also implemented: based on different data sets, data matching tasks corresponding to each data set are generated, and the data matching tasks are tasks for matching query feature information with feature information of the data set; based on the current operating environment, the task execution status corresponding to each data matching task is determined, so that each data matching task is executed in parallel according to the corresponding task execution status.

[0166] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0167] Obtaining a query request corresponding to the target invoice information, performing feature extraction on the query request, and obtaining query feature information corresponding to the query request;

[0168] Match the query feature information with the feature information of each data set in the database respectively to obtain the target feature information corresponding to the query feature information; wherein the feature information is obtained by pre-segmenting and feature extracting the invoice information according to different semantic granularities, and the feature information corresponding to the same semantic granularity is stored in the same data set;

[0169] The target feature information and query request are input into the language model for processing to obtain the answer information corresponding to the target invoice information.

[0170] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining the similarity between the query feature information and each feature information respectively, sorting each feature information according to the similarity, and obtaining multiple first feature information in a first preset order; according to a preset evaluation index, obtaining the similarity evaluation results between the query feature information and each first feature information respectively, sorting each first feature information according to the similarity evaluation results, and obtaining second feature information in a second preset order, and using the second feature information as the target feature information corresponding to the query feature information.

[0171] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining invoice information, identifying the seller identification and the buyer identification corresponding to the invoice information in the invoice information; obtaining the first enterprise information corresponding to the seller identification and the second enterprise information corresponding to the buyer identification in the enterprise information platform through the communication interface corresponding to the enterprise information platform; segmenting and extracting features from the invoice information, the first enterprise information and the second enterprise information according to different semantic granularities to obtain feature information, and storing the feature information of the same semantic granularity in the same data set.

[0172] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the invoice information, the first enterprise information and the second enterprise information are segmented according to semantic units of different levels to obtain segmented data, and the segmented data corresponding to the semantic units of the same level are stored in the same data set; the levels of semantic units include document level, paragraph level, line level, word level and character level; feature extraction is performed on the segmented data of each data set to obtain feature information, and the feature information of the same data set is fused to obtain each data set represented in the form of a vector matrix.

[0173] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: according to different semantic granularities, data processing tasks corresponding to each semantic granularity are generated, and the data processing tasks are tasks that perform data segmentation processing, feature extraction processing, and database writing processing in sequence; according to the current operating environment, the task execution status corresponding to each data processing task is determined, so that each data processing task is executed in parallel according to the corresponding task execution status.

[0174] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on different data sets, data matching tasks corresponding to each data set are generated, and the data matching tasks are tasks for matching query feature information with feature information of the data set; based on the current operating environment, the task execution status corresponding to each data matching task is determined, so that each data matching task is executed in parallel according to the corresponding task execution status.

[0175] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0176] Obtaining a query request corresponding to the target invoice information, performing feature extraction on the query request, and obtaining query feature information corresponding to the query request;

[0177] Match the query feature information with the feature information of each data set in the database respectively to obtain the target feature information corresponding to the query feature information; wherein the feature information is obtained by pre-segmenting and feature extracting the invoice information according to different semantic granularities, and the feature information corresponding to the same semantic granularity is stored in the same data set;

[0178] The target feature information and query request are input into the language model for processing to obtain the answer information corresponding to the target invoice information.

[0179] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining the similarity between the query feature information and each feature information respectively, sorting each feature information according to the similarity, and obtaining multiple first feature information in a first preset order; according to a preset evaluation index, obtaining the similarity evaluation results between the query feature information and each first feature information respectively, sorting each first feature information according to the similarity evaluation results, and obtaining second feature information in a second preset order, and using the second feature information as the target feature information corresponding to the query feature information.

[0180] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining invoice information, identifying the seller identification and the buyer identification corresponding to the invoice information in the invoice information; obtaining the first enterprise information corresponding to the seller identification and the second enterprise information corresponding to the buyer identification in the enterprise information platform through the communication interface corresponding to the enterprise information platform; segmenting and extracting features from the invoice information, the first enterprise information and the second enterprise information according to different semantic granularities to obtain feature information, and storing the feature information of the same semantic granularity in the same data set.

[0181] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the invoice information, the first enterprise information and the second enterprise information are segmented according to semantic units of different levels to obtain segmented data, and the segmented data corresponding to the semantic units of the same level are stored in the same data set; the levels of semantic units include document level, paragraph level, line level, word level and character level; feature extraction is performed on the segmented data of each data set to obtain feature information, and the feature information of the same data set is fused to obtain each data set represented in the form of a vector matrix.

[0182] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: according to different semantic granularities, data processing tasks corresponding to each semantic granularity are generated, and the data processing tasks are tasks that perform data segmentation processing, feature extraction processing, and database writing processing in sequence; according to the current operating environment, the task execution status corresponding to each data processing task is determined, so that each data processing task is executed in parallel according to the corresponding task execution status.

[0183] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on different data sets, data matching tasks corresponding to each data set are generated, and the data matching tasks are tasks for matching query feature information with feature information of the data set; based on the current operating environment, the task execution status corresponding to each data matching task is determined, so that each data matching task is executed in parallel according to the corresponding task execution status.

[0184] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0185] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0186] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0187] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for querying invoice information, characterized in that: The method comprises: Obtaining a query request corresponding to the target invoice information, performing feature extraction on the query request, and obtaining query feature information corresponding to the query request; Matching the query feature information with the feature information of each data set in the database respectively to obtain target feature information corresponding to the query feature information; wherein the feature information is obtained by pre-segmenting and feature extracting the invoice information according to different semantic granularities, and the feature information corresponding to the same semantic granularity is stored in the same data set; The target feature information and the query request are input into a language model for processing to obtain answer information corresponding to the target invoice information.

2. The method according to claim 1, characterized in that The step of matching the query feature information with the feature information of each data set in the database to obtain target feature information corresponding to the query feature information includes: Obtaining similarities between the query feature information and each feature information, and sorting each feature information according to the similarities to obtain a plurality of first feature information in a first preset order; According to a preset evaluation index, similarity evaluation results between the query feature information and each first feature information are obtained, and each first feature information is sorted according to the similarity evaluation result to obtain second feature information in a second preset order, and the second feature information is used as the target feature information corresponding to the query feature information.

3. The method according to claim 1, characterized in that Before obtaining the query request corresponding to the target invoice information, the method further includes: Acquire invoice information, and identify the seller identifier and the buyer identifier corresponding to the invoice information in the invoice information; Acquire, through a communication interface corresponding to the enterprise information platform, first enterprise information corresponding to the seller identifier and second enterprise information corresponding to the buyer identifier in the enterprise information platform; The invoice information, the first enterprise information and the second enterprise information are segmented and feature extracted according to different semantic granularities to obtain feature information, and the feature information of the same semantic granularity is stored in the same data set.

4. The method according to claim 3, characterized in that The segmenting and feature extraction of the invoice information, the first enterprise information, and the second enterprise information according to different semantic granularities to obtain feature information, and storing the feature information of the same semantic granularity in the same data set includes: Segmenting the invoice information, the first enterprise information and the second enterprise information according to semantic units of different levels to obtain segmented data, and storing the segmented data corresponding to semantic units of the same level in the same data set; the levels of the semantic units include document level, paragraph level, line level, word level and character level; Feature extraction is performed on the segmented data of each data set to obtain feature information, and the feature information of the same data set is fused to obtain data sets represented in the form of vector matrices.

5. The method according to claim 3, characterized in that: The segmenting and feature extraction of the invoice information, the first enterprise information, and the second enterprise information according to different semantic granularities to obtain feature information, and storing the feature information of the same semantic granularity in the same data set includes: According to different semantic granularities, data processing tasks corresponding to each semantic granularity are generated, wherein the data processing tasks are tasks for sequentially performing data segmentation processing, feature extraction processing, and writing into a database processing; According to the current operating environment, the task execution states corresponding to the respective data processing tasks are determined, so that the respective data processing tasks are executed in parallel according to the corresponding task execution states.

6. The method according to claim 1, characterized in that The step of matching the query feature information with the feature information of each data set in the database to obtain target feature information corresponding to the query feature information includes: According to different data sets, data matching tasks corresponding to the data sets are generated, wherein the data matching tasks are tasks for matching the query feature information with the feature information of the data sets; According to the current operating environment, the task execution states corresponding to the respective data matching tasks are determined, so that the respective data matching tasks are executed in parallel according to the corresponding task execution states.

7. A device for querying invoice information, characterized in that: The device comprises: An acquisition module, used to acquire a query request corresponding to the target invoice information, perform feature extraction on the query request, and obtain query feature information corresponding to the query request; A matching module, used to match the query feature information with the feature information of each data set in the database, respectively, to obtain target feature information corresponding to the query feature information; wherein the feature information is obtained by pre-segmenting and feature extracting the invoice information according to different semantic granularities, and the feature information corresponding to the same semantic granularity is stored in the same data set; The model processing module is used to input the target feature information and the query request into the language model for processing to obtain the answer information corresponding to the target invoice information.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Model training method and device, computer equipment and storage medium

    CN117033720A

  • Intention recognition method and device, storage medium and electronic equipment

    CN117725209A

  • Bidding document evaluation method and device, electronic equipment, storage medium and product

    CN118503351A

  • Model training method and apparatus, computer device, and storage medium

    US20240256601A1