Document conversion method, device, computer equipment and storage medium

By obtaining the subtype documents to be converted and using the conversion rules, templates and mapping forms of the main type documents they belong to for conversion, the problem of inefficient conversion of subtype documents in the prior art is solved, and the effect of improving the document conversion efficiency is achieved.

CN114997109BActive Publication Date: 2025-04-04KINGDEE SOFTWARE(CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210671422.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-15
Publication Date
2025-04-04
Estimated Expiration
2042-06-15

AI Technical Summary

Technical Problem

In the prior art, with the improvement of the degree of refined enterprise management, business document types are subdivided into multiple subtypes, resulting in each subtype document that needs to be converted into financial documents according to the configured document conversion rules and the corresponding voucher conversion template, which increases the workload of development and maintenance personnel, resulting in inefficient conversion of subtype documents.

Method used

By obtaining the subtype document to be converted, and obtaining the document conversion rules, conversion templates, and associated mapping forms based on the master document to which it belongs. The mapping form records the mapping relationship between fields in subtype documents and fields in public documents, and uses this information to convert subtype documents into target documents.

Benefits of technology

It reduces the workload of developers and maintenance personnel to add and maintain document conversion rules and templates, improves the efficiency of subtype document conversion, and enables each subtype document to be converted into target documents based on the rules and templates of the main type document.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114997109B_ABST
    Figure CN114997109B_ABST
Patent Text Reader

Abstract

The present application relates to a business document conversion method, device, computer equipment, storage medium and computer program product. The method comprises: obtaining a sub-type document to be converted; based on the main type document to which the sub-type document to be converted belongs, obtaining the document conversion rules, conversion template and associated mapping form corresponding to the main type document, wherein the mapping form records the mapping relationship between the fields in the sub-type document and the fields in the corresponding public document, wherein the public document is a form containing the fields in the main type document; based on the conversion template, converting the sub-type document to be converted according to the document conversion rules and the mapping form to obtain the corresponding target document. The method is used to realize the conversion of the sub-type document using the document conversion rules and conversion template corresponding to the main type document to which it belongs, thereby improving the efficiency of document conversion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a document conversion method, apparatus, computer equipment and storage medium. Background Art

[0002] With the development of computer technology, more and more companies are converting documents into financial vouchers through ERP systems for accounting and preservation.

[0003] As enterprise management becomes more sophisticated, business document types are subdivided into multiple business document subtypes based on scenarios. With current technology, each subtype document needs to be converted into a financial voucher based on the configured document conversion rules and the corresponding voucher conversion template. A large number of document conversion rules and conversion templates increase the workload of developers and maintenance personnel, resulting in low conversion efficiency of subtype documents. Summary of the invention

[0004] Based on this, it is necessary to provide a method, device, computer equipment, computer readable storage medium and computer program product for document conversion to improve the conversion efficiency of documents in response to the above technical problems.

[0005] The present application provides a method for document conversion, the method comprising:

[0006] Get the sub-type document to be converted;

[0007] Based on the main type document to which the sub-type document to be converted belongs, obtaining the document conversion rules, conversion template and associated mapping form corresponding to the main type document, wherein the mapping form records the mapping relationship between the fields in the sub-type document and the fields in the corresponding public document, wherein the public document is a form containing the fields in the main type document;

[0008] Based on the conversion template, the sub-type document to be converted is converted according to the document conversion rule and the mapping form to obtain a corresponding target document.

[0009] In one embodiment, based on the conversion template, the sub-type document to be converted is converted according to the document conversion rule and the mapping form to obtain the corresponding target document including:

[0010] Adding the field data corresponding to the field in the sub-type document to be converted to the conversion template based on the document conversion rule and the mapping form;

[0011] The fields in the conversion template that exist in the mapping form are replaced with corresponding mapping fields to obtain a target document corresponding to the sub-type document to be converted.

[0012] In one embodiment, adding the field data corresponding to the field in the sub-type document to be converted to the conversion template based on the document conversion rule and the mapping form includes:

[0013] If there is a field identical to the field to be converted in the sub-type document to be converted, the field data corresponding to the field to be converted is processed based on the document conversion rule, and the processing result is added to the field corresponding to the conversion template; the field to be converted is the field converted and processed by the document conversion rule, and is consistent with the field in the corresponding main type document;

[0014] If there is no field identical to the field to be converted in the sub-type document to be converted, the mapping field corresponding to the field to be converted is queried based on the mapping form, and the field data corresponding to the mapping field is used as the field data corresponding to the field to be processed based on the document conversion rules, and the processing result is added to the field corresponding to the conversion template.

[0015] In one embodiment, replacing the fields in the conversion template that exist in the mapping form with corresponding mapping fields to obtain the target document corresponding to the sub-type document to be converted includes:

[0016] Obtain each template field in the conversion template;

[0017] Determine a current template field from the various template fields;

[0018] When a mapping field corresponding to the current template field is found in the mapping form, the current template field in the conversion template is replaced with the found mapping field;

[0019] Get the next template field as the current template field, and return the mapping field corresponding to the current template field. When the mapping field corresponding to the current template field is queried in the mapping form, the current template field in the conversion template is replaced with the queried mapping field until the query of each template field is completed, and the target document corresponding to the sub-type document to be converted is obtained.

[0020] In one embodiment, obtaining the sub-type document to be converted further includes:

[0021] Get the newly added sub-type document;

[0022] Obtain the main type document to which the newly added sub-type document belongs, as well as the public documents and mapping forms associated with the main type document;

[0023] The mapping relationship between the fields in the newly added subtype document and the fields in the public document is recorded in the mapping form.

[0024] In one embodiment, recording the mapping relationship between the fields in the newly added sub-type document and the fields in the public document in the mapping form includes:

[0025] Acquire the difference fields in the newly added sub-type document that are different from the fields in the main type document;

[0026] Obtaining a reference field in the public document corresponding to the difference field;

[0027] A mapping relationship between the difference field and the reference field is established and saved in the mapping form.

[0028] In one embodiment, based on the main type document to which the sub-type document to be converted belongs, before obtaining the document conversion rule, conversion template and associated mapping form corresponding to the main type document, the method further includes:

[0029] Obtain the fields in the sub-type document to be converted;

[0030] Obtaining fields in the target master type document to be compared, and a mapping form associated with the target master type document;

[0031] Compare the fields in the sub-type document to be converted with the fields in the target main-type document to obtain difference fields between the sub-type document to be converted and the fields in the target main-type document;

[0032] The reference fields corresponding to the difference fields are queried based on the mapping form. If the difference fields all have corresponding reference fields, the target main type document is the main type document to which the sub-type document to be converted belongs.

[0033] The present application also provides a document conversion device, the device comprising:

[0034] A receiving module is used to obtain the sub-type document to be converted;

[0035] an acquisition module, configured to acquire, based on the main type document to which the sub-type document to be converted belongs, a document conversion rule, a conversion template, and an associated mapping form corresponding to the main type document, wherein the mapping form records a mapping relationship between fields in the sub-type document and fields in the corresponding public document, wherein the public document is a form containing fields in the main type document;

[0036] The conversion module is used to convert the sub-type document to be converted according to the document conversion rule and the mapping form based on the conversion template to obtain a corresponding target document.

[0037] The present application also provides a computer device, the computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program:

[0038] Get the sub-type document to be converted;

[0039] Based on the main type document to which the sub-type document to be converted belongs, obtaining the document conversion rules, conversion template and associated mapping form corresponding to the main type document, wherein the mapping form records the mapping relationship between the fields in the sub-type document and the fields in the corresponding public document, wherein the public document is a form containing the fields in the main type document;

[0040] Based on the conversion template, the sub-type document to be converted is converted according to the document conversion rule and the mapping form to obtain a corresponding target document.

[0041] The present application also provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the following steps are implemented:

[0042] Get the sub-type document to be converted;

[0043] Based on the main type document to which the sub-type document to be converted belongs, obtaining the document conversion rules, conversion template and associated mapping form corresponding to the main type document, wherein the mapping form records the mapping relationship between the fields in the sub-type document and the fields in the corresponding public document, wherein the public document is a form containing the fields in the main type document;

[0044] Based on the conversion template, the sub-type document to be converted is converted according to the document conversion rule and the mapping form to obtain a corresponding target document.

[0045] The document conversion method, device, computer equipment, storage medium and computer program product described above obtain the sub-type document to be converted, compare the fields in the sub-type document to be converted with the fields in the target main-type document, and determine the main-type document to which the sub-type document to be converted belongs; obtain the document conversion rules and conversion templates corresponding to the main-type document, and convert the sub-type document to be converted into the corresponding target document based on the document conversion rules and conversion templates corresponding to the main-type document. The main-type document generates multiple sub-type documents based on the scenario segmentation, and each sub-type document is converted into the target document based on the document conversion rules and conversion templates corresponding to the main-type document, which reduces the workload of developers and maintenance personnel in adding and maintaining document conversion rules and conversion templates, and improves the efficiency of sub-type document conversion. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 An application environment diagram of a document conversion method in an embodiment;

[0047] Figure 2 A schematic diagram of a process of document conversion method in one embodiment;

[0048] Figure 3 A schematic diagram of a process of replacing a field in a conversion template in one embodiment;

[0049] Figure 4 A schematic diagram of a process for updating a mapping form in one embodiment;

[0050] Figure 5 A schematic diagram of a process for determining a main type document in one embodiment;

[0051] Figure 6 A public document setting interface in an embodiment;

[0052] Figure 7 A mapping form setting interface in one embodiment;

[0053] Figure 8 A schematic diagram of a process for generating a target document in one embodiment;

[0054] Fig. 9 is a structural block diagram of a document conversion device in one embodiment;

[0055] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0056] 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.

