Invoice generation method and device, computer device, and storage medium

CN117669528BActive Publication Date: 2026-08-11KINGDEE SOFTWARE(CHINA) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311780078.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-21
Publication Date
2026-08-11
Estimated Expiration
2043-12-21

AI Technical Summary

Technical Problem

然而,单据中通常包含多个字段或多行单据数据,采用传统技术进行数据录入的方法操作繁琐、耗时较长,导致单据生成的效率较低

Benefits of technology

[0016] The aforementioned document generation method, apparatus, computer equipment, storage medium, and computer program product, by determining multiple document fields for data to be entered in the initial document, responds to data entry requests sent by the terminal, obtains interface entry data obtained through the document entry interface of the terminal, and determines the entry field values ​​corresponding to each document field from the interface entry data based on the attribute mapping relationship corresponding to multiple document fields. This allows operators to perform simple scanning and entry operations when using the terminal for data entry, without having to manually select document fields one by one. The system automatically assigns values ​​to each document field, and confirmation can be submitted. Thus, in response to the entry confirmation request sent by the terminal, the target document is automatically generated based on the initial document and the entry field values ​​corresponding to each document field, thereby improving the efficiency of document generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117669528B_ABST
    Figure CN117669528B_ABST
Patent Text Reader

Abstract

This application relates to a document generation method, apparatus, computer device, and storage medium. The method includes: determining an initial document under a target business, and determining multiple document fields in the initial document for which data to be entered; responding to a data entry request sent by a terminal, acquiring interface entry data obtained through the document entry interface of the terminal; determining the entry field values ​​corresponding to each document field from the interface entry data based on the attribute mapping relationship corresponding to the multiple document fields; and responding to an entry confirmation request sent by the terminal, generating a target document based on the initial document and the entry field values ​​corresponding to each document field. This method can improve the efficiency of document generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a document generation method, apparatus, computer equipment, storage medium, and computer program product. Background Technology

[0002] With the widespread use of mobile devices, technologies have emerged that allow data entry via mobile devices, thereby generating documents based on the entered data. For example, warehouse and workshop workers can use mobile devices to scan barcodes to enter data.

[0003] Traditionally, data entry involves manually selecting each field on a document and then entering the data. However, documents typically contain multiple fields or rows of data, making traditional data entry methods cumbersome and time-consuming, resulting in low document generation efficiency. Summary of the Invention

[0004] Therefore, it is necessary to provide a document generation method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve document generation efficiency in response to the above-mentioned technical problems.

[0005] In a first aspect, this application provides a document generation method. The method includes: determining an initial document under a target business, and determining multiple document fields in the initial document for which data to be entered; responding to a data entry request sent by a terminal, obtaining interface entry data obtained through the document entry interface of the terminal; determining the entry field value corresponding to each of the document fields from the interface entry data based on the attribute mapping relationship corresponding to the multiple document fields; and responding to an entry confirmation request sent by the terminal, generating a target document based on the initial document and the entry field values ​​corresponding to each of the document fields.

[0006] Secondly, this application also provides a document generation device. The device includes: an initial document determination module, configured to determine an initial document under a target business and determine multiple document fields in the initial document for which data to be entered; an input data acquisition module, configured to acquire interface input data obtained through the document input interface of the terminal in response to a data input request sent by the terminal; a data matching module, configured to determine the input field value corresponding to each of the document fields from the interface input data based on the attribute mapping relationship corresponding to the multiple document fields; and a document generation module, configured to generate a target document based on the initial document and the input field values ​​corresponding to each of the document fields in response to an input confirmation request sent by the terminal.

[0007] In some embodiments, the plurality of document fields include at least one matching field; the initial document includes at least one row of initial document data; the document generation module is further configured to: determine matching document data from the initial document that matches the interface input data based on the input field value corresponding to each of the matching fields; the initial field value corresponding to the matching field in the matching document data is consistent with the input field value; update the initial field value corresponding to each of the document fields in the matching document data according to the input field value corresponding to each of the document fields, and generate the target document.

[0008] In some embodiments, the matching document data consists of multiple rows; the plurality of document fields includes a control quantity field; the document generation module is further configured to: split the input quantity corresponding to the control quantity field according to the initial quantity corresponding to the control quantity field in each of the matching document data, to obtain the matching quantity corresponding to each of the matching document data; determine the document fields other than the control quantity field and the matching field among the plurality of document fields as target fields; and update the matching document data for each of the matching document data using the matching quantity corresponding to the matching document data and the input field value corresponding to each of the target fields, to generate the target document.

[0009] In some embodiments, after determining the initial document under the target business, the document generation device further includes a document copying module, which is used to: copy the initial document to obtain a baseline document; the document generation module is also used to: for each matching document data, obtain copied document data corresponding to the matching document data from the baseline document; update the copied document data using the matching quantity corresponding to the matching document data and the input field value corresponding to each target field to obtain target document data; and generate the target document based on the target document data.

