A method and system for automatically generating customs clearance declaration documents

By building a customs clearance declaration rule base and knowledge graph technology, parsing historical files to generate file types and content rules, the problem of cumbersome preparation of customs clearance declaration documents is solved, and efficient and accurate customs clearance declaration document generation is achieved.

CN119226244BActive Publication Date: 2025-09-16SHENZHEN QIANCHENG INTERNET TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411423980.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-12
Publication Date
2025-09-16
Estimated Expiration
2044-10-12

AI Technical Summary

Technical Problem

The preparation process of customs declaration documents is cumbersome and time-consuming, and existing deep learning technology cannot accurately predict the results, resulting in low efficiency of customs declaration.

Method used

Build a customs clearance declaration rule library, generate file type determination rules and content generation rules by parsing historical customs clearance declaration documents, use knowledge graph technology to establish triples and file association relationships, and match basic declaration data to generate customs clearance declaration documents.

Benefits of technology

It achieves accurate and efficient generation of customs clearance declaration documents, reduces document omissions and errors, and improves the processing efficiency of customs clearance declarations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119226244B_ABST
    Figure CN119226244B_ABST
Patent Text Reader

Abstract

The present invention proposes a method and system for automatically generating customs clearance declaration documents. The method and system construct a customs clearance declaration rule library by parsing historical customs clearance declaration documents. The customs clearance declaration rule library includes a file type determination rule for determining the customs clearance declaration document type corresponding to the customs clearance declaration procedure and a file content generation rule for generating the content of each type of customs clearance declaration document. The method matches the file type determination rule corresponding to the basic declaration data in the customs clearance declaration rule library according to a customs clearance declaration document generation request, determines the corresponding customs clearance declaration document type according to the file type determination rule, generates a declaration document list corresponding to the target customs clearance declaration procedure based on the customs clearance declaration document type, and matches the file content generation rule corresponding to each file in the declaration document list in the customs clearance declaration rule library to generate the corresponding customs clearance declaration document. The method can accurately and efficiently generate customs clearance declaration documents.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electronic information technology, and in particular to a method and system for automatically generating customs clearance declaration documents. Background Art

[0002] Customs clearance refers to the formalities required by various laws, regulations, and provisions for importing, exporting, or transshipping goods into or out of a country. The customs clearance process is complex and complex, with numerous tasks. The preparation of customs clearance declaration documents, in particular, consumes a significant amount of time. Depending on the requirements of relevant laws and regulations, the required customs clearance documents vary depending on the import or export situation of the goods involved. Due to the sheer number of regulations covering every aspect of import and export matters, the preparation of customs clearance declaration documents requires extreme meticulousness. Missing documents, or even minor flaws in their content or formatting can affect the customs clearance results, thereby impacting the efficiency of the customs clearance process.

[0003] After years of intensive and orderly customs declaration work, a large number of complete customs declaration documents have accumulated in the customs declaration database. Effectively summarizing and leveraging the experience gained from historical customs declaration documents can improve the efficiency of customs declaration document preparation and reduce the impact of omissions, missing data, and errors in documents on customs declaration results. With the development and maturity of artificial intelligence (AI) technology, the use of deep learning techniques to learn from historical declaration documents in the customs declaration database to summarize declaration experience and thus assist in or automatically generate customs declaration documents is one means of improving the efficiency of customs declaration document preparation. However, the neural network structure of deep learning essentially uses sample data to train the weight matrix and bias terms within a specific neural network structure to gain the neural network model's autonomous judgment and decision-making capabilities. These weight matrices and bias terms are machine-oriented, not user-oriented. In other words, the neural network model can be understood as a black box whose judgment rules are invisible to the user. Before the output is generated, the user cannot foresee whether the output is accurate and reliable. This unpredictability and uncertainty of AI technology makes it unsuitable for rigorous applications such as customs clearance procedures. Summary of the Invention

[0004] Based on the above problems, the present invention proposes a method and system for automatically generating customs clearance declaration documents, which can accurately and efficiently generate customs clearance declaration documents.

[0005] In view of this, a first aspect of the present invention provides a method for automatically generating customs clearance declaration documents, comprising:

[0006] Read historical customs clearance declaration documents from the historical database;

[0007] parsing the historical customs clearance declaration documents to construct a customs clearance declaration rule library, the customs clearance declaration rule library including a file type determination rule for determining a customs clearance declaration document type corresponding to a customs clearance declaration procedure and a file content generation rule for generating the content of each type of customs clearance declaration document;

[0008] receiving a request for generating a customs clearance declaration document for a target customs clearance declaration procedure, wherein the request includes basic declaration data for the target customs clearance declaration procedure;

[0009] Matching the file type determination rules corresponding to the basic declaration data in the customs clearance declaration rule library;

[0010] Determine the corresponding customs clearance declaration document type according to the document type determination rules;

[0011] generating a declaration document list corresponding to the target customs clearance declaration procedure based on the customs clearance declaration document type;

[0012] The file content generation rules corresponding to each file in the declaration file list are matched in the customs clearance declaration rule library to generate the corresponding customs clearance declaration file.

[0013] Furthermore, the step of parsing the historical customs clearance declaration documents to construct a customs clearance declaration rule base specifically includes:

[0014] Generating a file identification mark corresponding to each historical customs clearance declaration file in the historical database;

[0015] Deconstruct the text content of each historical customs clearance declaration document to obtain the text units in the document content;

[0016] Constructing a customs clearance declaration knowledge graph using the text unit as a basic element, wherein the customs clearance declaration knowledge graph includes a triple identifier for each triple;

[0017] Establishing an association relationship between the triples in the customs clearance declaration knowledge graph and each historical customs clearance declaration document;

[0018] Based on the association relationship, the triplet identifier of the triplet is associated with the corresponding historical customs clearance declaration file and stored;

[0019] Generate a triplet set of each customs declaration procedure and a file type set;

[0020] Identify the common features of triples of customs declaration procedures with the same set of document types;

[0021] Establishing a correspondence between the triple common features and the file type set;

[0022] A file type determination rule of the customs clearance declaration rule base is established based on the correspondence between the triple common features and the file type set.

[0023] Furthermore, the step of parsing the historical customs clearance declaration documents to construct a customs clearance declaration rule library further includes:

[0024] Parsing the historical customs clearance declaration documents to obtain format data, content data, and layout data corresponding to each historical customs clearance declaration document;

[0025] The file content generation rules are generated by matching the format data, content data and layout data of historical customs clearance declaration documents of the same type. The file content generation rules include format rules, content rules and layout rules.

[0026] Furthermore, the step of parsing the historical customs clearance declaration files to obtain content data corresponding to each historical customs clearance declaration file specifically includes:

[0027] identifying explicit key-value pairs and implicit key-value pairs in the historical customs clearance declaration file according to the position of the file unit in the historical customs clearance declaration file, wherein the explicit key-value pairs are key-value pairs containing their key names and key values ​​in the text units of the historical customs clearance declaration file, and the implicit key-value pairs are key-value pairs containing only their key values ​​in the text units of the historical customs clearance declaration file;

[0028] Extracting the key names and paragraph numbers of the explicit key-value pairs and the implicit key-value pairs;

[0029] A correspondence between the key name and the paragraph number is established.

[0030] Furthermore, the steps of constructing a customs clearance declaration knowledge graph using the text units as basic elements specifically include:

[0031] Constructing a first element list of the historical customs clearance declaration file, wherein the first element list is a set of key names and key values ​​of the explicit key-value pairs and the implicit key-value pairs;

[0032] Extracting noun elements from the first element list to construct a second element list;

[0033] When the key name and / or key value of any explicit key-value pair or implicit key-value pair in the historical customs clearance file exists in the second element list, identifying the semantic relationship of the corresponding key-value pair and generating a relationship word;