[0057] The document conversion method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The 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 it can be placed on the cloud or other network servers. The terminal 102 sends a sub-type document conversion request to the server 104, and the server 104 obtains the sub-type document to be converted, analyzes the main type document to which the sub-type document to be converted belongs, obtains the document conversion rules, conversion templates and associated mapping forms corresponding to the main type document, and converts the sub-type document into a target document according to the document conversion rules, conversion templates and mapping forms corresponding to the main type document. The server 104 sends the target document to the terminal 102. When a new sub-type document is generated by business scenario segmentation, the terminal 102 sends a request to update the mapping form to the server 104, and the server 104 obtains the difference field in the new sub-type document that is different from the field in the main type document to which it belongs and the reference field corresponding to the difference field in the public document, and records the mapping relationship between the difference field and the reference field in the mapping form associated with the main type document. The terminal 102 may be, but is not limited to, at least one of various personal computers, laptop computers, smart phones, tablet computers, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.

[0058] In one embodiment, Figure 2 As shown, a document conversion method is provided. This embodiment uses the method applied to a terminal as an example for illustration. It can be understood that the method can also be applied to a server, 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:

[0059] Step 202, obtaining the sub-type document to be converted.

[0060] Among them, a document refers to a form that carries business data. For example, a user creates an order to record the purchase of items, which forms a document with information such as the name, price or brand of the purchased items. A sub-type document refers to a document that is subdivided by business scenarios, and some fields are different from those of the main type document. It can be understood that a sub-type document is a branch of the main type document. For example, in the ERP system, an expense reimbursement form is a main type document, and the telephone expense reimbursement form, utility expense reimbursement form, transportation expense reimbursement form, etc. generated by the expense reimbursement form based on the usage scenario are all sub-type documents.