[0010] In some embodiments, the data entry module is further configured to: determine the attribute mapping relationship corresponding to the plurality of document fields according to the document type of the initial document; determine the attribute identifier corresponding to each document field from the attribute mapping relationship; and for each document field, search for the attribute value of the attribute identifier corresponding to the document field in the interface data entry to obtain the entry field value corresponding to the document field.

[0011] In some embodiments, the initial document determination module is further configured to: obtain at least one business document selected through the document display interface shown on the terminal; determine the document conversion rule corresponding to each business document; and perform document conversion on each business document according to the document conversion rule to generate the initial document.

[0012] In some embodiments, the document conversion rules include document type mapping relationships and field mapping relationships; the initial document determination module is further configured to: determine a target document type associated with the document type of the business document according to the document type mapping relationship; obtain a document template corresponding to the target document type; determine the initial field value corresponding to each template field in the document template according to the field mapping relationship and the field values ​​of each business document field in the business document, and generate the initial document.

[0013] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps in the above-described document generation method.

[0014] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps in the above-described document generation method.

[0015] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps in the above-described document generation method.

[0016] The aforementioned document generation method, apparatus, computer equipment, storage medium, and computer program product, by determining multiple document fields for data to be entered in the initial document, responds to data entry requests sent by the terminal, obtains interface entry data obtained through the document entry interface of the terminal, and determines the entry field values ​​corresponding to each document field from the interface entry data based on the attribute mapping relationship corresponding to multiple document fields. This allows operators to perform simple scanning and entry operations when using the terminal for data entry, without having to manually select document fields one by one. The system automatically assigns values ​​to each document field, and confirmation can be submitted. Thus, in response to the entry confirmation request sent by the terminal, the target document is automatically generated based on the initial document and the entry field values ​​corresponding to each document field, thereby improving the efficiency of document generation. Attached Figure Description

[0017] Figure 1 This is an application environment diagram of a document generation method in one embodiment;

[0018] Figure 2 This is a flowchart illustrating a document generation method in one embodiment;

[0019] Figure 3 A schematic diagram illustrating the process of automatically assigning values ​​to fields in one embodiment;

[0020] Figure 4This is a schematic diagram illustrating the process of establishing attribute mapping relationships in one embodiment.

[0021] Figure 5 This is a schematic diagram illustrating the process of determining matching document data in one embodiment;

[0022] Figure 6 This is a schematic diagram illustrating the process of generating target document data in one embodiment.

[0023] Figure 7 This is a schematic diagram of the overall process of data entry and document generation in one embodiment;

[0024] Figure 8 This is a structural block diagram of a document generation device in one embodiment;

[0025] Figure 9 This is an internal structural diagram of a computer device in one embodiment;

[0026] Figure 10 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0028] The document generation method provided in this application embodiment can be applied to, for example, Figure 1 The application environment shown includes a terminal 102 and a server 104. The terminal 102 can be a handheld smart terminal used by warehouse or workshop staff; the server 104 can be a company's backend server. The terminal 102 communicates with the server 104 via a network. A data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104 or placed on the cloud or other network servers.

[0029] The terminal 102 can be, but is not limited to, various industrial PDAs (Personal Digital Assistants), smartphones, and tablets. Industrial PDAs are mainly used in industrial fields, such as logistics and express delivery, manufacturing, and retail. The server 104 can be implemented using a standalone server or a server cluster composed of multiple servers.

[0030] Those skilled in the art will understand that Figure 1 The application environments shown are only some scenarios related to the solution of this application and do not constitute a limitation on the application environment of the solution of this application.

[0031] In some embodiments, such as Figure 2 As shown, a document generation method is provided. This method can be executed by a terminal or a server, or by both a terminal and a server. This method can be applied to… Figure 1 Taking server 104 as an example, the following steps are included:

[0032] Step 202: Determine the initial document under the target business and identify multiple document fields in the initial document for which data to be entered.

[0033] In a company's business processes, upstream and downstream operations are typically included. For example, in the business process of purchase ordering, purchase receipt, and purchase warehousing, purchase ordering is the upstream operation of purchase receipt, and purchase warehousing is the downstream operation. Different business processes use different business documents; therefore, there are usually upstream and downstream relationships between these documents, including upstream and downstream documents. Upstream documents can also be called source documents, and downstream documents can be called target documents. For example, a purchase order is the upstream document (source document) of a purchase receipt, and a purchase receipt is the downstream document (target document) of a purchase order. It can be understood that a target business refers to a downstream business of a certain business. Therefore, the initial document is a business document under the target business that has data gaps. The initial document includes multiple document fields with data to be entered. These fields may have empty values ​​or values ​​to be updated. The initial document can also be called the initial target document.