[0034] Determine the noun element in the key-value pair as an entity element of a triple in the customs clearance declaration knowledge graph;

[0035] The other element in the key-value pair and the relational word are respectively determined as the attribute element and the relational element of the triple.

[0036] Furthermore, the steps of identifying the common features of triples of customs clearance declaration procedures with the same set of document types specifically include:

[0037] A triplet set of any customs clearance declaration procedure is selected from the customs clearance declaration procedures having the same document type set and determined as a first triplet set;

[0038] determining a triplet set of other customs clearance declaration procedures except the selected customs clearance declaration procedure among the customs clearance declaration procedures having the same document type set as a second triplet set;

[0039] traversing each triple in the first set of triples to match a triple identifier of the triple with a triple identifier in the second set of triples;

[0040] When any triple in the first triple set exists in all second triple sets at the same time, determining the corresponding triple as a characteristic element of a triple common feature;

[0041] The characteristic elements of the same file type set are combined to generate a triplet common feature corresponding to the file type set.

[0042] Furthermore, the step of matching the document type determination rule corresponding to the basic declaration data in the customs clearance declaration rule library specifically includes:

[0043] Processing the basic declaration data to generate a basic triplet set of the target customs clearance declaration procedure;

[0044] Matching the basic triple set with the triple common features of each file type determination rule;

[0045] When the triplet common feature of any document type determination rule is a subset of the basic triplet set, the customs clearance declaration document type of the target customs clearance declaration procedure is determined based on the corresponding document type determination rule.

[0046] Furthermore, the step of processing the basic declaration data to generate the basic triplet set of the target customs clearance declaration procedure specifically includes:

[0047] Deconstructing the text content of each file in the basic declaration data to obtain text units in the file content;

[0048] Generate corresponding explicit key-value pairs and implicit key-value pairs based on the position and semantic relationship of the text unit in the file;

[0049] The explicit key-value pairs and implicit key-value pairs are matched with the triples in the customs clearance declaration knowledge graph to obtain a basic triple set of the basic declaration data.

[0050] Furthermore, the step of matching the explicit key-value pairs and implicit key-value pairs with the triples in the customs clearance declaration knowledge graph to obtain a basic triple set of the basic declaration data specifically includes:

[0051] extracting entity elements and attribute elements from each file in the basic declaration data;

[0052] Matching the entity element and the attribute element with the entity element and the attribute element of the triple in the customs clearance declaration knowledge graph to determine the triple corresponding to the key-value pair;

[0053] The matched triples are combined to generate the basic triple set.

[0054] A second aspect of the present invention provides a system for automatically generating customs clearance declaration documents, comprising:

[0055] The historical customs clearance declaration file reading module is used to read the historical customs clearance declaration files from the historical database;

[0056] a customs clearance declaration rule base construction module, configured to parse the historical customs clearance declaration documents to construct a customs clearance declaration rule base, wherein the customs clearance declaration rule base includes a file type determination rule for determining the customs clearance declaration document type corresponding to the customs clearance declaration procedure and a file content generation rule for generating the content of each type of customs clearance declaration document;

[0057] a customs clearance declaration document generation request receiving module, configured to receive a customs clearance declaration document generation request for a target customs clearance declaration procedure, wherein the customs clearance declaration document generation request includes basic declaration data of the target customs clearance declaration procedure;

[0058] A file type determination rule matching module, configured to match the file type determination rule corresponding to the basic declaration data in the customs clearance declaration rule library;

[0059] A customs clearance declaration document type determination module, configured to determine the corresponding customs clearance declaration document type according to the document type determination rule;

[0060] A declaration document list generating module, configured to generate a declaration document list corresponding to the target customs clearance declaration procedure based on the customs clearance declaration document type;

[0061] The file content generation rule matching module is used to match the file content generation rule corresponding to each file in the declaration file list in the customs clearance declaration rule library to generate the corresponding customs clearance declaration file.

[0062] The present invention proposes a method and system for automatically generating customs clearance declaration documents. The method and system construct a customs clearance declaration rule library by parsing historical customs clearance declaration documents. The customs clearance declaration rule library includes a file type determination rule for determining the customs clearance declaration document type corresponding to the customs clearance declaration procedure and a file content generation rule for generating the content of each type of customs clearance declaration document. The method matches the file type determination rule corresponding to the basic declaration data in the customs clearance declaration rule library according to a customs clearance declaration document generation request, determines the corresponding customs clearance declaration document type according to the file type determination rule, generates a declaration document list corresponding to the target customs clearance declaration procedure based on the customs clearance declaration document type, and matches the file content generation rule corresponding to each file in the declaration document list in the customs clearance declaration rule library to generate the corresponding customs clearance declaration document. The method can accurately and efficiently generate customs clearance declaration documents. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 This is a flow chart of a method for automatically generating customs clearance declaration documents provided by one embodiment of the present invention;

[0064] Figure 2 The figure is a schematic diagram of a system for automatically generating customs clearance declaration documents provided by one embodiment of the present invention. DETAILED DESCRIPTION

[0065] In order to more clearly understand the above-mentioned objects, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that, in the absence of conflict, the embodiments of the present application and the features therein can be combined with each other.

[0066] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the scope of protection of the present invention is not limited to the specific embodiments disclosed below.

[0067] In the description of the present invention, the term "plurality" refers to two or more. Unless otherwise specified, the terms "upper" and "lower" are based on the orientations or positional relationships shown in the accompanying drawings and are intended solely to facilitate and simplify the description of the present invention. They are not intended to indicate or imply that the devices or components referred to must have a specific orientation, be constructed, or operate in a specific manner. Therefore, they should not be construed as limiting the present invention. The terms "connected," "mounted," and "fixed," etc., should be interpreted broadly. For example, "connected" can refer to fixed, removable, or integral connections; directly or indirectly through an intermediary. A person of ordinary skill in the art will understand the specific meanings of these terms in the present invention based on the specific circumstances. Furthermore, the terms "first," "second," etc., etc., are used for descriptive purposes only and should not be construed to indicate or imply relative importance or to implicitly specify the number of the technical features indicated. Therefore, a feature designated "first," "second," etc., may explicitly or implicitly include one or more of such features. In the description of the present invention, unless otherwise specified, "plurality" means two or more.

[0068] Throughout this specification, terms such as "one embodiment," "some implementations," and "specific examples" indicate that the specific features, structures, materials, or characteristics described in conjunction with that embodiment or example are included in at least one embodiment or example of the present invention. In this specification, schematic representations of these terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0069] A method and system for automatically generating customs declaration documents according to some embodiments of the present invention will be described below with reference to the accompanying drawings.

[0070] like Figure 1 As shown, the first aspect of the present invention provides a method for automatically generating customs clearance declaration documents, comprising:

[0071] Read historical customs clearance declaration documents from the historical database;

[0072] parsing the historical customs clearance declaration documents to construct a customs clearance declaration rule library, the customs clearance declaration rule library including a file type determination rule for determining a customs clearance declaration document type corresponding to a customs clearance declaration procedure and a file content generation rule for generating the content of each type of customs clearance declaration document;

[0073] receiving a request for generating a customs clearance declaration document for a target customs clearance declaration procedure, wherein the request includes basic declaration data for the target customs clearance declaration procedure;

[0074] Matching the file type determination rules corresponding to the basic declaration data in the customs clearance declaration rule library;

[0075] Determine the corresponding customs clearance declaration document type according to the document type determination rules;

[0076] generating a declaration document list corresponding to the target customs clearance declaration procedure based on the customs clearance declaration document type;

[0077] The file content generation rules corresponding to each file in the declaration file list are matched in the customs clearance declaration rule library to generate the corresponding customs clearance declaration file.