[0061] Specifically, the terminal 102 sends the sub-type document to be converted to the server 104 .

[0062] In one embodiment, the sub-type document to be converted may come from an ERP system or a system connected to the ERP system.

[0063] Step 204, based on the main type document to which the sub-type document to be converted belongs, obtain the document conversion rules, conversion template and associated mapping form corresponding to the main type document. The mapping form records the mapping relationship between the fields in the sub-type document and the fields in the corresponding public document. The public document is a form containing the fields in the main type document.

[0064] Among them, the document conversion rule refers to the rule that defines the document to generate the target document. The conversion template refers to a form with a fixed and standardized structure, which can be understood as a document or voucher with fixed fields and presented in a fixed form. The mapping form refers to a form that records the correspondence between the fields in the subtype document and the fields in the public document. The correspondence can be a one-to-one correspondence or a many-to-one correspondence.

[0065] Specifically, the server 102 obtains the document conversion rules and conversion templates corresponding to the main type document to which the sub-type document to be converted belongs, and the associated mapping form.

[0066] In one embodiment, if a conversion template is configured for a main type document, the conversion template configured for the main type document is used as the conversion template corresponding to the main type document; if a conversion template is not configured for the main type document, the conversion template configured for the public document associated with the main type document is used as the conversion template corresponding to the main type document.

[0067] Step 206: Based on the conversion template, the sub-type document to be converted is converted according to the document conversion rules and the mapping form to obtain a corresponding target document.

[0068] The target document refers to the form generated by the business document according to the document conversion rules and conversion template. The target document can be a document, a financial voucher, etc. A financial voucher refers to a written certificate compiled in a certain format for recording in accounting books.

[0069] Specifically, the server 104 converts the sub-type document to be converted into a target document based on the document conversion rules and conversion template corresponding to the main type document and the associated mapping form.

[0070] In one embodiment, after the sub-type document to be converted is converted into a target document, one or more operations such as aggregation, statistics, and analysis are performed on the target document.

[0071] In the above document conversion method, the sub-type document to be converted is obtained, and the fields in the sub-type document to be converted are compared with the fields in the target main-type document to determine the main-type document to which the sub-type document to be converted belongs; the document conversion rules and conversion templates corresponding to the main-type document are obtained, and the sub-type document to be converted is converted into the corresponding target document based on the document conversion rules and conversion templates corresponding to the main-type document. The main-type document generates multiple sub-type documents based on the scenario segmentation, and each sub-type document is converted into the target document based on the document conversion rules and conversion templates corresponding to the main-type document, which reduces the workload of developers and maintenance personnel in adding and maintaining document conversion rules and conversion templates, and improves the efficiency of sub-type document conversion.

[0072] In one embodiment, step 206 includes:

[0073] The field data corresponding to the fields in the subtype document to be converted is added to the conversion template based on the document conversion rules and the mapping form; the fields in the conversion template that exist in the mapping form are replaced with the corresponding mapping fields to obtain the target document corresponding to the subtype document to be converted.

[0074] Among them, fields refer to the attributes set in the document. For example, the department, personnel, time, business contact number, business trip approval number, transportation fee, accommodation fee, meal fee, etc. set in the travel expense reimbursement form. Field data refers to the attribute value corresponding to the attribute in the document. For example, the General Affairs Department, Zhang San, etc. filled in the travel expense reimbursement form.

[0075] Specifically, when the conversion template is a conversion template configured for a public document associated with a main type document, server 104 adds the field data corresponding to the field in the subtype document to be converted to the corresponding field in the conversion template based on the mapping form and the document conversion rules, and queries the mapping field corresponding to the field in the conversion template based on the mapping form. If there is a corresponding mapping field for the field in the conversion template, the field in the conversion template is replaced with the corresponding mapping field to obtain the target document.

[0076] In one embodiment, the conversion template is a conversion template configured for a main type document. The server 104 adds field data corresponding to fields in the subtype document to be converted to fields corresponding to the conversion template based on a mapping form and document conversion rules to obtain a target document.

[0077] In this embodiment, according to the document conversion rules corresponding to the main type document and the associated mapping form, the field data in the sub-type document to be converted is added to the conversion template corresponding to the main type document, avoiding the need to add a corresponding document conversion rule for adding a sub-type document, thereby improving the efficiency of document conversion. Based on the mapping form associated with the main type document, the fields in the mapping form in the conversion template are replaced with the corresponding mapping fields, so that the target document corresponding to each sub-type document has the personalized fields of the sub-type document, enriching the form of the target document.

[0078] In one embodiment, adding field data corresponding to fields in the sub-type document to be converted to the conversion template based on the document conversion rules and the mapping form includes:

[0079] If there is a field identical to the field to be converted in the sub-type document to be converted, the field data corresponding to the field to be converted will be processed based on the document conversion rules, and the processing result will be added to the field corresponding to the conversion template; the field to be converted is the field converted and processed by the document conversion rules, and is consistent with the field in the corresponding main type document; if there is no field identical to the field to be converted in the sub-type document to be converted, the mapping field corresponding to the field to be converted is queried based on the mapping form, and the field data corresponding to the mapping field is used as the field data corresponding to the field to be processed based on the document conversion rules, and the processing result is added to the field corresponding to the conversion template.