[0034] Specifically, the terminal enters the document display interface, which displays multiple business document identifiers under the upstream business corresponding to the target business. In response to a selection operation for at least one business document identifier, the terminal sends an initial document generation request carrying each business document identifier to the server. The server receives the initial document generation request, obtains the business documents corresponding to each business document identifier and the document conversion rules, performs document conversion according to the document conversion rules, generates the initial document under the target business, and caches the initial document for later use. For example, the document display interface displays identifiers for multiple purchase orders, and the server generates the corresponding initial purchase receipt based on the selected purchase order. The document conversion rules are pre-set; the process of using these rules to convert upstream documents can also be called document pushdown.

[0035] In some embodiments, the server stores the terminal's interface model configuration. Based on the interface model configuration, multiple document fields for data to be entered in the initial document can be determined, and the initial document and the field identifiers corresponding to each document field are returned to the terminal. The terminal receives the initial document and each document field, enters the document entry interface, and displays the field identifiers corresponding to each document field in the document entry interface. The interface model configuration defines the source document, target document, document conversion rules, and target document entry configuration corresponding to the target business. For example, Table 1 below shows the document header configuration table of the interface model configuration:

[0036] Table 1. Document Header Configuration Table for Interface Model Configuration

[0037]

[0038] Table 2 below shows the configuration table for target form entry. The document fields with a value of 1 in the "Visible" field are the document fields for which data is to be entered.

[0039] Table 2 Configuration table for target form entry

[0040]

[0041] In some embodiments, when it is necessary to update or verify the generated downstream documents, the terminal can also display multiple downstream document identifiers under the target business through the document display interface, respond to the selection operation for any downstream document identifier among the multiple documents, and send an initial document retrieval request carrying the downstream document identifier to the server. The server receives the initial document retrieval request and retrieves the downstream document corresponding to the selected downstream document identifier as the initial document.

[0042] Step 204: In response to the data entry request sent by the terminal, obtain the interface entry data obtained through the document entry interface of the terminal.

[0043] The document entry interface is the terminal's user interface for entering data into initial documents. The interface displays field identifiers for multiple document fields corresponding to the data to be entered, while the field values ​​for each field are empty. The document entry interface also displays a barcode scanning button; data is entered through the document entry interface, for example, by scanning a barcode. The data entered through the interface includes multiple attribute identifiers and their corresponding attribute values. For example, the data entered through the interface might include the following:

[0044] "alias":"Inventory Organization",

[0045] "fieldType":"BaseDataType",

[0046] "key":"entryinvorg",

[0047] "purpose":"c",

[0048] "value":{

[0049] "id":"d100000",

[0050] "name":"xx organization"};

[0051] The attribute identifier is "Inventory Organization". The attribute values ​​corresponding to "Inventory Organization" include "id":"d100000" and "name":"xx organization".

[0052] Specifically, in response to a data entry operation triggered by the barcode scanning button on the document entry interface, the terminal activates the barcode scanning function, acquires a barcode image captured by the camera, and sends a barcode recognition request carrying the barcode image to the server. The server receives the barcode recognition request from the terminal, identifies and parses the barcode or QR code in the barcode image, and obtains the data entered on the interface.

[0053] Step 206: Based on the attribute mapping relationship between multiple document fields, determine the input field value corresponding to each document field from the data entered in the interface.

[0054] Among them, the attribute mapping relationship is the pre-set mapping relationship between the field identifier and the attribute identifier of the document field, that is, the mapping relationship between the form and the attribute.

[0055] Specifically, the server determines the attribute mapping relationship corresponding to each document field, determines the attribute identifier corresponding to each document field from the attribute mapping relationship, and for each document field, searches for the attribute value of the attribute identifier corresponding to the document field in the data entered on the interface to obtain the entry field value corresponding to the document field.

[0056] In some embodiments, the server can return the entered values ​​corresponding to each document field to the terminal, where the terminal's interface controls automatically fill in the field values ​​displayed in the document entry interface. For example, as Figure 3 The diagram illustrates the process of automatic field assignment. By scanning a barcode or inputting data through the terminal's document entry interface, the server parses the scanned result and obtains the attribute mapping relationship. Then, the server determines the corresponding field value for each document field based on the attribute mapping relationship and returns the general and personalized parsing results to the terminal. The terminal then assigns values ​​according to the field identifiers on the document entry interface based on the general and personalized parsing results, thus displaying the field identifiers and entered field values ​​for each document field on the document entry interface.

[0057] In some embodiments, the process of establishing attribute mapping relationships is as follows: Figure 4 As shown, the process begins with defining the data entry rules, including the rule type, effective date, and expiration date. Next, the data entry attributes are defined, including the attribute name, attribute type, and separator. The attribute name is the attribute identifier, and the attribute type includes at least one of text, number, basic data, or auxiliary attributes. Finally, the attribute mapping relationship is defined, including the attribute name, form identifier, and form field. The form identifier is the document identifier, and the form field is the field identifier of the document field. This establishes a relationship table between attribute identifiers and document fields, thus obtaining the attribute mapping relationship.

[0058] Step 208: In response to the input confirmation request sent by the terminal, generate the target document based on the initial document and the input field values ​​corresponding to each document field.