[0078] The historical database is a database consisting of various versions of customs clearance declaration documents submitted during each past customs clearance declaration process, including successful and failed declaration results. Furthermore, within the historical database, successful customs clearance declaration documents are used to generate forward customs clearance declaration rules, while failed customs clearance declaration documents are used to generate reverse customs clearance declaration rules.

[0079] The customs declaration rule library consists of a plurality of file type determination rules for determining the customs declaration document type corresponding to the customs declaration procedure, and file content generation rules for generating the content of each type of customs declaration document. The automatic customs declaration document generation system determines the type of customs declaration document to be generated in the customs declaration procedure based on the file type determination rules in the customs declaration rule library, and generates the corresponding customs declaration document based on the file content generation rules in the customs declaration rule library.

[0080] At the customs clearance declaration process level, the customs clearance declaration rule library includes document type determination rules. Each time a customs clearance declaration process is initiated, the document types required for customs clearance declaration will vary depending on the specific goods, transportation methods, import and export types and modes, etc. The technical solution of the present invention generates the document type determination rules by parsing historical customs clearance declaration documents, which are used to determine the type of customs clearance declaration documents required for each customs clearance declaration process. In the technical solution of the present invention, the so-called document type refers to the document content type, such as a contract, invoice, packing list, waybill, insurance policy, or import and export permit, rather than the file encoding format type, such as PDF or DOCX.

[0081] At the customs clearance declaration document level, the customs clearance declaration rule library includes file content generation rules. Each type of customs clearance declaration document corresponds to one or more file content generation rules. Exemplarily, they may include file format rules for constraining the customs clearance declaration file format, file layout rules for constraining the customs clearance document layout, data format rules for constraining the customs clearance file data format, and data range rules for constraining the customs clearance file data range.

[0082] The target customs clearance declaration program is a customs clearance declaration program that requires the generation of customs clearance declaration documents. The basic declaration data is the basic data related to the type of customs clearance declaration documents required to be submitted within the declaration data of the target customs clearance declaration program. The customs clearance declaration document generation request is a request triggered by a user submitting the target customs clearance declaration program upon initiation. This request can be an operation request submitted by a user through a client connected to the automatic customs clearance declaration document generation system, or it can be a request automatically triggered by the automatic customs clearance declaration document generation system based on time conditions or other conditions after the user enters the basic information of the target customs clearance declaration program through the client to initiate the target customs clearance declaration program. The basic declaration data of the target customs clearance declaration program is entered by the user upon initiation of the target customs clearance declaration program or is associated with the target customs clearance program.

[0083] Furthermore, the step of parsing the historical customs clearance declaration documents to construct a customs clearance declaration rule base specifically includes:

[0084] Generating a file identification mark corresponding to each historical customs clearance declaration file in the historical database;

[0085] Deconstruct the text content of each historical customs clearance declaration document to obtain the text units in the document content;

[0086] Constructing a customs clearance declaration knowledge graph using the text unit as a basic element, wherein the customs clearance declaration knowledge graph includes a triple identifier for each triple;

[0087] Establishing an association relationship between the triples in the customs clearance declaration knowledge graph and each historical customs clearance declaration document;

[0088] Based on the association relationship, the triplet identifier of the triplet is associated with the corresponding historical customs clearance declaration file and stored;

[0089] Generate a triplet set of each customs declaration procedure and a file type set;

[0090] Identify the common features of triples of customs declaration procedures with the same set of document types;

[0091] Establishing a correspondence between the triple common features and the file type set;

[0092] A file type determination rule of the customs clearance declaration rule base is established based on the correspondence between the triple common features and the file type set.

[0093] Specifically, the file identification identifier is the unique identifier for each historical customs clearance declaration document in the historical database, used to uniquely identify the corresponding historical customs clearance declaration document in subsequent processing. The triple identifier is the unique identifier used to identify the corresponding triple in the customs clearance declaration knowledge graph. In the technical solution of the above embodiment, the triples in the triple set are all discrete triples, and each triple is represented in the triple set by its corresponding triple identifier. That is, the triple set does not store the associations between individual triples.

[0094] Furthermore, the step of deconstructing the text content of each historical customs clearance declaration document to obtain text units in the document content specifically includes:

[0095] Extracting the text content of the historical customs clearance declaration document;

[0096] Segmenting the text content into the largest semantic units with a single part of speech and complete independent meaning;

[0097] The largest semantic unit is determined as the text unit.

[0098] Specifically, the largest semantic unit with a complete and independent meaning of a single part of speech can be the smallest semantic unit with a complete and independent meaning, such as "company", "date", "name", etc., or it can be a semantic unit with a single part of speech composed of multiple smaller semantic units with complete and independent meanings, such as "XXX Limited Liability Company", where "limited", "liability" and "company" are all semantic units with complete and independent meanings, but after being combined into "XXX Limited Liability Company" to become a larger semantic unit, it still has the characteristics of a single part of speech. Therefore, "XXX Limited Liability Company" is determined as a text unit instead of separately determining "limited", "liability" and "company" as text units.

[0099] The triplet set is a data set consisting of triplet identifiers corresponding to the triplets associated with the customs clearance declaration documents of the customs clearance declaration procedure. Similarly, in the technical solution of the present invention, a unique file type identifier is assigned to each file type to represent each file type. The file type set is a data set consisting of file type identifiers corresponding to the file types included in the customs clearance declaration procedure.

[0100] It should be noted that in the step of deconstructing the text content of each historical customs clearance declaration document to obtain the text units in the file content, it is not limited to extracting text content from files in text formats such as doc, docx, txt, xls, xlsx, etc., but also performing text recognition on image files such as jpg, png or pdf formats to extract text content from these files.

[0101] Furthermore, after the step of generating a triplet set and a file type set for each customs clearance declaration procedure, the method further includes:

[0102] Identify proprietary documents in customs clearance declaration procedures with the same set of document types, where the proprietary documents are customs clearance declaration documents that are not included in other customs clearance declaration procedures with different sets of document types;

[0103] The triplet associated with the proprietary document is configured to have a larger feature weight, and the feature weight is stored in association with the customs clearance declaration procedure containing the proprietary document.

[0104] For example, when a triple in a customs declaration procedure is associated with a proprietary document, it is assigned a feature weight greater than 1, and the weight is accumulated based on its number of appearances in the proprietary document. When a triple in a customs declaration procedure is not associated with a proprietary document, its feature weight is assigned to the default value, such as 1.

[0105] Furthermore, the step of parsing the historical customs clearance declaration documents to construct a customs clearance declaration rule library further includes:

[0106] Parsing the historical customs clearance declaration documents to obtain format data, content data, and layout data corresponding to each historical customs clearance declaration document;

[0107] The file content generation rules are generated by matching the format data, content data and layout data of historical customs clearance declaration documents of the same type. The file content generation rules include format rules, content rules and layout rules.

[0108] Specifically, the format data includes the extension data of the historical customs clearance declaration files, such as docx, pdf, or jpg. When historical files of the same type have the same extension, it is determined that the customs clearance declaration files of that type have the defined file format requirements. In the step of generating the file content generation rule by matching the format data, content data, and layout data of historical customs clearance declaration files of the same type, if any type of customs clearance declaration file has the defined file format requirements, the defined file format is determined as the format rule for the corresponding file type.

[0109] Furthermore, the step of parsing the historical customs clearance declaration files to obtain content data corresponding to each historical customs clearance declaration file specifically includes:

[0110] identifying explicit key-value pairs and implicit key-value pairs in the historical customs clearance declaration file according to the position of the file unit in the historical customs clearance declaration file, wherein the explicit key-value pairs are key-value pairs containing their key names and key values ​​in the text units of the historical customs clearance declaration file, and the implicit key-value pairs are key-value pairs containing only their key values ​​in the text units of the historical customs clearance declaration file;