[0080] The field to be converted refers to the field that is converted and processed by the document conversion rule, which can be understood as the field that can be recognized by the document conversion rule. For example, in the document conversion rule corresponding to the expense reimbursement form, the expense is set as the field to be converted. The document conversion rule needs to add the field data corresponding to the expense to the reimbursement expense in the conversion template. The telephone expense is set in the telephone expense reimbursement form, and the document conversion rule cannot recognize the telephone expense to obtain the field data corresponding to the expense. Processing refers to the operation of field data through calculation rules, which can include addition, subtraction, multiplication, division and compound operations.

[0081] Specifically, if there is a field identical to the field to be converted in the sub-type document to be converted, the field data corresponding to the field to be converted is obtained from the sub-type document to be converted, the obtained field data is processed according to the operation rules set in the document conversion rules, and the processing results are added to the corresponding fields in the conversion template. If there is no field identical to the field to be converted in the sub-type document to be converted, the mapping field corresponding to the field to be converted is queried based on the mapping form, the field data corresponding to the mapping field obtained from the sub-type document to be converted is used as the field data corresponding to the field to be converted, the obtained field data is processed according to the operation rules set in the document conversion rules, and the processing results are added to the corresponding fields in the conversion template.

[0082] In this embodiment, field data corresponding to the field to be converted is obtained from the sub-type document to be converted based on the mapping form, the obtained field data is processed according to the operation rules set by the document conversion rules, and the processing results are added to the corresponding fields in the conversion template, thereby improving the accuracy of the target document.

[0083] In one embodiment, the fields existing in the mapping form in the conversion template are replaced with corresponding mapping fields, and the target document corresponding to the sub-type document to be converted is obtained, including:

[0084] Step 302: Acquire each template field in the conversion template.

[0085] The template field refers to the field set in the conversion template.

[0086] In one embodiment, various fields of the conversion template are obtained from a database according to the identifier of the conversion template.

[0087] Step 304: determine the current template field from various template fields.

[0088] The current template field refers to the template field that will be involved in the query.

[0089] Step 306: When the mapping field corresponding to the current template field is found in the mapping form, the current template field in the conversion template is replaced with the found mapping field.

[0090] Specifically, if the current template field finds the corresponding mapping field through the mapping form, the current template field in the conversion template is replaced with the corresponding mapping field. If the current template field does not find the corresponding mapping field through the mapping form, the current template field in the conversion template remains unchanged.

[0091] Step 308, obtain the next template field as the current template field, and return when the mapping field corresponding to the current template field is queried in the mapping form, then replace the current template field in the conversion template with the queried mapping field, until the query of each template field is completed, and the target document corresponding to the sub-type document to be converted is obtained.

[0092] Specifically, query the corresponding mapping fields of each template field in the mapping form in turn. If the current template field finds the corresponding mapping field through the mapping form, replace the current template field in the conversion template with the corresponding mapping field. If the current template field does not find the corresponding mapping field through the mapping form, the current template field in the conversion template remains unchanged. After all template fields have gone through the above steps, the target document corresponding to the sub-type document to be converted is obtained.

[0093] In this embodiment, the fields existing in the mapping form in the conversion template are replaced with corresponding mapping fields to obtain a target document corresponding to the sub-type document to be converted. The generated target document has personalized fields in the sub-type document to be converted, enriching the form of the target document.

[0094] In one embodiment, the process of updating the mapping table is as follows: Figure 4 As shown, including:

[0095] Step 402, obtaining a newly added sub-type document.

[0096] Among them, a newly added sub-type document refers to a form that is different from the existing sub-type document and is generated based on the scenario segmentation. A newly added sub-type document can be a document that is prepared by financial personnel or production departments to meet the needs, and can be obtained by adaptively modifying the main type document or the existing sub-type document. The newly added sub-type document can be named according to the purpose or usage scenario.

[0097] Specifically, the terminal 102 sends the newly added sub-type document to the server 104 .

[0098] Step 404, obtaining the main type document to which the newly added sub-type document belongs, as well as the public documents and mapping forms associated with the main type document.

[0099] In one embodiment, when the obtained sub-type document cannot match the main type document to which it belongs, the user is reminded that the obtained sub-type document is a newly added sub-type document. The user selects the newly added sub-type document and the belonging main type document as the source form and the target form respectively through the setting page presented by the terminal 102, and establishes a mapping relationship between the newly added sub-type document and the belonging main type document.

[0100] In one embodiment, when the acquired sub-type document cannot match the main type document to which it belongs, the server 104 treats the sub-type document as a newly added sub-type document, compares the fields of the sub-type document with the fields in the existing main type documents, selects the main type document with the most identical fields as the main document type to which the sub-type document belongs, and sends the matching result to the terminal 102. 102 presents the received matching result and prompts the user to confirm.

[0101] Step 406: Record the mapping relationship between the fields in the newly added sub-type document and the fields in the common document in the mapping form.

[0102] Specifically, the one-to-one correspondence between the difference fields in the newly added sub-type document and the reference fields in the common document is recorded in the mapping form.

[0103] In one embodiment, a developer or maintenance personnel selects a difference field in a newly added subtype document and a reference field in a common document in a setting interface on the terminal 102 to establish a mapping relationship between the difference field and the reference field.

[0104] In one embodiment, the server 104 obtains the difference fields by comparing the fields in the newly added sub-type document with the fields in the main type document, matches the corresponding reference fields for the difference fields based on a preset database, establishes a mapping relationship between the difference fields and the reference fields, and presents the established mapping form on the terminal 102 to prompt the user to confirm.