[0059] Among them, the target document is the downstream document under the target business generated based on the data entered this time.

[0060] Specifically, in response to the data entry confirmation operation triggered by the document entry interface, the terminal sends a data entry confirmation request to the server. The server, responding to this request and assuming the initial document contains only one row of initial document data, updates the initial document data based on the corresponding entry field values ​​for each document field, generating the target document. Here, the initial document data refers to one row of data in the initial document, which can be understood as a row in a table, also known as a document entry row, used to store detailed business data. A business document typically contains multiple rows of document data; for example, a purchase order includes information such as multiple materials, quantities, and units of measurement for this purchase.

[0061] In some embodiments, when the initial document includes multiple rows of initial document data, the server first needs to determine at least one matching document data that matches the data entered on the interface from the multiple rows of initial document data. Then, it splits the entry quantity corresponding to the control quantity field in each document field, updates each matching document data based on the splitting result and the entry field value corresponding to each document field, and generates the target document.

[0062] In the above document generation method, by determining multiple document fields for data to be entered in the initial document, and responding to the data entry request sent by the terminal, the system obtains the interface entry data obtained through the document entry interface of the terminal. Based on the attribute mapping relationship corresponding to multiple document fields, the system determines the entry field value corresponding to each document field from the interface entry data. This allows operators to perform simple scanning and entry operations when using the terminal for data entry, without having to manually select document fields one by one. The system automatically assigns values ​​to each document field and submits for confirmation, thereby responding to the entry confirmation request sent by the terminal. Based on the initial document and the entry field values ​​corresponding to each document field, the system automatically generates the target document, improving the efficiency of document generation.

[0063] In some embodiments, the plurality of document fields include at least one matching field; before generating the target document based on the initial document and the field values ​​corresponding to each document field in response to the input confirmation request sent by the terminal, the document generation method further includes: for each matching field, determining the initial field value corresponding to the matching field from the initial document; if the initial field value corresponding to the matching field is inconsistent with the input field value corresponding to the matching field, determining that the interface input data is invalid.

[0064] Among them, the matching field is a field used to match and validate the data entered in the interface. It is pre-set through the interface model configuration. For example, if the initial document type is an inventory document, the matching field can be the three document fields: supplier, material type, and auxiliary attribute.

[0065] Specifically, for each matching field, the server can determine the initial field value corresponding to the matching field from the initial document, and determine the corresponding entry field value from the entry field values ​​corresponding to each document field. If the initial field value and the entry field value of the matching field match, the server determines that the data entered through the interface is valid, the matching verification passes, and other steps of document generation can continue. If the initial field value and the entry field value of the matching field do not match, the server determines that the data entered through the interface is invalid, generates an invalid message, and returns the invalid message to the terminal. This process can be understood as a preliminary matching verification of the data entered through the interface.

[0066] In some embodiments, when the initial document includes multiple rows of initial document data, the server can perform a matching verification for each row of initial document data according to the above preliminary matching verification steps. If the initial field value corresponding to the matching field in each row of initial document data is inconsistent with the input field value corresponding to the matching field, the server determines that the data entered on the interface is invalid.

[0067] In this embodiment, by pre-setting matching fields, the legality of data entered on the interface is automatically verified based on the initial document, thereby reducing the occurrence of data errors and improving the accuracy of document generation.

[0068] In some embodiments, multiple document fields include at least one matching field; the initial document includes at least one row of initial document data; in response to an entry confirmation operation triggered by the document entry interface, a target document is generated based on the initial document and the entry field values ​​corresponding to each document field, including: determining matching document data from the initial document that matches the data entered on the interface based on the entry field values ​​corresponding to each matching field; the initial field value corresponding to the matching field in the matching document data is consistent with the entry field value; updating the initial field value corresponding to each document field in the matching document data according to the entry field value corresponding to each document field, and generating the target document.

[0069] Specifically, when the initial document includes multiple rows of initial document data, the matching field can also be used to determine matching document data that matches the data entered through the interface. The entry confirmation request carries the initial document and the corresponding entry field values ​​for each document field. In response to the entry confirmation request sent by the terminal, the server can determine at least one row of matching document data from the initial document data that matches the data entered through the interface, based on the entry field values ​​corresponding to each matching field. Then, using the entry field values ​​corresponding to other document fields besides the matching field, the server updates the matching document data and generates the target document.

[0070] For example, such as Figure 5 The diagram illustrates the process of determining matching document data. The initial document, i.e. the initial target document, contains 3 entry rows. The corresponding field values ​​for each document field are the entry values ​​in the target document. The entry value for matching field 1 is "A", and the entry value for matching field 2 is "001". Therefore, entry 1 and entry 2 in the initial target document can be identified as matching document data.

[0071] In this embodiment, by utilizing the matching field, matching document data that matches the data entered on the interface can be automatically determined from the initial document. This achieves automatic matching of document entry lines, eliminating the need for manual selection by operators and improving the efficiency of document generation.