[0111] Extracting the key names and paragraph numbers of the explicit key-value pairs and the implicit key-value pairs;

[0112] A correspondence between the key name and the paragraph number is established.

[0113] Specifically, the explicit key-value pairs can be derived based on the position and semantic relationship of text units in the historical customs clearance declaration document. For example, the text content "Date: 2024-01-01" in the historical customs clearance declaration document is deconstructed into two text units, "Date" and "2024-01-01". Based on the positional relationship and semantic relationship between these two text units, it can be clearly determined that they are a set of explicit key-value pairs, where "Date" is the key name in the key-value pair and "2024-01-01" is the key value in the key-value pair. Content such as page numbers and titles at various levels in the outline structure are usually not marked as page numbers or first-level or second-level titles in front of their content. However, their implicit key names can be determined by their positional relationship relative to other content in the document, resulting in implicit key-value pairs such as "Page Number: 1".

[0114] Furthermore, the step of matching the content data of historical customs clearance declaration documents of the same type to generate the file content generation rules specifically includes:

[0115] Match the key names and paragraph numbers of historical customs clearance declaration documents of the same type;

[0116] When any key name exists simultaneously in the same type of historical customs clearance declaration documents, the key name is determined as the target key name;

[0117] Calculate the difference in paragraph numbers of the target key name in historical customs clearance declaration documents of the same type;

[0118] When the difference between the paragraph numbers of any key name in the same type of historical customs clearance declaration documents is less than a preset threshold, the correspondence between the key name and the paragraph number is determined as a file content generation rule for the corresponding file type.

[0119] Furthermore, the step of parsing the historical customs clearance declaration documents to obtain the format data corresponding to each historical customs clearance declaration document specifically includes:

[0120] Extracting the layout data of the explicit content in the explicit key-value pair and the implicit key-value pair, wherein the explicit content is the text content contained in the text unit, and the layout data includes data such as the font, color, indentation, and alignment of the explicit content.

[0121] Furthermore, the steps of constructing a customs clearance declaration knowledge graph using the text units as basic elements specifically include:

[0122] Constructing a first element list of the historical customs clearance declaration file, wherein the first element list is a set of key names and key values ​​of the explicit key-value pairs and the implicit key-value pairs;

[0123] Extracting noun elements from the first element list to construct a second element list;

[0124] When the key name and / or key value of any explicit key-value pair or implicit key-value pair in the historical customs clearance file exists in the second element list, identifying the semantic relationship of the corresponding key-value pair and generating a relationship word;

[0125] Determine the noun element in the key-value pair as an entity element of a triple in the customs clearance declaration knowledge graph;

[0126] The other element in the key-value pair and the relational word are respectively determined as the attribute element and the relational element of the triple.

[0127] Specifically, in the technical solution of the above embodiment, the key values ​​and key names in the explicit key-value pairs and implicit key-value pairs in the historical customs clearance declaration file are split into independent text elements, and these text elements are used as basic elements to form the first element list.

[0128] In the step of determining the other element in the key-value pair and the relational term as the triple attribute element and the relational term, respectively, when the noun element in the key-value pair is the key name of the key-value pair, the other element is the key value of the key-value pair. Conversely, when the noun element in the key-value pair is the key value of the key-value pair, the other element is the key name of the key-value pair.

[0129] In the step of extracting noun elements from the first element list for constructing the second element list, the noun elements include words or noun phrases whose part of speech is noun.

[0130] Furthermore, before the step of extracting the elements whose part of speech is noun from the first element list to generate the second element list, the step of performing pronoun replacement is further included, which specifically includes:

[0131] identifying a pronoun element in the first list of elements;

[0132] Performing semantic recognition on the text content in the historical customs clearance document to determine the target word referred to by the pronoun element, wherein the target word is a noun or a noun phrase;

[0133] The target word is used to replace the pronoun element in the first element list.

[0134] In the technical solution of the above embodiment, the steps of establishing the association relationship between the triples in the customs clearance declaration knowledge graph and each historical customs clearance declaration document are specifically as follows:

[0135] When a triple is generated based on an explicit key-value pair and an implicit key-value pair in a historical customs clearance declaration document, establishing an association relationship between the triple identifier of the triple in the customs clearance declaration knowledge graph and the file identification identifier of the historical customs clearance declaration document;

[0136] Alternatively, when a triple generated by an explicit key-value pair or an implicit key-value pair in a historical customs clearance declaration document already exists in the customs clearance declaration knowledge graph, an association relationship is established between the triple identifier of the triple in the customs clearance declaration knowledge graph and the file identification identifier of the historical customs clearance declaration document.

[0137] Furthermore, the steps of identifying the common features of triples of customs clearance declaration procedures with the same set of document types specifically include:

[0138] A triplet set of any customs clearance declaration procedure is selected from the customs clearance declaration procedures having the same document type set and determined as a first triplet set;

[0139] determining a triplet set of other customs clearance declaration procedures except the selected customs clearance declaration procedure among the customs clearance declaration procedures having the same document type set as a second triplet set;

[0140] traversing each triple in the first set of triples to match a triple identifier of the triple with a triple identifier in the second set of triples;

[0141] When any triple in the first triple set exists in all second triple sets at the same time, determining the corresponding triple as a characteristic element of a triple common feature;

[0142] The characteristic elements of the same file type set are combined to generate a triplet common feature corresponding to the file type set.

[0143] In the technical solution of the present invention, the term "identical file type set" refers to the same file type identifiers in the file type sets corresponding to multiple historical customs clearance declaration procedures. The term "identical" herein does not include the same order of the file type identifiers within the file type sets. That is, if every file type identifier included in the file type set corresponding to one historical customs clearance declaration procedure also exists in the file type set corresponding to another historical customs clearance declaration procedure, then the file type sets corresponding to the two historical customs clearance declaration procedures are considered identical. Of course, depending on actual implementation requirements, sequence codes for various file types may also be configured within the file type set to constrain the order of the various file types within the file type set, thereby ensuring that the order of the file type identifiers within the same file type set is also the same.

[0144] In the technical solutions of some embodiments of the present invention, it also includes matching the weight features of triplets that appear simultaneously in the first triple set and the second triple set, and determining triplets with similar weight features as feature elements of a triple common feature.

[0145] Furthermore, the step of matching the document type determination rule corresponding to the basic declaration data in the customs clearance declaration rule library specifically includes:

[0146] Processing the basic declaration data to generate a basic triplet set of the target customs clearance declaration procedure;

[0147] Matching the basic triple set with the triple common features of each file type determination rule;

[0148] When the triplet common feature of any document type determination rule is a subset of the basic triplet set, the customs clearance declaration document type of the target customs clearance declaration procedure is determined based on the corresponding document type determination rule.

[0149] The basic declaration data includes information such as cargo information, cargo order information, cargo transportation information, and import / export types and modes associated with the target customs clearance declaration procedure. The cargo order information specifically includes transaction subject information, address information, and documents such as contracts and invoices of both parties. In some embodiments of the present invention, the customs clearance declaration document generation system establishes a communication connection with an online transaction system, logistics and transportation system, etc. via an API interface, or establishes a communication connection with an enterprise's internal management system via an API interface, and obtains the basic declaration data from the online transaction system, logistics and transportation system, and / or the internal management system.

[0150] Furthermore, the step of processing the basic declaration data to generate the basic triplet set of the target customs clearance declaration procedure specifically includes:

[0151] Deconstructing the text content of each file in the basic declaration data to obtain text units in the file content;

[0152] Generate corresponding explicit key-value pairs and implicit key-value pairs based on the position and semantic relationship of the text unit in the file;

[0153] The explicit key-value pairs and implicit key-value pairs are matched with the triples in the customs clearance declaration knowledge graph to obtain a basic triple set of the basic declaration data.