[0105] In this embodiment, the sub-type document to be converted is a newly added sub-type document. A mapping relationship between the difference field and the reference field is established in the mapping form associated with the main type to which it belongs, laying the foundation for the subsequent newly added sub-type document to generate the target document using the document conversion rules of the main type document, thereby improving the conversion efficiency of the newly added sub-type document.

[0106] In one embodiment, step 406 includes:

[0107] Get the difference fields in the newly added sub-type document that are different from the fields in the main type document; get the reference fields corresponding to the difference fields in the public document; establish the mapping relationship between the difference fields and the reference fields, and save it to the mapping form.

[0108] Specifically, in the setting interface of terminal 102, the difference fields in the newly added sub-type document and the reference fields corresponding to the difference fields in the public document are selected. Terminal 102 sends the mapping relationship between the difference fields and the reference fields obtained in the setting interface to server 104, and server 104 saves the mapping relationship in the mapping form.

[0109] In this embodiment, the difference field and the corresponding reference field are selected through the setting interface presented by the terminal 102 to establish a mapping relationship between the difference field and the reference field. The setting interface is easy to operate and improves the speed of updating the mapping form.

[0110] In one embodiment, the step of determining whether a sub-type document belongs to a main-type document is as follows: Figure 5 As shown, including:

[0111] Step 502, obtaining the fields in the sub-type document to be converted.

[0112] Specifically, the fields included are extracted from the subtype document to be converted.

[0113] In one embodiment, various fields corresponding to the identification are acquired from a database according to the identification of the sub-type document.

[0114] Step 504, obtaining the fields in the target master type document to be compared, and the mapping form associated with the target master type document.

[0115] The target main type document refers to the existing main type document currently involved in the comparison.

[0116] In one embodiment, the main type documents are acquired in sequence as the target main type documents according to the storage order of the main type documents.

[0117] In one embodiment, the server 104 determines the number of identical fields in the sub-type document to be converted and in the main type document by comparing the fields in the sub-type document to be converted with the fields in the main type document, sorts the main type documents in order from most to least, and obtains the main type documents in the sorted order as the target main type documents.

[0118] Step 506, compare the fields in the sub-type document to be converted with the fields in the target main-type document to obtain the difference fields between the sub-type document to be converted and the fields in the target main-type document;

[0119] The difference fields can be understood as fields that exist in the sub-type document to be converted but do not exist in the target main-type document.

[0120] Step 508: query the reference fields corresponding to the difference fields based on the mapping form. If the difference fields all have corresponding reference fields, the target main type document is the main type document to which the sub-type document to be converted belongs.

[0121] The reference field refers to a field in the mapping form that has a mapping relationship with the difference field.

[0122] In one embodiment, the reference fields corresponding to the difference fields are queried in the mapping form associated with the target main type document. If each reference field is the same as the field in the target main type document, the target main type document is determined to be the main type document to which the sub-type document to be converted belongs.

[0123] In this embodiment, by comparing the fields in the sub-type document to be converted with the fields in each target main-type document, the main-type document to which the sub-type document to be converted belongs is determined, thereby improving the accuracy of determining the main-type document to which it belongs.

[0124] In a specific embodiment, a method for document conversion is provided, and the specific steps for implementing the method are as follows:

[0125] Set the common document associated with the master document. Figure 6 On the settings page shown, set the main type document to participate in generating vouchers and the public documents corresponding to the main type document, and complete the association between the main type document and the public document. Figure 6 In the settings page shown, select Expense Reimbursement Document as Document. Expense Reimbursement Document is a main type business document. Select Yes for Participate in Voucher Generation, which means that expense reimbursement documents and their subtype documents need to be converted to generate financial vouchers. Select Expense Reimbursement Document Template as Public Document. Documents and public documents can be obtained by uploading or selecting documents in the database. The public document setting can also be empty. Click Save after the settings are completed to complete the associated storage of expense reimbursement documents and expense reimbursement document templates.

[0126] New sub-type documents. New sub-type documents are generated by business scenario segmentation. New sub-type documents are documents prepared by financial personnel based on accounting requirements or accounting and statistical requirements. They can also be documents prepared by business departments based on actual production requirements after adjusting existing documents. New sub-type documents cannot generate financial vouchers based on existing document conversion rules.

[0127] Update the mapping form. In order to enable the newly added sub-type document to generate financial vouchers according to the document conversion rules corresponding to the main type document to which it belongs, the mapping form associated with the main type document needs to be updated. The financial personnel or relevant personnel of the business department operate the setting interface to establish a mapping relationship between the difference fields in the newly added sub-type document that are different from the main type document and the corresponding reference fields in the public document associated with the main type document.

[0128] Through Figure 7 The setup interface shown in the figure updates the mapping form. The setup interface includes the source form, target form, source form fields, and target form fields. The source form and target form fields are entered by uploading documents or selecting existing documents. The source form is a newly added sub-type document, and the target form is a public document associated with the main type document. The source form fields are the above-mentioned difference fields, and the target form fields are the above-mentioned reference fields. The source form fields and target form fields are selected by selecting or manually entering the difference fields and reference fields. Figure 7 In the document association mapping shown, the source form selects the travel reimbursement form, the target form selects the expense reimbursement document template, the source form fields select the fields in the travel reimbursement form that are different from the expense reimbursement form, including the three fields of accommodation fee, accommodation time, and accommodation personnel, and the target form fields select the reference fields in the expense reimbursement document template that correspond to the different fields in the travel reimbursement form, including the three fields of reimbursement fee, usage time, and reimbursement personnel. After saving, the mapping relationship between accommodation fee and reimbursement fee, accommodation time and usage time, and accommodation personnel and reimbursement personnel is established.