[0072] In some embodiments, the matching document data consists of multiple rows; the multiple document fields include a control quantity field; based on the input field values ​​corresponding to each document field, the initial field values ​​corresponding to each document field in the matching document data are updated to generate a target document, including: splitting the input quantity corresponding to the control quantity field according to the initial quantity corresponding to the control quantity field in each matching document data to obtain the matching quantity corresponding to each matching document data; determining the document fields other than the control quantity field and the matching field among the multiple document fields as target fields; for each matching document data, updating the matching document data using the matching quantity corresponding to the matching document data and the input field values ​​corresponding to each target field to generate a target document.

[0073] Among them, the control quantity field is a field used for quantity allocation among multiple document fields.

[0074] Specifically, when the number of entries corresponding to the control quantity field is greater than the initial number of the control quantity field in any matching document data, the server splits the number of entries corresponding to the control quantity field according to the initial number of the control quantity field in each matching document data, thus obtaining the matching quantity for each matching document data. For example, assuming the initial number of the control quantity field in matching document data 1 and matching document data 2 is 30 and 40 respectively, and the number of entries corresponding to the control quantity field is 70, then 70 can be split into 30 and 40. Then, for each matching document data, the server updates the matching document data using the matching quantity corresponding to the matching document data and the entry field value corresponding to each target field, generating the target document.

[0075] In some embodiments, if the number of entries corresponding to the control quantity field is greater than the sum of the initial numbers corresponding to the control quantity field in each matching document data, the server can perform tail insertion processing on the number of entries corresponding to the control quantity field according to a preset tailings processing scheme to achieve reasonable allocation of the number. For example, if the initial numbers of the control quantity field in matching document data 1 and matching document data 2 are 30 and 40 respectively, and the number of entries corresponding to the control quantity field is 78, then 78 can be split into 30, 40, and 8. The number 8 can be allocated to matching document data 2, so the matching numbers corresponding to matching document data 1 and matching document data 2 are 30 and 48 respectively; or the number 8 can be evenly distributed to matching document data 1 and matching document data 2, so the matching numbers corresponding to matching document data 1 and matching document data 2 are 34 and 44 respectively.

[0076] In this embodiment, by controlling the quantity field to split the entered quantity, the system automatically and reasonably divides the data entered in one session into multiple document entry lines, thereby improving the efficiency of document generation. Furthermore, since the entered quantity is split based on the initial quantity, the initial quantity is not directly overwritten by the entered quantity, thus improving the accuracy of document generation.

[0077] In some embodiments, after determining the initial document under the target business, the document generation method further includes: copying the initial document to obtain a baseline document; for each matching document data, updating the matching document data using the matching quantity corresponding to the matching document data and the input field value corresponding to each document field to generate a target document, including: for each matching document data, obtaining the copied document data corresponding to the matching document data from the baseline document; updating the copied document data using the matching quantity corresponding to the matching document data and the input field value corresponding to each target field to obtain target document data; and generating a target document based on the target document data.

[0078] The base document is obtained by copying the initial document, and the number of copied document data in the base document is the same as the number of initial document data in the initial document.

[0079] Specifically, the server can copy the initial document and clear the initial quantity corresponding to the control quantity field in the copied document to obtain a baseline document. This baseline document is then cached, meaning the control quantity field value is 0 in each copied document. For each matching document, the server retrieves the corresponding copy document data from the baseline document. Using the matching quantity and the input field values ​​for each target field, the server updates the copy document data, resulting in target document data composed of the field identifiers and target field values ​​for each document field. Finally, the server generates the target document based on the document header of the initial document and the target document data. Each business document consists of a document header and document data. The document header stores common information about the document, such as at least one of the following: document creator, document status, etc.

[0080] For example, such as Figure 6The diagram illustrates the process of generating target document data. First, the server copies the initial target document and clears the control quantity field, obtaining the baseline target document. Then, the server determines the matching document data based on the field values ​​entered for each matching field, i.e., entries 1 and 2 in the initial target document. Based on the initial quantities 30 and 40 in entries 1 and 2, the server splits the entered quantity 70 corresponding to the control quantity field, obtaining the matching quantities for entries 1 and 2 respectively, and generates matching records based on these matching quantities. The server can generate target document data based on the entered field values ​​for each target field, the matching records, and the baseline target document. It can be seen that the field values ​​for fields 1 and 2 in the target document data originate from the matching fields, while the field value for field 3 originates from the entered ordinary field 1, the field value for field 4 originates from the baseline target document, and the field value for field 5 originates from the matching records.

[0081] In some embodiments, after generating the target document data, the server can also perform reverse write verification on the upstream document corresponding to the initial document based on the target document data to ensure the accuracy of the data. After passing the reverse write verification, the server generates the target document based on the target document data, stores the target document in the database, and triggers the automatic reverse write function for the upstream document.

[0082] In this embodiment, the initial document is not updated during the document generation process. Instead, the initial document is copied to obtain a baseline document, and the copied document data corresponding to the matching document data is obtained from the baseline document. The copied document data is then updated to obtain the target document data, thereby generating the target document based on the target document data, which improves data security.