[0154] Furthermore, the basic triple set is matched with the triple common features of each file type determination rule, specifically by matching the triple identifier corresponding to the characteristic element of the triple common feature of each file type determination rule with the triple identifier of each triple in the basic triple set, and judging whether their triple identifiers are the same. When the triple identifiers corresponding to the triple common features of any file type determination rule exist in the basic triple set, it is determined that the triple common features of the file type determination rule are a subset of the basic triple set.

[0155] Furthermore, the step of matching the explicit key-value pairs and implicit key-value pairs with the triples in the customs clearance declaration knowledge graph to obtain a basic triple set of the basic declaration data specifically includes:

[0156] extracting entity elements and attribute elements from each file in the basic declaration data;

[0157] Matching the entity element and the attribute element with the entity element and the attribute element of the triple in the customs clearance declaration knowledge graph to determine the triple corresponding to the key-value pair;

[0158] The matched triples are combined to generate the basic triple set.

[0159] Furthermore, the step of extracting entity elements and attribute elements from each file in the basic declaration data specifically includes:

[0160] Split the key values ​​and key names in the explicit key-value pairs and implicit key-value pairs in each file in the basic declaration data into independent text elements;

[0161] The third element list is constructed using the text element as a basic element;

[0162] extracting noun elements from the third element list to construct a fourth element list;

[0163] When the key name and / or key value of any explicit key-value pair or implicit key-value pair exists in the fourth element list, determining the noun element in the corresponding key-value pair as an entity element of a triple;

[0164] The other element in the key-value pair is determined as an attribute element of the triple.

[0165] Furthermore, the step of matching the file content generation rules corresponding to each file in the declaration file list in the customs clearance declaration rule library to generate the corresponding customs clearance declaration file specifically includes:

[0166] Obtaining declaration data of the target customs clearance declaration procedure from the docked data interface;

[0167] The declaration data is processed according to the file content generation rules corresponding to each file in the declaration file list to generate a corresponding customs clearance declaration file.

[0168] like Figure 2 As shown, the second aspect of the present invention provides a system for automatically generating customs clearance declaration documents, comprising:

[0169] The historical customs clearance declaration file reading module is used to read the historical customs clearance declaration files from the historical database;

[0170] a customs clearance declaration rule base construction module, configured to parse the historical customs clearance declaration documents to construct a customs clearance declaration rule base, wherein the customs clearance declaration rule base includes a file type determination rule for determining the customs clearance declaration document type corresponding to the customs clearance declaration procedure and a file content generation rule for generating the content of each type of customs clearance declaration document;

[0171] a customs clearance declaration document generation request receiving module, configured to receive a customs clearance declaration document generation request for a target customs clearance declaration procedure, wherein the customs clearance declaration document generation request includes basic declaration data of the target customs clearance declaration procedure;

[0172] A file type determination rule matching module, configured to match the file type determination rule corresponding to the basic declaration data in the customs clearance declaration rule library;

[0173] A customs clearance declaration document type determination module, configured to determine the corresponding customs clearance declaration document type according to the document type determination rule;

[0174] A declaration document list generating module, configured to generate a declaration document list corresponding to the target customs clearance declaration procedure based on the customs clearance declaration document type;

[0175] The file content generation rule matching module is used to match the file content generation rule corresponding to each file in the declaration file list in the customs clearance declaration rule library to generate the corresponding customs clearance declaration file.

[0176] The historical database is a database consisting of various versions of customs clearance declaration documents submitted during each past customs clearance declaration process, including successful and failed declaration results. Furthermore, within the historical database, successful customs clearance declaration documents are used to generate forward customs clearance declaration rules, while failed customs clearance declaration documents are used to generate reverse customs clearance declaration rules.

[0177] The customs declaration rule library consists of a plurality of file type determination rules for determining the customs declaration document type corresponding to the customs declaration procedure, and file content generation rules for generating the content of each type of customs declaration document. The automatic customs declaration document generation system determines the type of customs declaration document to be generated in the customs declaration procedure based on the file type determination rules in the customs declaration rule library, and generates the corresponding customs declaration document based on the file content generation rules in the customs declaration rule library.

[0178] At the customs clearance declaration process level, the customs clearance declaration rule library includes document type determination rules. Each time a customs clearance declaration process is initiated, the document types required for customs clearance declaration will vary depending on the specific goods, transportation methods, import and export types and modes, etc. The technical solution of the present invention generates the document type determination rules by parsing historical customs clearance declaration documents, which are used to determine the type of customs clearance declaration documents required for each customs clearance declaration process. In the technical solution of the present invention, the so-called document type refers to the document content type, such as a contract, invoice, packing list, waybill, insurance policy, or import and export permit, rather than the file encoding format type, such as PDF or DOCX.

[0179] At the customs clearance declaration document level, the customs clearance declaration rule library includes file content generation rules. Each type of customs clearance declaration document corresponds to one or more file content generation rules. Exemplarily, they may include file format rules for constraining the customs clearance declaration file format, file layout rules for constraining the customs clearance document layout, data format rules for constraining the customs clearance file data format, and data range rules for constraining the customs clearance file data range.

[0180] The target customs clearance declaration program is a customs clearance declaration program that requires the generation of customs clearance declaration documents. The basic declaration data is the basic data related to the type of customs clearance declaration documents required to be submitted within the declaration data of the target customs clearance declaration program. The customs clearance declaration document generation request is a request triggered by a user submitting the target customs clearance declaration program upon initiation. This request can be an operation request submitted by a user through a client connected to the automatic customs clearance declaration document generation system, or it can be a request automatically triggered by the automatic customs clearance declaration document generation system based on time conditions or other conditions after the user enters the basic information of the target customs clearance declaration program through the client to initiate the target customs clearance declaration program. The basic declaration data of the target customs clearance declaration program is entered by the user upon initiation of the target customs clearance declaration program or is associated with the target customs clearance program.

[0181] Furthermore, the customs clearance declaration rule base construction module includes:

[0182] A document identification mark generation module, used to generate a document identification mark corresponding to each historical customs clearance declaration document in the historical database;

[0183] A text content deconstruction module is used to deconstruct the text content of each historical customs clearance declaration document to obtain text units in the document content;

[0184] A customs clearance declaration knowledge graph construction module, configured to construct a customs clearance declaration knowledge graph using the text unit as a basic element, wherein the customs clearance declaration knowledge graph includes a triple identifier for each triple;

[0185] An association relationship establishment module, used to establish an association relationship between the triples in the customs clearance declaration knowledge graph and each historical customs clearance declaration document;

[0186] an association storage module, configured to associate and store the triplet identifier of the triplet with the corresponding historical customs clearance declaration file based on the association relationship;

[0187] A data set generation module, used to generate a triple set and a file type set for each customs clearance declaration procedure;

[0188] A triplet common feature recognition module, used to identify triplet common features of customs clearance declaration procedures with the same set of document types;

[0189] A correspondence establishing module, configured to establish a correspondence between the common features of the triples and the set of file types;

[0190] The file type determination rule establishing module is used to establish the file type determination rules of the customs clearance declaration rule library based on the corresponding relationship between the triple common features and the file type set.

[0191] Specifically, the file identification identifier is the unique identifier for each historical customs clearance declaration document in the historical database, used to uniquely identify the corresponding historical customs clearance declaration document in subsequent processing. The triple identifier is the unique identifier used to identify the corresponding triple in the customs clearance declaration knowledge graph. In the technical solution of the above embodiment, the triples in the triple set are all discrete triples, and each triple is represented in the triple set by its corresponding triple identifier. That is, the triple set does not store the associations between individual triples.

[0192] Furthermore, the text content deconstruction module includes:

[0193] A text content extraction module, used to extract the text content of the historical customs clearance declaration document;