[0129] If after adding a sub-type document, the finance personnel or relevant personnel of the business department do not operate the setting interface, the main type document to which the new sub-type document belongs is empty, and the operator is prompted to convert the sub-type document to the new sub-type document. The operator updates the corresponding mapping form through the above steps.

[0130] Get the sub-type documents to be converted. In the ERP system, the expense reimbursement form is a main type of document. The expense reimbursement form is subdivided into sub-type documents such as travel reimbursement forms, telephone expense reimbursement forms, and utility expense reimbursement forms according to actual conditions. The ERP system obtains the sub-type documents that need to be converted into financial vouchers.

[0131] Determine the main type document to which the sub-type document to be converted belongs. Compare the fields in the sub-type document to be converted with the fields in the existing target main type document to obtain the difference fields in the sub-type document to be converted and the target main type document. Query the mapping fields corresponding to the difference fields based on the mapping form associated with the target main type document. If the mapping fields are the same as the fields of the main type document, determine that the target main type document is the main type document to which the sub-type document to be converted belongs; if there are different fields between the mapping fields and the fields in the main type document, determine that the target main type document is not the main type document to which the sub-type document to be converted belongs. Repeat the above comparison process until the main type document to which the sub-type document to be converted belongs is determined.

[0132] Get dynamic accounting conversion rules and conversion templates. Get the dynamic accounting conversion rules and conversion templates corresponding to the main type document. If the main type document has a configured conversion template, get the main type document configuration conversion template as the conversion template corresponding to the main type document. If the main type document does not have a conversion template configured, get the conversion template configured in the public document associated with the main type document as the conversion template corresponding to the main type document.

[0133] Convert the sub-type document to be converted into a financial voucher. Add the field data corresponding to the fields in the sub-type document to be converted to the conversion template based on the dynamic accounting conversion rules and mapping form. If the conversion template is a conversion template configured for a public document, replace the fields in the mapping form in the conversion template with the corresponding mapping fields to obtain the financial voucher corresponding to the sub-type document to be converted. Figure 8 As described above, there is field A in the travel expense report, there is field E in the conversion template, and there is a mapping relationship between A and E in the mapping form, then field E in the conversion template is replaced with field A.

[0134] In this embodiment, each sub-type document is converted into a target document based on the dynamic accounting conversion rules and conversion templates corresponding to the main type document, reducing the workload of developers and maintenance personnel in adding and maintaining document conversion rules and improving the efficiency of sub-type document conversion.

[0135] It should be understood that although Figure 1-8 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-8 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0136] Based on the same inventive concept, the embodiment of the present application also provides a document conversion device for implementing the document conversion 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 one or more document conversion device embodiments provided below can refer to the limitations of the document conversion method above, and will not be repeated here.

[0137] In one embodiment, Fig. 9 As shown, a document conversion device is provided, comprising: a receiving module, an acquisition module, and a conversion module, wherein:

[0138] Receiving module 902, used to obtain the sub-type document to be converted;

[0139] The acquisition module 904 is used to acquire, based on the main type document to which the sub-type document to be converted belongs, the document conversion rule, conversion template and associated mapping form corresponding to the main type document, wherein the mapping form records the mapping relationship between the fields in the sub-type document and the fields in the corresponding public document, and the public document is a form containing the fields in the main type document;

[0140] The conversion module 906 is used to convert the sub-type document to be converted according to the document conversion rule and the mapping form based on the conversion template to obtain a corresponding target document.

[0141] In one embodiment, the conversion module 906 is also used to: add the field data corresponding to the fields in the sub-type document to be converted to the conversion template based on the document conversion rules and the mapping form; replace the fields in the conversion template that exist in the mapping form with the corresponding mapping fields to obtain the target document corresponding to the sub-type document to be converted.

[0142] In one embodiment, the conversion module 906 is also used for: if there is a field identical to the field to be converted in the sub-type document to be converted, the field data corresponding to the field to be converted is processed based on the document conversion rule, and the processing result is added to the field corresponding to the conversion template; the field to be converted is the field converted and processed by the document conversion rule, and is consistent with the field in the corresponding main type document; if there is no field identical to the field to be converted in the sub-type document to be converted, the mapping field corresponding to the field to be converted is queried based on the mapping form, the field data corresponding to the mapping field is used as the field data corresponding to the field to be processed based on the document conversion rule, and the processing result is added to the field corresponding to the conversion template.

[0143] In one embodiment, the conversion module 906 is also used to: obtain each template field in the conversion template; determine the current template field from the each template field; when the mapping field corresponding to the current template field is queried in the mapping form, replace the current template field in the conversion template with the queried mapping field; obtain the next template field as the current template field, return to the when the mapping field corresponding to the current template field is queried in the mapping form, replace the current template field in the conversion template with the queried mapping field, until the query of each template field is completed, and the target document corresponding to the sub-type document to be converted is obtained.

[0144] In one embodiment, the receiving module 902 is also used to: obtain a newly added sub-type document; obtain the main type document to which the newly added sub-type document belongs, as well as the public document and mapping form associated with the main type document; and record in the mapping form the mapping relationship between the fields in the newly added sub-type document and the fields in the public document.

[0145] In one embodiment, the receiving module 902 is also used to: obtain the difference field in the newly added sub-type document that is different from the field in the main type document; obtain the reference field in the public document corresponding to the difference field; establish a mapping relationship between the difference field and the reference field, and save it to the mapping form.

[0146] In one embodiment, the acquisition module 904 is also used to: acquire fields in the sub-type document to be converted; acquire fields in the target main type document for comparison, and a mapping form associated with the target main type document; compare the fields in the sub-type document to be converted with the fields in the target main type document to obtain difference fields in the sub-type document to be converted that are different from the fields in the target main type document; query the reference fields corresponding to the difference fields based on the mapping form, if the difference fields all have corresponding reference fields, then the target main type document is the main type document to which the sub-type document to be converted belongs.