[0083] In some embodiments, based on the attribute mapping relationship corresponding to multiple document fields, the input field value corresponding to each document field is determined from the interface input data, including: determining the attribute mapping relationship corresponding to multiple document fields according to the document type of the initial document; determining the attribute identifier corresponding to each document field from the attribute mapping relationship; and for each document field, searching for the attribute value of the attribute identifier corresponding to the document field in the interface input data to obtain the input field value corresponding to the document field.

[0084] Specifically, different types of business correspond to different document types, and the server stores the attribute mapping relationships corresponding to each document type. The server can determine the attribute mapping relationships corresponding to multiple document fields based on the document type of the initial document, determine the attribute identifiers corresponding to each document field from the attribute mapping relationships based on the field identifiers corresponding to each document field, and then, for each document field, look up the attribute value of the attribute identifier corresponding to the document field in the data entered on the interface to obtain the entry field value corresponding to the document field.

[0085] In this embodiment, the interface input data is automatically parsed through a preset attribute mapping relationship. First, the attribute identifier corresponding to each document field is determined, and then the attribute value of the attribute identifier corresponding to the document field is searched in the interface input data. This quickly determines the input field value corresponding to each document field and improves the efficiency of document generation.

[0086] In some embodiments, determining the initial document under the target business includes: obtaining at least one business document selected in the document display interface displayed on the terminal; determining the document conversion rules corresponding to each business document; and performing document conversion on each business document according to the document conversion rules to generate the initial document.

[0087] A document consists of two parts: a document header and document data. The document header stores common information about the document and also includes the document conversion rule identifier corresponding to that document. The document data refers to the field identifiers corresponding to each document field.

[0088] Specifically, the terminal displays a document display interface, which shows multiple business document identifiers under the upstream business corresponding to the target business. In response to a selection operation for at least one business document identifier, the terminal sends an initial document generation request carrying each business document identifier to the server. The server receives the initial document generation request from the terminal, obtains the business documents corresponding to each business document identifier, retrieves the document conversion rule identifier from the document header of the business documents, uses the document conversion rule identifier to determine the document conversion rule corresponding to each business document, and performs document conversion according to the document conversion rule to generate the initial document.

[0089] In this embodiment, by determining the document conversion rules corresponding to each business document, the document conversion is performed on each business document according to the document conversion rules, and the initial document is automatically generated, providing a matching basis for the matching verification in the document generation process and improving the accuracy of document generation.

[0090] In some embodiments, document conversion rules include document type mapping relationships and field mapping relationships; converting each business document according to the document conversion rules to generate an initial document includes: determining the target document type associated with the document type of the business document based on the document type mapping relationship; obtaining the document template corresponding to the target document type; determining the initial field value corresponding to each template field in the document template based on the field mapping relationship and the field values ​​of each business document field in the business document, and generating the initial document.

[0091] The document type mapping relationship is used to represent the association mapping relationship between different document types. A document template includes multiple template fields, each with an empty value. It can be understood that the initial document is generated based on the document template, and the number of document fields in the initial document to be entered can be less than or equal to the number of template fields in the document template. The field mapping relationship can include the association between template fields and business document fields, as well as the calculation formulas corresponding to the template fields.

[0092] Specifically, the server stores templates corresponding to various document types. Based on the document type mapping relationship, the server determines the target document type associated with the business document's document type. For example, the document type associated with a purchase order is "purchase receipt," and the server retrieves the document template corresponding to the target document type from the database. For each template field in the document template, the server determines the business document field associated with the template field from the business document based on the field mapping relationship. Then, based on the calculation formula corresponding to the template field, the server calculates the initial field value corresponding to the template field for the business document field, thereby generating the initial document field.

[0093] In this embodiment, the document conversion rules include document type mapping relationship and field mapping relationship. By using the document type mapping relationship to determine the target document type and obtain the document template, the initial field value corresponding to each template field in the document template is determined based on the field mapping relationship, and the initial document is quickly generated, realizing the document conversion between different document types.

[0094] In some embodiments, such as Figure 7The diagram illustrates the overall process of data entry and document generation, comprising eight steps: 1. Entry rule definition: defining the attribute mapping relationship between document fields and attribute identifiers; 2. Interface model configuration: defining the source document, target document, document conversion rules, and target document entry configuration for the target business; 3. Entering the task list: the terminal displays the document page, showing the business documents under the upstream business corresponding to the target business in the form of a task list; 4. Selecting one or more source documents, causing the server to push down the selected business documents to generate the initial document, i.e., the initial target document; 5. Entering the document entry interface: inputting the initial target document, caching the initial target document as the matching basis, and copying the initial target document to obtain the baseline target document; 6. Starting. 7. **Entry Confirmation:** Based on the interface model configuration, match the entry rows in the initial target document, allocate quantities according to the control quantity field, record the matching relationship to generate a matching record, then copy the target document's base row, assign values ​​according to the interface entry data, and finally perform tail insertion processing, simulate source document reverse writing, and other operations; 8. **Data Submission:** Before submission, multiple target document data rows can be merged according to business needs. For example, target document data of the same dimension or based on the same initial document data can be merged into one row to generate a target document. Then, the process of saving, submitting, and approving is executed for the target document, and the upstream document, i.e., the source document, is reverse-written according to the reverse writing rules.