[0194] A maximum semantic unit segmentation module is used to segment the text content into maximum semantic units with a single part of speech and complete independent meaning;

[0195] The text unit determination module is configured to determine the largest semantic unit as the text unit.

[0196] Specifically, the largest semantic unit with a complete and independent meaning of a single part of speech can be the smallest semantic unit with a complete and independent meaning, such as "company", "date", "name", etc., or it can be a semantic unit with a single part of speech composed of multiple smaller semantic units with complete and independent meanings, such as "XXX Limited Liability Company", where "limited", "liability" and "company" are all semantic units with complete and independent meanings, but after being combined into "XXX Limited Liability Company" to become a larger semantic unit, it still has the characteristics of a single part of speech. Therefore, "XXX Limited Liability Company" is determined as a text unit instead of separately determining "limited", "liability" and "company" as text units.

[0197] The triplet set is a data set consisting of triplet identifiers corresponding to the triplets associated with the customs clearance declaration documents of the customs clearance declaration procedure. Similarly, in the technical solution of the present invention, a unique file type identifier is assigned to each file type to represent each file type. The file type set is a data set consisting of file type identifiers corresponding to the file types included in the customs clearance declaration procedure.

[0198] It should be noted that in the step of deconstructing the text content of each historical customs clearance declaration document to obtain the text units in the file content, it is not limited to extracting text content from files in text formats such as doc, docx, txt, xls, xlsx, etc., but also performing text recognition on image files such as jpg, png or pdf formats to extract text content from these files.

[0199] Furthermore, the customs clearance declaration rule base construction module also includes:

[0200] A proprietary document identification module, configured to identify proprietary documents in customs clearance declaration procedures having the same set of document types, wherein the proprietary documents are customs clearance declaration documents not included in other customs clearance declaration procedures having different sets of document types;

[0201] A feature weight configuration module is used to configure a triplet associated with the proprietary document to have a larger feature weight, wherein the feature weight is stored in association with the customs clearance declaration procedure containing the proprietary document.

[0202] For example, when a triple in a customs declaration procedure is associated with a proprietary document, it is assigned a feature weight greater than 1, and the weight is accumulated based on its number of appearances in the proprietary document. When a triple in a customs declaration procedure is not associated with a proprietary document, its feature weight is assigned to the default value, such as 1.

[0203] Furthermore, the customs clearance declaration rule base construction module also includes:

[0204] A historical customs clearance declaration file parsing module, used to parse the historical customs clearance declaration files to obtain format data, content data and layout data corresponding to each historical customs clearance declaration file;

[0205] The file content generation rule generation module is used to match the format data, content data and layout data of historical customs clearance declaration documents of the same type to generate the file content generation rules, which include format rules, content rules and layout rules.

[0206] Specifically, the format data includes the extension data of the historical customs clearance declaration files, such as docx, pdf, or jpg. When historical files of the same type have the same extension, it is determined that the customs clearance declaration files of that type have the defined file format requirements. In the step of generating the file content generation rule by matching the format data, content data, and layout data of historical customs clearance declaration files of the same type, if any type of customs clearance declaration file has the defined file format requirements, the defined file format is determined as the format rule for the corresponding file type.

[0207] Furthermore, the historical customs clearance declaration document parsing module includes:

[0208] a key-value pair identification module, configured to identify explicit key-value pairs and implicit key-value pairs in a historical customs clearance declaration file based on the position of a file unit in the historical customs clearance declaration file, wherein an explicit key-value pair is a key-value pair containing its key name and key value in a text unit of the historical customs clearance declaration file, and an implicit key-value pair is a key-value pair containing only its key value in a text unit of the historical customs clearance declaration file;

[0209] A key-value pair data extraction module, configured to extract the key names and paragraph numbers of the explicit key-value pairs and the implicit key-value pairs;

[0210] The corresponding relationship establishing module is used to establish the corresponding relationship between the key name and the paragraph number.

[0211] Specifically, the explicit key-value pairs can be derived based on the position and semantic relationship of text units in the historical customs clearance declaration document. For example, the text content "Date: 2024-01-01" in the historical customs clearance declaration document is deconstructed into two text units, "Date" and "2024-01-01". Based on the positional relationship and semantic relationship between these two text units, it can be clearly determined that they are a set of explicit key-value pairs, where "Date" is the key name in the key-value pair and "2024-01-01" is the key value in the key-value pair. Content such as page numbers and titles at various levels in the outline structure are usually not marked as page numbers or first-level or second-level titles in front of their content. However, their implicit key names can be determined by their positional relationship relative to other content in the document, resulting in implicit key-value pairs such as "Page Number: 1".

[0212] Furthermore, the file content generation rule generation module includes:

[0213] Key-value pair data matching module, used to match key names and paragraph numbers of historical customs clearance declaration documents of the same type;

[0214] a target key name determination module, configured to determine any key name as a target key name when the key name exists simultaneously in historical customs clearance declaration documents of the same type;

[0215] A paragraph number difference calculation module, used to calculate the paragraph number difference of the target key name in historical customs clearance declaration documents of the same type;

[0216] The file content generation rule determination module is used to determine the correspondence between any key name and the paragraph number as the file content generation rule for the corresponding file type when the difference between the paragraph numbers of any key name in historical customs clearance declaration files of the same type is less than a preset threshold.

[0217] Furthermore, the historical customs clearance declaration document parsing module includes:

[0218] The layout data extraction module is used to extract the layout data of the explicit content in the explicit key-value pairs and the implicit key-value pairs, wherein the explicit content is the text content contained in the text unit, and the layout data includes the font, color, indentation, alignment and other data of the explicit content.

[0219] Furthermore, the customs clearance declaration knowledge graph construction module includes:

[0220] A first element list construction module, configured to construct a first element list of the historical customs clearance declaration document, wherein the first element list is a collection of key names and key values ​​of the explicit key-value pairs and the implicit key-value pairs;

[0221] A second element list construction module, configured to extract noun elements from the first element list for constructing a second element list;

[0222] a relationship word generation module, configured to, when the key name and / or key value of any explicit key-value pair or implicit key-value pair in the historical customs clearance document exists in the second element list, identify the semantic relationship of the corresponding key-value pair and generate a relationship word;

[0223] An entity element determination module, configured to determine the noun element in the key-value pair as an entity element of a triple in the customs clearance declaration knowledge graph;

[0224] The attribute element and relationship element determination module is used to determine the other element in the key-value pair and the relationship word as the attribute element and relationship element of the triple respectively.

[0225] Specifically, in the technical solution of the above embodiment, the key values ​​and key names in the explicit key-value pairs and implicit key-value pairs in the historical customs clearance declaration file are split into independent text elements, and these text elements are used as basic elements to form the first element list.

[0226] In the step of determining the other element in the key-value pair and the relational term as the triple attribute element and the relational term, respectively, when the noun element in the key-value pair is the key name of the key-value pair, the other element is the key value of the key-value pair. Conversely, when the noun element in the key-value pair is the key value of the key-value pair, the other element is the key name of the key-value pair.

[0227] In the step of extracting noun elements from the first element list for constructing the second element list, the noun elements include words or noun phrases whose part of speech is noun.

[0228] Furthermore, the customs clearance declaration knowledge graph construction module also includes a pronoun replacement module, which specifically includes:

[0229] a pronoun element recognition module, configured to recognize pronoun elements in the first element list;

[0230] a target word determination module, configured to perform semantic recognition on the text content in the historical customs clearance document to determine the target word referred to by the pronoun element, wherein the target word is a noun or a noun phrase;

[0231] A pronoun element replacement module is used to replace the pronoun elements in the first element list with the target word.

[0232] In the technical solution of the above embodiment, the association relationship establishment module is specifically configured to establish an association relationship between a triple identifier of the triple in the customs clearance declaration knowledge graph and a file identification identifier of the historical customs clearance declaration file when a triple is generated based on an explicit key-value pair and an implicit key-value pair in a historical customs clearance declaration file;