[0147] Each module in the document conversion 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 operations corresponding to each module.

[0148] Fig.10 FIG. 1 shows an internal structure diagram of a computer device in an embodiment. The computer device can be either a terminal or a server. Fig.10 As shown, the computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor can implement the video synthesis method. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor can execute the business document conversion method.

[0149] Those skilled in the art will understand that Fig.10 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.

[0150] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: obtaining a sub-type document to be converted; based on a main-type document to which the sub-type document to be converted belongs, obtaining a document conversion rule, a conversion template, and an associated mapping form corresponding to the main-type document, wherein the mapping form records a mapping relationship between fields in the sub-type document and fields in a corresponding public document, wherein the public document is a form containing fields in the main-type document; based on the conversion template, converting the sub-type document to be converted according to the document conversion rule and the mapping form to obtain a corresponding target document.

[0151] In one embodiment, when the processor executes the computer program, the following steps are also implemented: adding the field data corresponding to the fields in the sub-type document to be converted to the conversion template based on the document conversion rules and the mapping form; replacing the fields in the conversion template that exist in the mapping form with the corresponding mapping fields to obtain the target document corresponding to the sub-type document to be converted.

[0152] In one embodiment, the processor further implements the following steps when executing the computer program: if there is a field identical to the field to be converted in the sub-type document to be converted, the field data corresponding to the field to be converted is processed based on the document conversion rule, and the processing result is added to the field corresponding to the conversion template; the field to be converted is the field converted and processed by the document conversion rule, and is consistent with the field in the corresponding main type document; if there is no field identical to the field to be converted in the sub-type document to be converted, the mapping field corresponding to the field to be converted is queried based on the mapping form, the field data corresponding to the mapping field is used as the field data corresponding to the field to be processed based on the document conversion rule, and the processing result is added to the field corresponding to the conversion template.

[0153] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining each template field in the conversion template; determining the current template field from the each template field; when the mapping field corresponding to the current template field is queried in the mapping form, replacing the current template field in the conversion template with the queried mapping field; obtaining the next template field as the current template field, returning to the when the mapping field corresponding to the current template field is queried in the mapping form, replacing the current template field in the conversion template with the queried mapping field, until the query of each template field is completed, and obtaining the target document corresponding to the sub-type document to be converted.

[0154] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining a newly added sub-type document; obtaining the main type document to which the newly added sub-type document belongs, as well as the public document and mapping form associated with the main type document; and recording the mapping relationship between the fields in the newly added sub-type document and the fields in the public document in the mapping form.

[0155] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining a difference field in the newly added sub-type document that is different from a field in the main type document; obtaining a reference field in the public document that corresponds to the difference field; establishing a mapping relationship between the difference field and the reference field, and saving it to the mapping form.

[0156] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining fields in the sub-type document to be converted; obtaining fields in the target main type document for comparison, and a mapping form associated with the target main type document; comparing the fields in the sub-type document to be converted with the fields in the target main type document to obtain difference fields in the sub-type document to be converted that are different from the fields in the target main type document; querying the reference fields corresponding to the difference fields based on the mapping form, if the difference fields all have corresponding reference fields, the target main type document is the main type document to which the sub-type document to be converted belongs.

[0157] 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: obtaining a sub-type document to be converted; based on the main type document to which the sub-type document to be converted belongs, obtaining a document conversion rule, a conversion template and an associated mapping form corresponding to the main type document, wherein the mapping form records the mapping relationship between fields in the sub-type document and fields in the corresponding public document, and the public document is a form containing fields in the main type document; based on the conversion template, converting the sub-type document to be converted according to the document conversion rule and the mapping form to obtain a corresponding target document.

[0158] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: adding the field data corresponding to the field in the sub-type document to be converted to the conversion template based on the document conversion rule and the mapping form; replacing the field in the conversion template existing in the mapping form with the corresponding mapping field, and obtaining the target document corresponding to the sub-type document to be converted. In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if there is a field identical to the field to be converted in the sub-type document to be converted, the field data corresponding to the field to be converted is processed based on the document conversion rule, and the processing result is added to the field corresponding to the conversion template; the field to be converted is the field converted and processed by the document conversion rule, and is consistent with the field in the corresponding main type document; if there is no field identical to the field to be converted in the sub-type document to be converted, the mapping field corresponding to the field to be converted is queried based on the mapping form, and the field data corresponding to the mapping field is processed as the field data corresponding to the field to be processed based on the document conversion rule, and the processing result is added to the field corresponding to the conversion template.

[0159] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining each template field in the conversion template; determining the current template field from the each template field; when the mapping field corresponding to the current template field is queried in the mapping form, replacing the current template field in the conversion template with the queried mapping field; obtaining the next template field as the current template field, returning to the when the mapping field corresponding to the current template field is queried in the mapping form, replacing the current template field in the conversion template with the queried mapping field, until the query of each template field is completed, and obtaining the target document corresponding to the sub-type document to be converted.

[0160] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: obtaining a newly added sub-type document; obtaining the main type document to which the newly added sub-type document belongs, as well as the public document and mapping form associated with the main type document; and recording in the mapping form the mapping relationship between the fields in the newly added sub-type document and the fields in the public document.

[0161] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining a difference field in the newly added sub-type document that is different from a field in the main type document; obtaining a reference field in the public document that corresponds to the difference field; establishing a mapping relationship between the difference field and the reference field, and saving it to the mapping form.