[0095] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0096] Based on the same inventive concept, this application also provides a document generation apparatus for implementing the document generation method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more document generation apparatus embodiments provided below can be found in the limitations of the document generation method described above, and will not be repeated here.

[0097] In some embodiments, such as Figure 8As shown, a document generation device is provided, including: an initial document determination module 802, a data entry and acquisition module 804, a data matching module 806, and a document generation module 808, wherein:

[0098] The initial document determination module 802 is used to determine the initial document under the target business and to determine multiple document fields of the data to be entered in the initial document.

[0099] The data entry acquisition module 804 is used to respond to the data entry request sent by the terminal and acquire the interface entry data obtained through the document entry interface of the terminal.

[0100] The data matching module 806 is used to determine the input field value corresponding to each document field from the data entered in the interface based on the attribute mapping relationship corresponding to multiple document fields.

[0101] The document generation module 808 is used to respond to the input confirmation request sent by the terminal and generate the target document based on the initial document and the input field values ​​corresponding to each document field.

[0102] In some embodiments, the plurality of document fields include at least one matching field; after determining the input field value corresponding to each document field from the interface input data based on the attribute mapping relationship corresponding to the plurality of document fields, the document generation device further includes a matching verification module, which is used to: determine the initial field value corresponding to the matching field from the initial document for each matching field; and determine that the interface input data is invalid if the initial field value corresponding to the matching field is inconsistent with the input field value corresponding to the matching field.

[0103] In some embodiments, multiple document fields include at least one matching field; the initial document includes at least one row of initial document data; the document generation module is further configured to: determine matching document data from the initial document that matches the data entered on the interface based on the input field value corresponding to each matching field; the initial field value corresponding to the matching field in the matching document data is consistent with the input field value; update the initial field value corresponding to each document field in the matching document data according to the input field value corresponding to each document field, and generate the target document.

[0104] In some embodiments, the matching document data consists of multiple rows; the multiple document fields include a control quantity field; the document generation module is further configured to: split the input quantity corresponding to the control quantity field according to the initial quantity corresponding to the control quantity field in each matching document data to obtain the matching quantity corresponding to each matching document data; determine the document fields other than the control quantity field and the matching field among the multiple document fields as target fields; and update the matching document data for each matching document data using the matching quantity corresponding to the matching document data and the input field value corresponding to each target field to generate a target document.

[0105] In some embodiments, after determining the initial document under the target business, the document generation device further includes a document copying module, which is used to: copy the initial document to obtain a base document; the document generation module is also used to: for each matching document data, obtain the copied document data corresponding to the matching document data from the base document; update the copied document data using the matching quantity corresponding to the matching document data and the input field value corresponding to each target field to obtain target document data; and generate a target document based on the target document data.

[0106] In some embodiments, the data entry module is further configured to: determine the attribute mapping relationship corresponding to multiple document fields based on the document type of the initial document; determine the attribute identifier corresponding to each document field from the attribute mapping relationship; and for each document field, search for the attribute value of the attribute identifier corresponding to the document field in the data entered on the interface to obtain the entry field value corresponding to the document field.

[0107] In some embodiments, the initial document determination module is further configured to: obtain at least one business document selected in the document display interface displayed on the terminal; determine the document conversion rules corresponding to each business document; and perform document conversion on each business document according to the document conversion rules to generate an initial document.

[0108] In some embodiments, the document conversion rules include document type mapping relationships and field mapping relationships; the initial document determination module is further configured to: determine the target document type associated with the document type of the business document according to the document type mapping relationship; obtain the document template corresponding to the target document type; determine the initial field value corresponding to each template field in the document template according to the field mapping relationship and the field value of each business document field in the business document, and generate the initial document.

[0109] Each module in the aforementioned document generation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0110] In some embodiments, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 9As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores relevant data related to the document generation method. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a document generation method.

[0111] In some embodiments, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 10 As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a document generation method. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0112] Those skilled in the art will understand that Figure 9 or Figure 10The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0113] In some embodiments, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described document generation method.

[0114] In some embodiments, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the document generation method described above.

[0115] In some embodiments, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the document generation method described above.

[0116] 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, data stored, data displayed, 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 the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0117] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile 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. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0118] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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 specification.