[0233] Alternatively, when a triple generated by an explicit key-value pair or an implicit key-value pair in a historical customs clearance declaration document already exists in the customs clearance declaration knowledge graph, an association relationship is established between the triple identifier of the triple in the customs clearance declaration knowledge graph and the file identification identifier of the historical customs clearance declaration document.

[0234] Furthermore, the triple common feature recognition module includes:

[0235] A first triplet set determining module, configured to select a triplet set of any customs clearance declaration procedure from customs clearance declaration procedures having the same file type set and determine the triplet set as a first triplet set;

[0236] a second triplet set determining module, configured to determine, as a second triplet set, a triplet set of customs clearance declaration programs other than the selected customs clearance declaration program among customs clearance declaration programs having the same file type set;

[0237] a triple identifier matching module for traversing each triple in the first triple set to match the triple identifier of the triple with the triple identifier in the second triple set;

[0238] a characteristic element determining module, configured to, when any triple in the first triple set exists in all second triple sets at the same time, determine the corresponding triple as a characteristic element of a triple common feature;

[0239] The characteristic elements of the same file type set are combined to generate a triplet common feature corresponding to the file type set.

[0240] In the technical solution of the present invention, the term "identical file type set" refers to the same file type identifiers in the file type sets corresponding to multiple historical customs clearance declaration procedures. The term "identical" herein does not include the same order of the file type identifiers within the file type sets. That is, if every file type identifier included in the file type set corresponding to one historical customs clearance declaration procedure also exists in the file type set corresponding to another historical customs clearance declaration procedure, then the file type sets corresponding to the two historical customs clearance declaration procedures are considered identical. Of course, depending on actual implementation requirements, sequence codes for various file types may also be configured within the file type set to constrain the order of the various file types within the file type set, thereby ensuring that the order of the file type identifiers within the same file type set is also the same.

[0241] In the technical solutions of some embodiments of the present invention, it also includes matching the weight features of triplets that appear simultaneously in the first triple set and the second triple set, and determining triplets with similar weight features as feature elements of a triple common feature.

[0242] Furthermore, the file type determination rule matching module includes:

[0243] a basic triplet set generation module, configured to process the basic declaration data to generate a basic triplet set for the target customs clearance declaration procedure;

[0244] A triplet common feature matching module, configured to match the basic triplet set with the triplet common features of each file type determination rule;

[0245] The customs clearance declaration document type determination module is used to determine the customs clearance declaration document type of the target customs clearance declaration procedure based on the corresponding file type determination rule when the triple common feature of any file type determination rule is a subset of the basic triple set.

[0246] The basic declaration data includes information such as cargo information, cargo order information, cargo transportation information, and import / export types and modes associated with the target customs clearance declaration procedure. The cargo order information specifically includes transaction subject information, address information, and documents such as contracts and invoices of both parties. In some embodiments of the present invention, the customs clearance declaration document generation system establishes a communication connection with an online transaction system, logistics and transportation system, etc. via an API interface, or establishes a communication connection with an enterprise's internal management system via an API interface, and obtains the basic declaration data from the online transaction system, logistics and transportation system, and / or the internal management system.

[0247] Furthermore, the basic triple set generation module includes:

[0248] A text content deconstruction module, used for deconstructing the text content of each file in the basic declaration data to obtain text units in the file content;

[0249] A key-value pair generation module, configured to generate corresponding explicit key-value pairs and implicit key-value pairs based on the position and semantic relationship of the text unit in the file;

[0250] A triple matching module is used to match the explicit key-value pairs and implicit key-value pairs with the triples in the customs clearance declaration knowledge graph to obtain a basic triple set of the basic declaration data.

[0251] Furthermore, the basic triple set is matched with the triple common features of each file type determination rule, specifically by matching the triple identifier corresponding to the characteristic element of the triple common feature of each file type determination rule with the triple identifier of each triple in the basic triple set, and judging whether their triple identifiers are the same. When the triple identifiers corresponding to the triple common features of any file type determination rule exist in the basic triple set, it is determined that the triple common features of the file type determination rule are a subset of the basic triple set.

[0252] Furthermore, the triple matching module includes:

[0253] An entity element and attribute element extraction module, configured to extract entity elements and attribute elements from each file in the basic declaration data;

[0254] An entity element and attribute element matching module, configured to match the entity element and attribute element with the entity element and attribute element of the triple in the customs clearance declaration knowledge graph to determine the triple corresponding to the key-value pair;

[0255] The triple matching module is specifically configured to combine the matched triples to generate the basic triple set.

[0256] Furthermore, the entity element and attribute element extraction module includes:

[0257] A text element splitting module is used to split the key values ​​and key names in the explicit key-value pairs and implicit key-value pairs in each file in the basic declaration data into independent text elements;

[0258] A third element list construction module, configured to construct the third element list using the text element as a basic element;

[0259] a fourth element list construction module, configured to extract noun elements from the third element list for constructing a fourth element list;

[0260] an entity element determination module, configured to, when a key name and / or key value of any explicit key-value pair or implicit key-value pair exists in the fourth element list, determine the noun element in the corresponding key-value pair as an entity element of a triple;

[0261] The attribute element determination module is used to determine the other element in the key-value pair as the attribute element of the triple.

[0262] Furthermore, the file content generation rule matching module includes:

[0263] A declaration data acquisition module, used to obtain the declaration data of the target customs clearance declaration procedure from the docked data interface;

[0264] The declaration data processing module is used to process the declaration data according to the file content generation rules corresponding to each file in the declaration file list to generate corresponding customs clearance declaration files.

[0265] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.

[0266] While embodiments of the present invention have been described above, these embodiments do not exhaustively describe all details and do not limit the invention to the specific embodiments described. Obviously, many modifications and variations are possible based on the above description. These embodiments are selected and described in detail in this specification in order to better explain the principles and practical applications of the present invention, thereby enabling those skilled in the art to better utilize the present invention and its modifications. The present invention is limited only by the claims and their full scope and equivalents.

Claims

1. A method for automatically generating customs clearance declaration documents, characterized in that: include: Read historical customs clearance declaration documents from the historical database; parsing the historical customs clearance declaration documents to construct a customs clearance declaration rule library, the customs clearance declaration rule library including a file type determination rule for determining a customs clearance declaration document type corresponding to a customs clearance declaration procedure and a file content generation rule for generating the content of each type of customs clearance declaration document; receiving a request for generating a customs clearance declaration document for a target customs clearance declaration procedure, wherein the request includes basic declaration data for the target customs clearance declaration procedure; Matching the file type determination rules corresponding to the basic declaration data in the customs clearance declaration rule library; Determine the corresponding customs clearance declaration document type according to the document type determination rules; generating a declaration document list corresponding to the target customs clearance declaration procedure based on the customs clearance declaration document type; Matching the file content generation rules corresponding to each file in the declaration file list in the customs clearance declaration rule library to generate the corresponding customs clearance declaration file; The steps of parsing the historical customs clearance declaration documents to construct a customs clearance declaration rule base specifically include: Generating a file identification mark corresponding to each historical customs clearance declaration file in the historical database; Deconstruct the text content of each historical customs clearance declaration document to obtain the text units in the document content; Constructing a customs clearance declaration knowledge graph using the text unit as a basic element, wherein the customs clearance declaration knowledge graph includes a triple identifier for each triple; Establishing an association relationship between the triples in the customs clearance declaration knowledge graph and each historical customs clearance declaration document; Based on the association relationship, the triplet identifier of the triplet is associated with the corresponding historical customs clearance declaration file and stored; Generate a triplet set of each customs declaration procedure and a file type set; Identify the common features of triples of customs declaration procedures with the same set of document types; Establishing a correspondence between the triple common features and the file type set; Establishing a file type determination rule of the customs clearance declaration rule base based on the correspondence between the triple common features and the file type set; The steps of identifying the common features of triples of customs declaration procedures with the same set of document types specifically include: A triplet set of any customs clearance declaration procedure is selected from the customs clearance declaration procedures having the same document type set and determined as a first triplet set; determining a triplet set of other customs clearance declaration procedures except the selected customs clearance declaration procedure among the customs clearance declaration procedures having the same document type set as a second triplet set; traversing each triple in the first set of triples to match a triple identifier of the triple with a triple identifier in the second set of triples; When any triple in the first triple set exists in all second triple sets at the same time, determining the corresponding triple as a characteristic element of a triple common feature; The characteristic elements of the same file type set are combined to generate a triplet common feature corresponding to the file type set.