[0162] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining fields in the sub-type document to be converted; obtaining fields in the target main type document for comparison, and a mapping form associated with the target main type document; comparing the fields in the sub-type document to be converted with the fields in the target main type document to obtain difference fields in the sub-type document to be converted that are different from the fields in the target main type document; querying the reference fields corresponding to the difference fields based on the mapping form, if the difference fields all have corresponding reference fields, then the target main type document is the main type document to which the sub-type document to be converted belongs.

[0163] 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.

[0164] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods 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 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), magnetoresistive 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, etc., but are not limited to this.

[0165] 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 specification.

[0166] 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 document conversion, characterized in that: The method comprises: Get the sub-type document to be converted; Acquire fields in the sub-type document to be converted; acquire fields in the target main-type document for comparison, and a mapping form associated with the target main-type document; compare the fields in the sub-type document to be converted with the fields in the target main-type document to obtain difference fields in the sub-type document to be converted that are different from the fields in the target main-type document; query reference fields corresponding to the difference fields based on the mapping form, and if the difference fields all have corresponding reference fields, the target main-type document is the main-type document to which the sub-type document to be converted belongs; Based on the main type document to which the sub-type document to be converted belongs, obtaining the document conversion rules, conversion template and associated mapping form corresponding to the main type document, wherein the mapping form records the mapping relationship between the fields in the sub-type document and the fields in the corresponding public document, wherein the public document is a form containing the fields in the main type document; Based on the conversion template, the sub-type document to be converted is converted according to the document conversion rule and the mapping form to obtain a corresponding target document.

2. The method according to claim 1, characterized in that Based on the conversion template, converting the sub-type document to be converted according to the document conversion rule and the mapping form to obtain a corresponding target document includes: Adding the field data corresponding to the field in the sub-type document to be converted to the conversion template based on the document conversion rule and the mapping form; The fields in the conversion template that exist in the mapping form are replaced with corresponding mapping fields to obtain a target document corresponding to the sub-type document to be converted.

3. The method according to claim 2, characterized in that The step of adding the field data corresponding to the field in the sub-type document to be converted to the conversion template based on the document conversion rule and the mapping form includes: If there is a field identical to the field to be converted in the sub-type document to be converted, the field data corresponding to the field to be converted is processed based on the document conversion rule, and the processing result is added to the field corresponding to the conversion template; the field to be converted is the field converted and processed by the document conversion rule, and is consistent with the field in the corresponding main type document; If there is no field identical to the field to be converted in the sub-type document to be converted, the mapping field corresponding to the field to be converted is queried based on the mapping form, and the field data corresponding to the mapping field is used as the field data corresponding to the field to be processed based on the document conversion rules, and the processing result is added to the field corresponding to the conversion template.

4. The method according to claim 2, characterized in that: The step of replacing the fields in the conversion template that exist in the mapping form with corresponding mapping fields to obtain a target document corresponding to the sub-type document to be converted includes: Obtain each template field in the conversion template; Determine a current template field from the various template fields; When a mapping field corresponding to the current template field is found in the mapping form, the current template field in the conversion template is replaced with the found mapping field; Get the next template field as the current template field, and return the mapping field corresponding to the current template field. When the mapping field corresponding to the current template field is queried in the mapping form, the current template field in the conversion template is replaced with the queried mapping field until the query of each template field is completed, and the target document corresponding to the sub-type document to be converted is obtained.

5. The method according to claim 1, characterized in that The step of obtaining the sub-type document to be converted further includes: Get the newly added sub-type document; Obtain the main type document to which the newly added sub-type document belongs, as well as the public documents and mapping forms associated with the main type document; The mapping relationship between the fields in the newly added subtype document and the fields in the public document is recorded in the mapping form.

6. The method according to claim 5, characterized in that The recording of the mapping relationship between the fields in the newly added sub-type document and the fields in the common document in the mapping form includes: Acquire the difference fields in the newly added sub-type document that are different from the fields in the main type document; Obtaining a reference field in the public document corresponding to the difference field; A mapping relationship between the difference field and the reference field is established and saved in the mapping form.

7. The method according to claim 1, characterized in that If the main type document has a configured conversion template, the conversion template configured for the main type document will be used as the conversion template corresponding to the main type document; if the main type document does not have a configured conversion template, the conversion template configured for the public document associated with the main type document will be used as the conversion template corresponding to the main type document.

8. A document conversion device, characterized in that: The device comprises: A receiving module is used to obtain a sub-type document to be converted; obtain fields in the sub-type document to be converted; obtain fields in a target main-type document for comparison, and a mapping form associated with the target main-type document; compare the fields in the sub-type document to be converted with the fields in the target main-type document to obtain difference fields in the sub-type document to be converted that are different from the fields in the target main-type document; query the reference fields corresponding to the difference fields based on the mapping form, and if the difference fields all have corresponding reference fields, the target main-type document is the main-type document to which the sub-type document to be converted belongs; an acquisition module, configured to acquire, based on the main type document to which the sub-type document to be converted belongs, a document conversion rule, a conversion template, and an associated mapping form corresponding to the main type document, wherein the mapping form records a mapping relationship between fields in the sub-type document and fields in the corresponding public document, wherein the public document is a form containing fields in the main type document; The conversion module is used to convert the sub-type document to be converted according to the document conversion rule and the mapping form based on the conversion template to obtain a corresponding target document.

9. 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 7 are implemented.

10. 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 7 are implemented.

Citation Information

Patent Citations

  • Method, device and system for business bill conversion

    CN101777143A

  • Reimbursement implementation method and equipment and medium

    CN112784567A