[0119] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for generating documents, characterized in that, The method includes: Identify the initial document under the target business, and determine multiple document fields in the initial document for which data to be entered; In response to a data entry request sent by the terminal, the interface entry data obtained through the document entry interface of the terminal is acquired. Based on the attribute mapping relationship corresponding to the multiple document fields, the input field value corresponding to each document field is determined from the data entered on the interface; In response to the input confirmation request sent by the terminal, a target document is generated based on the initial document and the input field values ​​corresponding to each of the document fields; the plurality of document fields include at least one matching field; the initial document includes at least one row of initial document data; wherein, the generation process of the target document includes: Based on the input field values ​​corresponding to each of the matching fields, matching document data that matches the interface input data is determined from the initial document; the initial field value corresponding to the matching field in the matching document data is consistent with the input field value; the matching document data consists of multiple rows; the multiple document fields include a control quantity field; Based on the initial quantity corresponding to the control quantity field in each of the matching document data, the input quantity corresponding to the control quantity field is split to obtain the matching quantity corresponding to each of the matching document data. The document fields other than the control quantity field and the matching field among the plurality of document fields are determined as target fields; For each of the matched document data, the matched document data is updated using the matching quantity corresponding to the matched document data and the input field value corresponding to each of the target fields, and the target document is generated.

2. The method according to claim 1, characterized in that, After determining the initial documents for the target business, the method further includes: The initial document is copied to obtain a baseline document; The step of updating the matching document data for each matching document data using the matching quantity corresponding to the matching document data and the input field value corresponding to each document field to generate the target document includes: For each of the matching document data, obtain the copy document data corresponding to the matching document data from the base document; The copy document data is updated using the matching quantity corresponding to the matching document data and the input field value corresponding to each target field to obtain the target document data; The target document is generated based on the target document data.

3. The method according to claim 1, characterized in that, The step of determining the input field value corresponding to each of the document fields from the data entered through the interface based on the attribute mapping relationship corresponding to the multiple document fields includes: Based on the document type of the initial document, determine the attribute mapping relationship corresponding to the multiple document fields; Determine the attribute identifier corresponding to each of the document fields from the attribute mapping relationship; For each of the document fields, the attribute value of the attribute identifier corresponding to the document field is found in the data entered on the interface to obtain the entry field value corresponding to the document field.

4. The method according to claim 1, characterized in that, The determination of the initial document under the target business includes: Obtain at least one business document selected from the document display interface shown on the terminal; Determine the document conversion rules corresponding to each of the aforementioned business documents; The initial document is generated by converting each of the business documents according to the document conversion rules.

5. The method according to claim 4, characterized in that, The document conversion rules include document type mapping relationships and field mapping relationships; the step of converting each of the business documents according to the document conversion rules to generate the initial document includes: Based on the document type mapping relationship, determine the target document type associated with the document type of the business document; Obtain the document template corresponding to the target document type; Based on the field mapping relationship and the field values ​​of each business document field in the business document, the initial field value corresponding to each template field in the document template is determined, and the initial document is generated.

6. The method according to claim 1, characterized in that, The matching field is a field used to match and validate the data entered through the interface, and it is pre-configured through the interface model; the step of responding to the data entry request sent by the terminal and obtaining the interface entry data obtained through the document entry interface of the terminal includes: Determine the initial field value corresponding to the matching field from the initial document, and determine the entry field value corresponding to the matching field from the entry field value corresponding to each document field; If the initial field value corresponding to the matching field is consistent with the input field value corresponding to the matching field, the data entered in the interface is determined to be valid and the matching verification is passed. If the initial field value corresponding to the matching field in each row of initial document data is inconsistent with the value of the input field corresponding to the matching field, the data entered in the interface is determined to be invalid.

7. A document generation device, characterized in that, The device includes: The initial document determination module is used to determine the initial document under the target business and to determine multiple document fields of the data to be entered in the initial document; The data entry acquisition module is used to respond to the data entry request sent by the terminal and acquire the interface entry data obtained through the document entry interface of the terminal. The data matching module is used to determine the input field value corresponding to each of the document fields from the data entered on the interface based on the attribute mapping relationship corresponding to the multiple document fields. A document generation module is used to respond to an input confirmation request sent by the terminal and generate a target document based on the initial document and the input field values ​​corresponding to each of the document fields; the plurality of document fields include at least one matching field; the initial document includes at least one row of initial document data; wherein, the generation process of the target document includes: Based on the input field values ​​corresponding to each of the matching fields, matching document data that matches the interface input data is determined from the initial document; the initial field value corresponding to the matching field in the matching document data is consistent with the input field value; the matching document data consists of multiple rows; the multiple document fields include a control quantity field; Based on the initial quantity corresponding to the control quantity field in each of the matching document data, the input quantity corresponding to the control quantity field is split to obtain the matching quantity corresponding to each of the matching document data. The document fields other than the control quantity field and the matching field among the plurality of document fields are determined as target fields; For each of the matched document data, the matched document data is updated using the matching quantity corresponding to the matched document data and the input field value corresponding to each of the target fields, and the target document is generated.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

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

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

Citation Information

Patent Citations

  • Auxiliary list recording system based on artificial intelligence

    CN114820136A