A document association method, apparatus, electronic device, and storage medium
By matching and correlating the header and line fields of documents, the problem of complex associations between documents is solved, improving the efficiency and accuracy of documents are improved, and management costs are reduced.
Patent Information
- Application Number
- CN202311600005.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-27
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2043-11-27
AI Technical Summary
During business processing, the complexity and irregularity of the association between documents leads to an increase in management costs, affecting the accuracy and traceability of data.
By obtaining the basic information of the document to be associated, matching the header field of the upstream document and the header field of the downstream document, matching the line field of the upstream document and the line field of the downstream document, taking the intersection for association, simplifying the association relationship between documents.
It improves the efficiency and accuracy of documents, reduces management costs, increases data traceability, and simplifies the document search process.
Smart Images

Figure CN117764752B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a document association method, device, electronic equipment and storage medium. Background Art
[0002] Documents are written proof of the actual situation of transactions or matters obtained or filled out when economic transactions occur. They are the original data and important basis for accounting, and are also a basis for handling the delivery of goods and payment of goods. Documents can show whether the exporter has fulfilled the contract and the extent of its fulfillment. Imported goods use documents as the title certificate for withdrawing goods. Having documents means that the goods are in hand.
[0003] In the course of business processing, various documents will be generated as needed, and one or more documents will also generate another one or more documents. Therefore, the number of documents during business processing is relatively large, and the documents are not necessarily processed according to the same standard. Although there are connections between many documents, many documents are not created with the connection between documents in mind. There are certain complexities and irregularities, which increase the complexity of the relationship between documents, making the documents inconvenient to use, increasing the management cost of the documents, and affecting the accuracy and traceability of the data in the documents. Therefore, a document association method is urgently needed.
[0004] It should be noted that the above content only provides background technical information related to the present invention and does not necessarily constitute prior art. Summary of the invention
[0005] In view of the above-mentioned shortcomings of the prior art, the present invention provides a document association method, device, electronic device and storage medium to solve at least one of the above-mentioned technical problems.
[0006] Other features and advantages of the present invention will become apparent from the following detailed description, or may be learned in part by practice of the present invention.
[0007] According to one aspect of an embodiment of the present invention, a document association method is provided, comprising: obtaining basic document information of a plurality of documents to be associated, the documents to be associated comprising an upstream document and a downstream document, the basic document information comprising a header field and a row field; matching the header field of the upstream document with the header field of the downstream document to obtain a first matching result, and then, according to the first matching result, performing a first association between the header field of the upstream document and the header field of the downstream document to obtain a first association result for each upstream document, the first association result comprising at least one downstream document; matching the row field of the upstream document with the row field of the downstream document to obtain a second matching result, and then, according to the second matching result, performing a second association between the row field of the upstream document and the row field of the downstream document to obtain a second association result for each upstream document, the second association result comprising at least one downstream document; and taking an intersection of the first association result and the second association result of each upstream document, and if the intersection comprises at least one downstream document, associating the downstream document in the intersection with the one upstream document.
[0008] In one embodiment of the present invention, based on the above-mentioned solution, after matching the header field of the upstream document with the header field of the downstream document to obtain a first matching result, any one of the following is included: if the first matching result is that the header field of the downstream document includes the header fields of all the upstream documents, then the header field of the upstream document is first associated with the header field of the downstream document according to the first matching result to obtain a first association result for each upstream document, and the first association result includes at least one downstream document; if the first matching result is that the header field of each downstream document only includes the header field of the upstream document, then the header field of the upstream document is first associated with the header field of the downstream document according to the first matching result to obtain a first association result for each upstream document, and the first association result includes at least one downstream document.
[0009] In one embodiment of the present invention, based on the above-mentioned scheme, after matching the row fields of the upstream document with the row fields of the downstream document to obtain a second matching result, any one of the following is included: if the second matching result is that the row fields of the downstream document include the row fields of all the upstream documents, then according to the second matching result, the row fields of the upstream document and the row fields of the downstream document are secondly associated to obtain a second association result for each upstream document, and the second association result includes at least one downstream document; if the second matching result is that the row fields of each downstream document only include the row fields of the upstream document, then according to the second matching result, the row fields of the upstream document and the row fields of the downstream document are secondly associated to obtain a second association result for each upstream document, and the second association result includes at least one downstream document.
[0010] In one embodiment of the present invention, based on the above-mentioned scheme, after matching the header field of the upstream document with the header field of the downstream document, if the match fails, any one of the following is included: generating multiple new header fields of the downstream document according to multiple header fields of the upstream document, the number of the header fields of the upstream document is equal to the number of the header fields of the downstream document, so as to update or increase the header field of the corresponding downstream document; generating multiple new header fields of the downstream document according to the header field of one upstream document, the header field of the downstream document is only derived from the header field of the upstream document, so as to update or increase the header field of the corresponding downstream document; generating a new header field of the downstream document according to multiple header fields of the upstream documents, so as to update or increase the header field of the corresponding downstream document.
[0011] In one embodiment of the present invention, based on the above-mentioned scheme, after matching the row fields of the upstream document with the row fields of the downstream document, if the match fails, any one of the following is included: generating multiple new row fields of the downstream document based on multiple row fields of the upstream document, the number of the row fields of the upstream document is equal to the number of the row fields of the downstream document, so as to update or increase the row fields of the corresponding downstream document; generating multiple new row fields of the downstream document based on one row field of the upstream document, the row fields of the downstream document are only derived from the row fields of the upstream document, so as to update or increase the row fields of the corresponding downstream document; generating a new row field of the downstream document based on multiple row fields of the upstream document, so as to update or increase the row fields of the corresponding downstream document.
[0012] In one embodiment of the present invention, based on the above scheme, after associating the upstream document and the downstream document based on the first association and the second association, it also includes: receiving association data query request information, the association data query request information includes the association data to be queried, and determining the association relationship according to the association data to be queried; if the association relationship is the first association relationship, determining the number of the upstream documents according to the first association relationship, and the first association relationship is obtained based on the first association; if the number of the upstream documents is 1, and the association data to be queried is the header field of the upstream document, then obtaining the header fields of all associated downstream documents according to the association data to be queried, so as to query all the upstream documents related to the upstream document. data associated with the associated data to be queried; if there are multiple upstream documents and the associated data to be queried is a header field of an upstream document, header fields of all associated downstream documents are obtained according to the associated data to be queried, and header fields of all associated upstream documents are obtained according to the header field of the associated downstream document, so as to query all data associated with the associated data to be queried; if the associated data to be queried is a header field of a downstream document, header fields of all associated upstream documents are obtained according to the associated data to be queried, and header fields of all associated downstream documents are obtained according to the header field of the associated upstream document, so as to query all data associated with the associated data to be queried.
[0013] In one embodiment of the present invention, based on the above scheme, after associating the upstream document and the downstream document based on the first association and the second association, it also includes: receiving association data query request information, the association data query request information includes the association data to be queried, and determining the association relationship according to the association data to be queried; if the association relationship is the second association relationship, determining the number of the upstream documents according to the second association relationship, and the second association relationship is obtained based on the second association; if the number of the upstream documents is 1, and the association data to be queried is the row field of the upstream document, then obtaining the row fields of all associated downstream documents according to the association data to be queried, so as to query all the associations with the upstream document. data associated with the associated data to be queried; if there are multiple upstream documents and the associated data to be queried is a row field of an upstream document, the row fields of all associated downstream documents are obtained according to the associated data to be queried, and the row fields of all associated upstream documents are obtained according to the row fields of the associated downstream documents, so as to query all data associated with the associated data to be queried; if the associated data to be queried is a row field of a downstream document, the row fields of all associated upstream documents are obtained according to the associated data to be queried, and the row fields of all associated downstream documents are obtained according to the row fields of the associated upstream documents, so as to query all data associated with the associated data to be queried.
[0014] According to one aspect of an embodiment of the present invention, a document association device is provided, comprising: an acquisition module, configured to acquire basic document information of a plurality of documents to be associated, the documents to be associated include upstream documents and downstream documents, the basic document information includes a header field and a line field; a first association module, configured to match the header field of the upstream document with the header field of the downstream document to obtain a first matching result, and then perform a first association on the header field of the upstream document with the header field of the downstream document according to the first matching result to obtain a first association result of each upstream document, the first association result including: The first association module includes at least one downstream document; a second association module is configured to match the row field of the upstream document with the row field of the downstream document to obtain a second matching result, and then perform a second association on the row field of the upstream document and the row field of the downstream document according to the second matching result to obtain a second association result for each upstream document, wherein the second association result includes at least one downstream document; and a third association module is configured to take an intersection of the first association result and the second association result of each upstream document, and if the intersection includes at least one downstream document, associate the downstream document in the intersection with the upstream document.
[0015] According to one aspect of an embodiment of the present invention, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device implements a document association method as described in any one of the above embodiments.
[0016] The present invention also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor of a computer, the computer is enabled to execute the document association method as described in any one of the above embodiments.
[0017] Beneficial effects of the present invention: The present invention provides a document association method, device, electronic device and storage medium. The present invention obtains basic information of multiple documents to be associated, associates the header field of the upstream document with the header field of the downstream document to obtain a first association result, and associates the row field of the upstream document with the row field of the downstream document to obtain a second association result, takes the intersection of the first association result and the second association result of each upstream document, and if the intersection includes at least one downstream document, associates the downstream document in the intersection with an upstream document to associate the upstream document and the downstream document, thereby simplifying the complexity of the association relationship between the upstream document and the downstream document, making the document more convenient to use, improving the efficiency of document search, improving the efficiency and accuracy of document use, reducing the complexity of the relationship between documents, reducing the management cost of documents, and increasing the accuracy and traceability of data in documents, thereby improving user satisfaction.
[0018] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0020] Figure 1 is a schematic diagram of an exemplary system architecture shown in an exemplary embodiment of the present application;
[0021] Figure 2 is a flowchart of a document association method shown in an exemplary embodiment of the present application;
[0022] Figure 3 is a block diagram of a document association device shown in an exemplary embodiment of the present application;
[0023] Figure 4 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0024] The following will describe the embodiments of the present invention with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention, not for limiting the scope of protection of the present invention.
[0025] It should be noted that the illustrations provided in the following embodiments are only used to illustrate the basic concept of the present invention in a schematic manner, and thus the illustrations only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0026] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.
[0027] Figure 1 It is a schematic diagram of an exemplary system architecture shown in an exemplary embodiment of the present application.
[0028] Reference Figure 1 As shown, the system architecture may include a data acquisition device 101 and a computer device 102. The computer device 102 may be at least one of a desktop graphics processing unit (GPU) computer, a GPU computing cluster, a neural network computer, etc. Relevant technicians may use the computer device 102 to process the acquired basic document information of multiple documents to be associated, match the header field of the upstream document with the header field of the downstream document, match the line field of the upstream document with the line field of the downstream document, and associate the upstream document and the downstream document with both of the above two matches successfully. The data acquisition device 101 is used to acquire the basic document information of the document to be associated. In this embodiment, after the data acquisition device 101 acquires the basic document information of the document to be associated, it provides the basic document information of the document to be associated to the computer device 102 for processing. The basic document information of the document to be associated includes but is not limited to the header field of the upstream document, the header field of the downstream document, the line field of the upstream document, and the line field of the downstream document. It should be noted that the data acquisition device 101 and the computer device 102 provided in this embodiment are only an example and should not bring any limitation to the functions and scope of use of the embodiment of the present invention.
[0029] It should be noted that the document association method provided in the embodiment of the present application is generally executed by the computer device 102 , and accordingly, the document association device is generally set in the computer device 102 .
[0030] Figure 2 is a flowchart of a document association method shown in an exemplary embodiment of the present application. The document association method can be executed by a computing processing device. The computing processing device can be Figure 1 The computer device 102 shown in FIG. Figure 2 As shown, the document association method includes at least steps S210 to S240, which are described in detail as follows:
[0031] In step S210, basic document information of multiple documents to be associated is obtained.
[0032] In one embodiment of the present application, basic document information of multiple documents to be associated is obtained, and the documents to be associated include upstream documents and downstream documents, and the basic document information includes but is not limited to header fields and line fields. Upstream documents refer to documents that directly generate downstream documents, and downstream documents are documents derived from upstream documents or filled out based on upstream document information. For example, in a procurement business process, a purchase order is an upstream document, and an incoming document is a downstream document. In a sales business process, a sales order is an upstream document, and an outgoing document is a downstream document.
[0033] In step S220, the header field of the upstream document is matched with the header field of the downstream document to obtain a first matching result, and then the header field of the upstream document is first associated with the header field of the downstream document according to the first matching result to obtain a first association result for each upstream document.
[0034] In one embodiment of the present application, the header field of the upstream document is matched with the header field of the downstream document. If the match is successful, the header field of the successfully matched upstream document and the header field of the downstream document are determined as the first matching result. The first matching result includes that the header field of multiple downstream documents matches the header field of multiple upstream documents, that is, the header field of multiple downstream documents includes the header field of multiple upstream documents, wherein the number of upstream documents is equal to the number of downstream documents; the first matching result includes that the header field of multiple downstream documents matches the header field of one downstream document, that is, the header field of each downstream document only includes the header field of the one upstream document; the first matching result also includes that the header field of one upstream document matches the header fields of multiple downstream documents, that is, the header field of multiple downstream documents only includes the header field of the one upstream document.
[0035] In one embodiment of the present application, if the first matching result is that the header field of the downstream document includes the header fields of all upstream documents, and the number of upstream documents is equal to the number of downstream documents, that is, the ratio of the number of upstream documents to the number of downstream documents is N:N, then the header field of the upstream document that matches each other is associated with the header field of the downstream document to obtain the first association result of each upstream document. If the first matching result is that the header field of each downstream document only includes the header field of the upstream document, and the number of upstream documents is 1, that is, the ratio of the number of upstream documents to the number of downstream documents is 1:N, then the header field of the upstream document that matches each other is associated with the header field of the downstream document to obtain the first association result of each upstream document. If the first matching result is that the header field of the downstream document includes the header field of all upstream documents, and the number of downstream documents is 1, that is, the ratio of the number of upstream documents to the number of downstream documents is N:1, then the header field of the upstream document that matches each other is associated with the header field of the downstream document to obtain the first association result of each upstream document. If the number of upstream documents and the number of downstream documents are both 1, the header fields of the upstream documents and the header fields of the downstream documents that match each other are preferentially associated according to the first matching result that the header field of each downstream document only includes the header field of the upstream document, and the number of upstream documents is 1, that is, the ratio of the number of upstream documents to the number of downstream documents is 1:N. The above first association result includes at least one downstream document.
[0036] In step S230, the row fields of the upstream document are matched with the row fields of the downstream document to obtain a second matching result, and then the row fields of the upstream document are second associated with the row fields of the downstream document according to the second matching result to obtain a second association result for each upstream document.
[0037] In one embodiment of the present application, the row fields of the upstream document are matched with the row fields of the downstream document. If the match is successful, the row fields of the successfully matched upstream document and the row fields of the downstream document are determined as the second matching result, and the second matching result includes that the row fields of multiple downstream documents match the row fields of multiple upstream documents, that is, the row fields of multiple downstream documents include the row fields of multiple upstream documents, wherein the number of upstream documents is equal to the number of downstream documents; the second matching result includes that the row fields of multiple downstream documents match the row fields of one downstream document, that is, the row fields of each downstream document only include the row fields of the one upstream document; the second matching result also includes that the row fields of one upstream document match the row fields of multiple downstream documents, that is, the row fields of multiple downstream documents only include the row fields of the one upstream document.
[0038] In one embodiment of the present application, if the second matching result is that the row fields of the downstream document include the row fields of all upstream documents, the row fields of the upstream document and the row fields of the downstream document are secondly associated according to the second matching result; if the second matching result is that the row fields of each downstream document only include the row fields of the upstream document, the row fields of the upstream document and the row fields of the downstream document are secondly associated according to the second matching result.
[0039] In this embodiment, if the second matching result is that the row fields of the downstream document include the row fields of all upstream documents, and the number of upstream documents is equal to the number of downstream documents, that is, the ratio of the number of upstream documents to the number of downstream documents is N:N, then the row fields of the upstream documents that match each other are associated with the row fields of the downstream documents to obtain the second association result of each upstream document. If the second matching result is that the row fields of each downstream document only include the row fields of the upstream document, and the number of upstream documents is 1, that is, the ratio of the number of upstream documents to the number of downstream documents is 1:N, then the row fields of the upstream documents that match each other are associated with the row fields of the downstream documents to obtain the second association result of each upstream document. If the second matching result is that the row fields of the downstream document include the row fields of all upstream documents, and the number of downstream documents is 1, that is, the ratio of the number of upstream documents to the number of downstream documents is N:1, then the row fields of the upstream documents that match each other are associated with the row fields of the downstream documents to obtain the second association result of each upstream document. If the number of upstream documents and the number of downstream documents are both 1, the row fields of the upstream document and the row fields of the downstream document that match each other are preferentially associated according to the second matching result that the row fields of each downstream document only include the row fields of the upstream document and the number of upstream documents is 1, that is, the ratio of the number of upstream documents to the number of downstream documents is 1:N. The above second association result includes at least one downstream document.
[0040] In one embodiment of the present application, after matching the header field of the upstream document with the header field of the downstream document, if the match fails, the following steps are performed: generating multiple new header fields of the downstream document according to the header fields of multiple upstream documents, the number of header fields of the upstream document is equal to the number of header fields of the downstream document, so as to update or increase the header field of the corresponding downstream document; generating multiple new header fields of the downstream document according to the header field of an upstream document, the header field of the downstream document is derived only from the header field of the upstream document, so as to update or increase the header field of the corresponding downstream document; generating a new header field of the downstream document according to the header fields of multiple upstream documents, so as to update or increase the header field of the corresponding downstream document.
[0041] In this embodiment, the present application supports the header fields of multiple upstream documents to generate the header fields of one or more downstream documents, but the content of the header fields of the upstream documents must all be given to the header fields of the one or more downstream documents, that is, the content of the header fields of the upstream documents does not support being split into the header fields of the downstream documents. When multiple downstream documents are generated, the number of upstream documents is the same as the number of downstream documents. The present application also supports one upstream document to generate multiple downstream documents, but the content of the header field of each downstream document can only come from the header field of the one upstream document, and multiple documents cannot be combined to generate the header field content of the one downstream document. It should be noted that a document can only use one of the above two association methods, and cannot use both at the same time, that is, once the header field of an upstream document starts to generate the header field of the document, it can no longer be combined with the header field of other documents to generate the header field of the downstream document.
[0042] In one embodiment of the present application, after the row fields of the upstream document and the row fields of the downstream document are matched, if the match fails, any one of the following is included: generating multiple new row fields of the downstream document based on the row fields of multiple upstream documents, the number of the row fields of the upstream document is equal to the number of the row fields of the downstream document, so as to update or increase the row fields of the corresponding downstream document; generating multiple new row fields of the downstream document based on the row fields of one upstream document, the row fields of the downstream document are only derived from the row fields of the upstream document, so as to update or increase the row fields of the corresponding downstream document; generating a new row field of the downstream document based on the row fields of multiple upstream documents, so as to update or increase the row fields of the corresponding downstream document.
[0043] In this embodiment, the present application supports the generation of one or more downstream document row fields from multiple upstream documents, but the content of the row fields of the upstream documents must all be given to the row fields of the one or more downstream documents, that is, the content of the row fields of the upstream documents does not support splitting to the row fields of downstream documents. When generating multiple downstream documents, the number of upstream documents is the same as the number of downstream documents. The present application also supports one upstream document to generate multiple downstream documents, but the content of the row fields of each downstream document can only come from the row fields of this one upstream document, and multiple documents cannot be combined to generate the row field content of this one downstream document. It should be noted that a document can only use one of the above two association methods, and cannot use both at the same time, that is, once the row fields of an upstream document start to generate the row fields of the document downward, it can no longer be combined with the row fields of other documents to generate the row fields of the downstream document.
[0044] In step S240, the intersection of the first association result and the second association result of each upstream document is taken. If the intersection includes at least one downstream document, the downstream document in the intersection is associated with an upstream document.
[0045] In one embodiment of the present application, the upstream document and the downstream document are associated based on the association between the header field of the upstream document and the header field of the downstream document in the intersection and the row field of the upstream document and the row field of the downstream document in the intersection. That is, the document association includes the association between the header field of the upstream document and the header field of the downstream document and the association between the row field of the upstream document and the row field of the downstream document. The document association is more accurate through the dual association of the header field and the row field.
[0046] In one embodiment of the present application, after associating the upstream document with the downstream document based on the first association and the second association, the method further includes: receiving association data query request information, the association data query request information includes the association data to be queried, and determining the association relationship according to the association data to be queried; if the association relationship is the first association relationship, determining the number of upstream documents according to the first association relationship, and the first association is obtained based on the first association; if the number of upstream documents is 1, and the association data to be queried is the header field of the upstream document, obtaining the header fields of all associated downstream documents according to the association data to be queried, so as to query all data that has an association relationship with the association data to be queried; if If there are multiple upstream documents and the associated data to be queried is the header field of the upstream document, the header fields of all associated downstream documents are obtained according to the associated data to be queried, and the header fields of all associated upstream documents are obtained according to the header field of the associated downstream document, so as to query all data associated with the associated data to be queried; if the associated data to be queried is the header field of the downstream document, no matter there are one or more upstream documents, the header fields of all associated upstream documents are obtained according to the associated data to be queried, and the header fields of all associated downstream documents are obtained according to the header field of the associated upstream document, so as to query all data associated with the associated data to be queried.
[0047] In one embodiment of the present application, after associating the upstream document and the downstream document based on the first association and the second association, the method further includes: receiving association data query request information, the association data query request information includes the association data to be queried, and determining the association relationship according to the association data to be queried; if the association relationship is the second association relationship, determining the number of upstream documents according to the second association relationship, and the second association is obtained based on the second association; if the number of upstream documents is 1, and the association data to be queried is a row field of the upstream document, then obtaining the row fields of all associated downstream documents according to the association data to be queried, so as to query all data having an association relationship with the association data to be queried; if If there are multiple upstream documents and the associated data to be queried is a row field of an upstream document, the row fields of all associated downstream documents are obtained based on the associated data to be queried, and the row fields of all associated upstream documents are obtained based on the row fields of the associated downstream documents, so as to query all data associated with the associated data to be queried; if the associated data to be queried is a row field of a downstream document, no matter there are one or more upstream documents, the row fields of all associated upstream documents are obtained based on the associated data to be queried, and the row fields of all associated downstream documents are obtained based on the row fields of the associated upstream documents, so as to query all data associated with the associated data to be queried.
[0048] The present application matches the header field of an upstream document with the header field of a downstream document, matches the line field of an upstream document with the line field of a downstream document, and associates the upstream document and the downstream document in which the above matches are successful. The upstream document and the downstream document can be accurately associated, which speeds up the document association process, simplifies the document association process and the business processing process, reduces the problem of data inconsistency, speeds up the transmission speed of information in the document, and thus improves user satisfaction.
[0049] Figure 3 is a block diagram of a document association device shown in an exemplary embodiment of the present application. The device can be applied to Figure 1 The implementation environment shown in the figure is specifically configured in the computer device 102. The device can also be applied to other exemplary implementation environments and specifically configured in other devices. This embodiment does not limit the implementation environment to which the device is applied.
[0050] like Figure 3 As shown, the exemplary document associating device includes: an acquisition module 310 , a first associating module 320 , a second associating module 330 and a third associating module 340 .
[0051] The acquisition module 310 is configured to acquire basic document information of multiple documents to be associated, the documents to be associated include upstream documents and downstream documents, and the basic document information includes a header field and a row field; the first association module 320 is configured to match the header field of the upstream document with the header field of the downstream document to obtain a first matching result, and then perform a first association between the header field of the upstream document and the header field of the downstream document according to the first matching result to obtain a first association result for each upstream document, and the first association result includes at least one downstream document; the second association module 330 is configured to match the row field of the upstream document with the row field of the downstream document to obtain a second matching result, and then perform a second association between the row field of the upstream document and the row field of the downstream document according to the second matching result to obtain a second association result for each upstream document, and the second association result includes at least one downstream document; the third association module 340 is configured to take the intersection of the first association result and the second association result of each upstream document, and if the intersection includes at least one downstream document, associate the downstream document in the intersection with an upstream document.
[0052] It should be noted that the document association device provided in the above embodiment and the document association method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment, and will not be repeated here. In actual application, the document association device provided in the above embodiment can allocate the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.
[0053] An embodiment of the present invention also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the electronic device implements the document association method provided in the above-mentioned embodiments.
[0054] Figure 4 The structure diagram of the computer system of the electronic device suitable for implementing the embodiment of the present invention is shown. It should be noted that: Figure 4 The computer system 400 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0055] like Figure 4As shown, the computer system 400 includes a central processing unit (CPU) 401, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 402 or the program loaded from the storage part 408 to the random access memory (RAM) 403, such as executing the methods provided in the above-mentioned various embodiments. In the RAM 403, various programs and data required for system operation are also stored. The CPU 401, the ROM 402 and the RAM 403 are connected to each other through the bus 404. The input / output (I / O) interface 405 is also connected to the bus 404.
[0056] The following components are connected to the I / O interface 405: an input section 406 including a keyboard, a mouse, etc.; an output section 407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the I / O interface 405 as needed. A removable medium 411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 410 as needed so that a computer program read therefrom is installed into the storage section 408 as needed.
[0057] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 409, and / or installed from a removable medium 411. When the computer program is executed by a central processing unit (CPU) 401, various functions defined in the system of the present invention are executed.
[0058] It should be noted that the computer-readable medium shown in the embodiment of the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable computer program. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0059] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. Among them, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0060] The units involved in the embodiments of the present invention may be implemented by software or hardware, and the units described may also be arranged in a processor. The names of these units do not, in some cases, limit the units themselves.
[0061] Another aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor of a computer, causes the computer to execute the document association method provided in the above-mentioned embodiments. The computer-readable storage medium may be included in the electronic device described in the above-mentioned embodiments, or may exist independently without being assembled into the electronic device.
[0062] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0063] Another aspect of the present application also provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the document association method provided in each of the above embodiments.
[0064] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0065] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.
[0066] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present invention. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. A document association method, characterized in that: include: Obtaining basic document information of multiple documents to be associated, wherein the documents to be associated include upstream documents and downstream documents, and the basic document information includes header fields and line fields; Matching the header field of the upstream document with the header field of the downstream document to obtain a first matching result, and then first associating the header field of the upstream document with the header field of the downstream document according to the first matching result to obtain a first associating result for each upstream document, wherein the first associating result includes at least one downstream document; Matching the row fields of the upstream document with the row fields of the downstream document to obtain a second matching result, and then performing a second association between the row fields of the upstream document and the row fields of the downstream document according to the second matching result to obtain a second association result for each upstream document, wherein the second association result includes at least one downstream document; Take the intersection of the first association result and the second association result of each upstream document, and if the intersection includes at least one downstream document, associate the downstream document in the intersection with the upstream document; Wherein, after matching the header field of the upstream document with the header field of the downstream document, if the match fails, any one of the following is included: Generating a plurality of new header fields of downstream documents according to the header fields of the plurality of upstream documents, the number of the header fields of the upstream documents being equal to the number of the header fields of the downstream documents, so as to update or increase the header fields of the corresponding downstream documents; Generating multiple new header fields of downstream documents according to a header field of the upstream document, wherein the header fields of the downstream documents are derived only from the header fields of the upstream document, so as to update or add the header fields of the corresponding downstream documents; A new header field of a downstream document is generated according to the header fields of the plurality of upstream documents, so as to update or add the header field of the corresponding downstream document.
2. The document association method according to claim 1, characterized in that: The header field of the upstream document is matched with the header field of the downstream document to obtain a first matching result, including any one of the following: If the first matching result is that the header field of the downstream document includes the header fields of all the upstream documents, first associating the header field of the upstream document with the header field of the downstream document according to the first matching result to obtain a first associating result for each upstream document, wherein the first associating result includes at least one downstream document; If the first matching result is that the header field of each downstream document only includes the header field of the upstream document, the header field of the upstream document and the header field of the downstream document are first associated according to the first matching result to obtain a first association result for each upstream document, and the first association result includes at least one downstream document.
3. The document association method according to claim 1, characterized in that: After matching the row fields of the upstream document with the row fields of the downstream document to obtain a second matching result, the second matching result includes any one of the following: If the second matching result is that the row fields of the downstream document include the row fields of all the upstream documents, performing a second association on the row fields of the upstream document and the row fields of the downstream document according to the second matching result to obtain a second association result for each upstream document, wherein the second association result includes at least one downstream document; If the second matching result is that the row fields of each downstream document only include the row fields of the upstream document, the row fields of the upstream document and the row fields of the downstream document are secondly associated according to the second matching result to obtain a second association result for each upstream document, and the second association result includes at least one downstream document.
4. The document association method according to claim 1, characterized in that: After matching the row fields of the upstream document with the row fields of the downstream document, if the match fails, it includes any one of the following: Generate multiple new downstream document row fields according to the multiple upstream document row fields, the number of the upstream document row fields is equal to the number of the downstream document row fields, so as to update or increase the corresponding downstream document row fields; Generate multiple new downstream document row fields according to one upstream document row field, wherein the downstream document row fields are derived only from the upstream document row fields, so as to update or add corresponding downstream document row fields; A new row field of a downstream document is generated according to the row fields of the plurality of upstream documents, so as to update or increase the row field of the corresponding downstream document.
5. The document association method according to any one of claims 1 to 4, characterized in that: After associating the upstream document with the downstream document based on the first association and the second association, the method further includes: receiving associated data query request information, wherein the associated data query request information includes associated data to be queried, and determining an associated relationship according to the associated data to be queried; If the association relationship is a first association relationship, the quantity of the upstream document is determined according to the first association relationship, and the first association relationship is obtained based on the first association; If the number of the upstream documents is 1, and the associated data to be queried is a header field of the upstream document, then the header fields of all associated downstream documents are obtained according to the associated data to be queried, so as to query all data associated with the associated data to be queried; If there are multiple upstream documents, and the to-be-queried related data is a header field of an upstream document, the header fields of all related downstream documents are obtained according to the to-be-queried related data, and the header fields of all related upstream documents are obtained according to the header field of the related downstream document, so as to query all data associated with the to-be-queried related data; If the associated data to be queried is a header field of a downstream document, the header fields of all associated upstream documents are obtained according to the associated data to be queried, and the header fields of all associated downstream documents are obtained according to the header field of the associated upstream document, so as to query all data associated with the associated data to be queried.
6. The document association method according to any one of claims 1 to 4, characterized in that: After associating the upstream document with the downstream document based on the first association and the second association, the method further includes: receiving associated data query request information, wherein the associated data query request information includes associated data to be queried, and determining an associated relationship according to the associated data to be queried; If the association relationship is a second association relationship, the quantity of the upstream document is determined according to the second association relationship, and the second association relationship is obtained based on the second association; If the number of the upstream documents is 1, and the associated data to be queried is a row field of the upstream document, then the row fields of all associated downstream documents are obtained according to the associated data to be queried, so as to query all data associated with the associated data to be queried; If there are multiple upstream documents, and the to-be-queried related data is a row field of an upstream document, then the row fields of all related downstream documents are obtained according to the to-be-queried related data, and the row fields of all related upstream documents are obtained according to the row fields of the related downstream documents, so as to query all data associated with the to-be-queried related data; If the associated data to be queried is a row field of a downstream document, then the row fields of all associated upstream documents are obtained based on the associated data to be queried, and the row fields of all associated downstream documents are obtained based on the row fields of the associated upstream documents, so as to query all data associated with the associated data to be queried.
7. A document association device, characterized in that: include: An acquisition module, used for acquiring basic document information of a plurality of documents to be associated, wherein the documents to be associated include upstream documents and downstream documents, and the basic document information includes a header field and a line field; a first association module, configured to match the header field of the upstream document with the header field of the downstream document to obtain a first matching result, and then perform a first association between the header field of the upstream document and the header field of the downstream document according to the first matching result to obtain a first association result for each upstream document, wherein the first association result includes at least one downstream document; and further configured to, after matching the header field of the upstream document with the header field of the downstream document, if the matching fails, perform any one of the following: generate a plurality of new header fields of the downstream document according to the header fields of a plurality of the upstream documents, wherein the number of the header fields of the upstream document is equal to the number of the header fields of the downstream document, so as to update or increase the header field of the corresponding downstream document; generate a plurality of new header fields of the downstream document according to the header field of one upstream document, wherein the header field of the downstream document is derived only from the header field of the upstream document, so as to update or increase the header field of the corresponding downstream document; generate a new header field of the downstream document according to the header fields of a plurality of the upstream documents, so as to update or increase the header field of the corresponding downstream document; a second association module, configured to match the row fields of the upstream document with the row fields of the downstream document to obtain a second matching result, and then perform a second association on the row fields of the upstream document with the row fields of the downstream document according to the second matching result to obtain a second association result for each upstream document, wherein the second association result includes at least one downstream document; The third association module is used to obtain the intersection of the first association result and the second association result of each upstream document, and if the intersection includes at least one downstream document, associate the downstream document in the intersection with the upstream document.
8. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the document association method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the document association method according to any one of claims 1 to 6.