2. The method for automatically generating customs clearance declaration documents according to claim 1, characterized in that: The step of parsing the historical customs clearance declaration documents to construct a customs clearance declaration rule library further includes: Parsing the historical customs clearance declaration documents to obtain format data, content data, and layout data corresponding to each historical customs clearance declaration document; The file content generation rules are generated by matching the format data, content data and layout data of historical customs clearance declaration documents of the same type. The file content generation rules include format rules, content rules and layout rules.

3. The method for automatically generating customs clearance declaration documents according to claim 2, characterized in that: The step of parsing the historical customs clearance declaration files to obtain the content data corresponding to each historical customs clearance declaration file specifically includes: identifying explicit key-value pairs and implicit key-value pairs in the historical customs clearance declaration file according to the position of the file unit in the historical customs clearance declaration file, wherein the explicit key-value pairs are key-value pairs containing their key names and key values ​​in the text units of the historical customs clearance declaration file, and the implicit key-value pairs are key-value pairs containing only their key values ​​in the text units of the historical customs clearance declaration file; Extracting the key names and paragraph numbers of the explicit key-value pairs and the implicit key-value pairs; A correspondence between the key name and the paragraph number is established.

4. The method for automatically generating customs declaration documents according to claim 3, characterized in that: The steps of constructing a customs clearance declaration knowledge graph using the text units as basic elements specifically include: Constructing a first element list of the historical customs clearance declaration file, wherein the first element list is a set of key names and key values ​​of the explicit key-value pairs and the implicit key-value pairs; Extracting noun elements from the first element list to construct a second element list; When the key name and / or key value of any explicit key-value pair or implicit key-value pair in the historical customs clearance file exists in the second element list, identifying the semantic relationship of the corresponding key-value pair and generating a relationship word; Determine the noun element in the key-value pair as an entity element of a triple in the customs clearance declaration knowledge graph; The other element in the key-value pair and the relational word are respectively determined as the attribute element and the relational element of the triple.

5. The method for automatically generating customs declaration documents according to claim 1, characterized in that: The step of matching the document type determination rule corresponding to the basic declaration data in the customs clearance declaration rule library specifically includes: Processing the basic declaration data to generate a basic triplet set of the target customs clearance declaration procedure; Matching the basic triple set with the triple common features of each file type determination rule; When the triplet common feature of any document type determination rule is a subset of the basic triplet set, the customs clearance declaration document type of the target customs clearance declaration procedure is determined based on the corresponding document type determination rule.

6. The method for automatically generating customs declaration documents according to claim 5, characterized in that: The step of processing the basic declaration data to generate the basic triplet set of the target customs clearance declaration procedure specifically includes: Deconstructing the text content of each file in the basic declaration data to obtain text units in the file content; Generate corresponding explicit key-value pairs and implicit key-value pairs based on the position and semantic relationship of the text unit in the file; The explicit key-value pairs and implicit key-value pairs are matched with the triples in the customs clearance declaration knowledge graph to obtain a basic triple set of the basic declaration data.

7. The method for automatically generating customs declaration documents according to claim 6, characterized in that: The step of matching the explicit key-value pairs and implicit key-value pairs with the triples in the customs clearance declaration knowledge graph to obtain a basic triple set of the basic declaration data specifically includes: extracting entity elements and attribute elements from each file in the basic declaration data; Matching the entity element and the attribute element with the entity element and the attribute element of the triple in the customs clearance declaration knowledge graph to determine the triple corresponding to the key-value pair; The matched triples are combined to generate the basic triple set.

8. A system for automatically generating customs declaration documents, characterized in that: include: The historical customs clearance declaration file reading module is used to read the historical customs clearance declaration files from the historical database; a customs clearance declaration rule base construction module, configured to parse the historical customs clearance declaration documents to construct a customs clearance declaration rule base, wherein the customs clearance declaration rule base includes a file type determination rule for determining the customs clearance declaration document type corresponding to the customs clearance declaration procedure and a file content generation rule for generating the content of each type of customs clearance declaration document; a customs clearance declaration document generation request receiving module, configured to receive a customs clearance declaration document generation request for a target customs clearance declaration procedure, wherein the customs clearance declaration document generation request includes basic declaration data of the target customs clearance declaration procedure; A file type determination rule matching module, configured to match the file type determination rule corresponding to the basic declaration data in the customs clearance declaration rule library; A customs clearance declaration document type determination module, configured to determine the corresponding customs clearance declaration document type according to the document type determination rule; A declaration document list generating module, configured to generate a declaration document list corresponding to the target customs clearance declaration procedure based on the customs clearance declaration document type; A file content generation rule matching module, configured to match the file content generation rule corresponding to each file in the declaration file list in the customs clearance declaration rule library to generate a corresponding customs clearance declaration file; The customs clearance declaration rule base construction module includes: a file identification mark generation module for generating a file identification mark corresponding to each historical customs clearance declaration file in the historical database; A text content deconstruction module is used to deconstruct the text content of each historical customs clearance declaration document to obtain text units in the document content; A customs clearance declaration knowledge graph construction module, configured to construct a customs clearance declaration knowledge graph using the text unit as a basic element, wherein the customs clearance declaration knowledge graph includes a triple identifier for each triple; An association relationship establishment module, used to establish an association relationship between the triples in the customs clearance declaration knowledge graph and each historical customs clearance declaration document; an association storage module, configured to associate and store the triplet identifier of the triplet with the corresponding historical customs clearance declaration file based on the association relationship; A data set generation module, used to generate a triple set and a file type set for each customs clearance declaration procedure; A triplet common feature recognition module, used to identify triplet common features of customs clearance declaration procedures with the same set of document types; A correspondence establishing module, configured to establish a correspondence between the common features of the triples and the set of file types; A file type determination rule establishment module, configured to establish a file type determination rule of the customs clearance declaration rule library based on the correspondence between the triple common features and the file type set; The triplet common feature recognition module includes: A first triplet set determining module, configured to select a triplet set of any customs clearance declaration procedure from customs clearance declaration procedures having the same file type set and determine the triplet set as a first triplet set; a second triplet set determining module, configured to determine, as a second triplet set, a triplet set of customs clearance declaration programs other than the selected customs clearance declaration program among customs clearance declaration programs having the same file type set; a triple identifier matching module for traversing each triple in the first triple set to match the triple identifier of the triple with the triple identifier in the second triple set; a characteristic element determining module, configured to, when any triple in the first triple set exists in all second triple sets at the same time, determine the corresponding triple as a characteristic element of a triple common feature; The triple common feature recognition module is specifically used to combine feature elements of the same file type set to generate triple common features corresponding to the file type set.

Citation Information

Patent Citations

  • Entity recognition model training method, image recognition method, device and equipment

    CN115761770A

  • Customs import and export declaration method, system and equipment based on intelligent coding and medium

    CN117010779A

  • Carbon policy knowledge graph construction system based on text analysis

    CN117407535A