File verification method and device

By employing a layered verification method, utilizing a verification rule base, validity checklist, and target language model, the format, validity, and content of engineering design documents are verified. This solves the problem that existing technologies cannot meet the requirements for document completeness, accuracy, and standardization, and achieves standardization and reliability in document verification.

CN121724005APending Publication Date: 2026-03-24CHINA MOBILE GROUP DESIGN INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-21
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

In the existing technology, the verification methods for engineering design documents cannot meet the verification requirements for the completeness, accuracy, standardization and text format of the document content, and the rule model needs to be set manually, which cannot achieve standardized and normalized verification.

Method used

By employing a layered verification approach, utilizing a verification rule base, validity checklist, standard database, and target language model, the document's format, validity, and content are verified to ensure that the document format is compliant, adheres to valid standards, and its content is accurate.

Benefits of technology

It provides a standardized and regulated document verification path, ensuring the reliability and accuracy of verification results and guaranteeing the quality review of engineering design documents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121724005A_ABST
    Figure CN121724005A_ABST
Patent Text Reader

Abstract

The invention discloses a file verification method and device, and relates to the field of artificial intelligence, and the method comprises the steps: carrying out the format verification of a to-be-verified file based on a verification rule library, and obtaining a format verification file; wherein the verification rule base is constructed through format rules in a preset file template; performing validity check on the format check file based on the validity check table to obtain a valid check file; wherein the validity check table and the standard database are obtained by constructing or updating the latest standard data set; based on a standard database and a target language model, performing content verification on the effective verification file to obtain a target verification file; according to the method, the file format is ensured to be compliant through a hierarchical verification mode, a standardized and normalized implementation path is provided for file verification according to the standard effectiveness and the content accuracy, and the reliability of a verification result is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the field of artificial intelligence, and in particular, to a file verification method and device. BACKGROUND

[0002] Engineering design is the core of engineering project construction, and engineering design file, as the main product of engineering design unit, is the embodiment of the work results in the previous stage and the basis for the work in the later stage, and plays a bridge role between various roles in the construction process. The quality of the engineering design file is an important support for the engineering quality, and the quality audit of the engineering design file is a crucial link in the design process.

[0003] In the related art, the file content is verified by a pre-configured rule model; however, the rule model needs to be manually set, and can only implement verification of specific data, and cannot meet the verification requirements of file content completeness, accuracy, standardization, and text format. SUMMARY

[0004] The present disclosure provides a file verification method and device to solve the problems in the related art, and ensures file format compliance, validity according to standards, and content accuracy by means of hierarchical verification, provides a standardized and standardized implementation path for file verification, and guarantees the reliability of the verification result.

[0005] According to a first aspect of some embodiments of the present disclosure, a file verification method is provided, which includes: performing format verification on a to-be-verified file based on a verification rule library to obtain a format-verified file; wherein the verification rule library is constructed based on format rules in a pre-set file template; performing validity verification on the format-verified file based on a validity check table to obtain a validity-verified file; wherein the validity check table and a standard database are constructed or updated based on the latest standard data set; performing content verification on the validity-verified file based on the standard database and a target language model to obtain a target-verified file.

[0006] In some embodiments of the present disclosure, the validity verification on the format-verified file based on the validity check table to obtain the validity-verified file includes: determining whether the publication date corresponding to the format-verified file is less than the invalidation date; in a case where it is determined that the publication date is greater than or equal to the invalidation date, querying a replacement result of the specification information corresponding to the format-verified file, and outputting first prompt information corresponding to the replacement result; in a case where it is determined that the publication date is less than the invalidation date, determining the specification information corresponding to the format-verified file as valid specification; determining whether the combination of the specification name and the standard number exists in the format checking file corresponding to the effective specification; In a case where it is determined that the combination of the specification name and the standard number does not exist, outputting second prompt information corresponding thereto; In a case where it is determined that the combination of the specification name and the standard number exists, matching the standard number with a corresponding standard number in the validity checking table to obtain the effective checking file.

[0007] In some embodiments of the present disclosure, before the determining whether the publication date corresponding to the format checking file is less than the invalidation date, the method further comprises: determining whether the specification name corresponding to the format checking file is matched from the validity checking table; In a case where it is determined that the specification information corresponding to the specification name is not matched, outputting third prompt information; In a case where it is determined that the specification information is matched, determining whether the specification state corresponding to the specification information is valid; In a case where it is determined that the specification state is invalid, outputting fourth prompt information; In a case where it is determined that the specification state is valid, obtaining the publication date corresponding to the format checking file.

[0008] In some embodiments of the present disclosure, the content checking of the effective checking file based on the standard database and a target language model to obtain a target checking file comprises: determining whether an entry number is contained in a target text segment; wherein the target text segment is related to a last sentence in a text sentence of the effective checking file; In a case where it is determined that the entry number is contained in the target text segment, extracting a specification name and the entry number, and locating corresponding vector content in the standard database; In a case where it is determined that the entry number is not contained in the target text segment, extracting the specification name, and locating the corresponding vector content in the standard database; performing reconstruction processing on the vector content through the target language model, performing dynamic retrieval on the vector content after the reconstruction processing, and obtaining the target checking file.

[0009] In some embodiments of the present disclosure, before the determining whether the entry number is contained in the target text segment, comprising: determining whether a semantic similarity of a preset number of adjacent sentences is greater than a preset similarity threshold; wherein the preset number of adjacent sentences is obtained by extracting a current sentence forward and backward; in a case where it is determined that the semantic similarity of the preset number of adjacent sentences is less than or equal to the preset similarity threshold, storing the current sentence, and updating a next adjacent sentence corresponding to the current sentence as a target sentence; in a case where it is determined that the semantic similarity of the preset number of adjacent sentences is greater than the preset similarity threshold, merging the current sentence and the adjacent sentence greater than the preset similarity threshold to obtain a merged sentence, and updating the merged sentence as the target sentence; determining whether the target sentence is a last sentence in the text sentence; wherein the text sentence is a sentence with a valid specification intercepted from the valid verification file; in a case where it is determined that the target sentence is the last sentence in the text sentence, determining that the target sentence is the target text segment; the determining whether the semantic similarity of the preset number of adjacent sentences is greater than the preset similarity threshold comprises: in a case where it is determined that the target sentence is not the last sentence in the text sentence, performing the determining whether the semantic similarity of the preset number of adjacent sentences is greater than the preset similarity threshold.

[0010] In some embodiments of the present disclosure, before the determining whether the semantic similarity of the preset number of adjacent sentences is greater than the preset similarity threshold, comprising: intercepting a text sentence with a valid specification from the valid verification file to obtain the current sentence, and determining whether a character length of the current sentence satisfies a preset verification condition; in a case where it is determined that the character length of the current sentence does not satisfy the preset verification condition, skipping this time of content verification; in a case where it is determined that the character length of the current sentence satisfies the preset verification condition, extracting the preset number of adjacent sentences corresponding to the current sentence forward and backward, and calculating the semantic similarity between the preset number of adjacent sentences and the current sentence.

[0011] In some embodiments of the present disclosure, before the performing the format verification on the to-be-verified file based on the verification rule library to obtain the format verification file, the method further comprises: constructing the verification rule library according to different format rules in different preset file templates; performing format processing on an original file to obtain the to-be-verified file; the performing the format verification on the to-be-verified file based on the verification rule library to obtain the format verification file comprises: parsing the to-be-verified file to obtain a parsed file; matching the parsed file from the check rule library to obtain the format check file.

[0012] In some embodiments of the present disclosure, before the format check file is checked for validity based on the validity check table to obtain a valid check file, the method further comprises: constructing the standard data set and querying whether there is a newly published standard according to a preset period; In the case of querying the newly published standard, updating the standard data set to obtain an updated standard data set, establishing the validity check table based on the information field in the updated standard data set, and converting the text content in the updated standard data set to obtain the standard database; In the case of not querying the newly published standard, establishing the validity check table based on the information field in the standard data set, and converting the text content in the standard data set to obtain the standard database.

[0013] In some embodiments of the present disclosure, the conversion processing of the text content in the standard data set to obtain the standard database comprises: determining whether there is a table in the text content; In the case of determining that there is the table in the text content, performing table recognition on the table to obtain a text paragraph; performing preliminary slicing on the level corresponding to the text paragraph to obtain a hierarchical structure, and parsing the last layer corresponding to the hierarchical structure to obtain processed text content; wherein the text paragraph is obtained by splitting the merged cells in the table and hierarchical parsing of nested tables; In the case of determining that there is no table in the text content, performing preliminary slicing on the level corresponding to the text paragraph to obtain the hierarchical structure, and parsing the last layer corresponding to the hierarchical structure to obtain the processed text content; vectorizing and encoding the processed text content to obtain the standard database.

[0014] According to the second aspect of the present disclosure, a file check device is provided, comprising: a first check unit configured to perform format check on a to-be-checked file based on a check rule library to obtain a format check file; wherein the check rule library is constructed based on the format rules in a preset file template; a second check unit configured to perform validity check on the format check file based on a validity check table to obtain a valid check file; wherein the validity check table and a standard database are constructed or updated based on the latest standard data set; A third checking unit is configured to perform content checking on the valid checking file based on the standard database and a target language model to obtain a target checking file.

[0015] In some embodiments of the present disclosure, the second checking unit comprises: A first judging module is configured to judge whether a publication date corresponding to the format checking file is less than an invalid date. A querying module is configured to query a replacement result of standard information corresponding to the format checking file and output first prompt information corresponding to the replacement result in a case where the publication date is greater than or equal to the invalid date. A determining module is configured to determine the standard information corresponding to the format checking file as valid standard in a case where the publication date is less than the invalid date. A second judging module is configured to judge whether there is a combination of a standard name and a standard number in the format checking file corresponding to the valid standard. A first output module is configured to output second prompt information in a case where the combination of the standard name and the standard number does not exist. A first matching module is configured to match the standard number with a corresponding standard number in the validity checking table to obtain the valid checking file in a case where the combination of the standard name and the standard number exists.

[0016] In some embodiments of the present disclosure, the second checking unit further comprises: A third judging module is configured to judge whether the standard name corresponding to the format checking file is matched from the validity checking table before the first judging module judges whether the publication date corresponding to the format checking file is less than the invalid date. A second output module is configured to output third prompt information in a case where the standard information corresponding to the standard name is not matched. A fourth judging module is configured to judge whether a standard state corresponding to the standard information is valid in a case where the standard information is matched. A third output module is configured to output fourth prompt information in a case where the standard state is invalid. An obtaining module is configured to obtain the publication date corresponding to the format checking file in a case where the standard state is valid.

[0017] In some embodiments of the present disclosure, the third checking unit comprises: A fifth judging module is configured to judge whether an entry number is contained in a target text segment; wherein the target text segment is related to a last sentence in a text sentence of the valid checking file. a first extraction module configured to extract a standard name and the entry number and locate corresponding vector content in the standard database if it is determined that the entry number is contained in the target text segment; a second extraction module configured to extract the standard name and locate the corresponding vector content in the standard database if it is determined that the entry number is not contained in the target text segment; a processing module configured to perform reconstruction processing on the vector content by using the target language model, and perform dynamic retrieval on the vector content after the reconstruction processing to obtain the target verification file.

[0018] In some embodiments of the present disclosure, the device further comprises: a sixth judgment module configured to judge whether semantic similarity of a preset number of adjacent sentences is greater than a preset similarity threshold before the fifth judgment module judges whether the entry number is contained in the target text segment; wherein the preset number of adjacent sentences are obtained by extracting forward and backward from a current sentence; a storage module configured to store the current sentence and update a next adjacent sentence corresponding to the current sentence to a target sentence if it is determined that the semantic similarity of the preset number of adjacent sentences is less than or equal to the preset similarity threshold; a merging module configured to merge the current sentence and adjacent sentences greater than the preset similarity threshold to obtain a merged sentence and update the merged sentence to the target sentence if it is determined that the semantic similarity of the preset number of adjacent sentences is greater than the preset similarity threshold; a seventh judgment module configured to judge whether the target sentence is the last sentence in the text sentence; wherein the text sentence is a sentence with valid specifications intercepted from the valid verification file; a determination module configured to determine that the target sentence is the target text segment if it is determined that the target sentence is the last sentence in the text sentence; an execution module configured to execute the judgment of whether the semantic similarity of the preset number of adjacent sentences is greater than the preset similarity threshold if it is determined that the target sentence is not the last sentence in the text sentence.

[0019] In some embodiments of the present disclosure, the device further comprises: an interception module configured to intercept a text sentence with valid specifications from the valid verification file to obtain the current sentence and judge whether a character length of the current sentence meets a preset verification condition before the sixth judgment module judges whether the semantic similarity of a preset number of adjacent sentences is greater than a preset similarity threshold; The skip module is used to skip the current content verification if it is determined that the character length of the current sentence does not meet the preset verification condition. The calculation module is used to extract a preset number of neighboring sentences corresponding to the current sentence forward and backward, and calculate the semantic similarity between the preset number of neighboring sentences and the current sentence, provided that the character length of the current sentence meets the preset verification condition.

[0020] In some embodiments of this disclosure, the apparatus further includes: The construction unit is used to construct the verification rule library according to different format rules in different preset file templates before the first verification unit performs format verification on the file to be verified based on the verification rule library to obtain the format verification file. The processing unit is used to perform format processing on the original file to obtain the file to be verified. The first verification unit includes: The parsing module is used to parse the file to be verified to obtain a parsed file; The second matching module is used to match the parsed file with the verification rule base to obtain the format verification file.

[0021] In some embodiments of this disclosure, the apparatus further includes: The query unit is used to construct the standard dataset and query whether a new standard is released according to a preset period before the second verification unit performs validity verification on the format verification file based on the validity check table and obtains a valid verification file. The first establishment unit is used to update the standard dataset when the newly released standard is found, to obtain the updated standard dataset, to establish the validity check table based on the information fields in the updated standard dataset, and to convert the text content in the updated standard dataset to obtain the standard database. The second establishment unit is used to establish the validity check table based on the information fields in the standard dataset when the newly released standard is not found, and to convert the text content in the standard dataset to obtain the standard database.

[0022] In some embodiments of this disclosure, the apparatus further includes: A judgment unit is used to determine whether a table exists in the text content; The recognition unit is used to recognize the table in the text content to obtain a text paragraph; The first slicing unit is used to perform preliminary slicing on the level corresponding to the text paragraph to obtain the hierarchical structure, and to parse the last level corresponding to the hierarchical structure to obtain the processed text content; wherein, the text paragraph is obtained by splitting the merged cells in the table and parsing the nested table layer by layer; The second slicing unit is used to perform preliminary slicing of the level corresponding to the text paragraph when it is determined that the table does not exist in the text content, to obtain the level structure, and to parse the last level corresponding to the level structure to obtain the processed text content. The encoding unit is used to perform vectorization encoding on the processed text content to obtain the standard database.

[0023] According to a third aspect of this disclosure, an electronic device is provided, comprising: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect embodiment.

[0024] According to a fourth aspect of this disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are configured to cause the computer to perform the method described in the first aspect of the present disclosure.

[0025] According to a fifth aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method described in the first aspect of the preceding embodiments.

[0026] In summary, the document verification method and apparatus provided in this disclosure include: performing format verification on the document to be verified based on a verification rule base to obtain a format verification file; wherein the verification rule base is constructed from format rules in a preset file template; performing validity verification on the format verification file based on a validity check table to obtain a valid verification file; wherein the validity check table and standard database are constructed or updated using the latest standard dataset; and performing content verification on the valid verification file based on the standard database and a target language model to obtain a target verification file. This layered verification approach ensures that the document format is compliant, the standard is valid, and the content is accurate, providing a standardized and regulated implementation path for document verification and guaranteeing the reliability of the verification results.

[0027] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description

[0028] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein: Figure 1 This is a flowchart illustrating a file verification method provided in an embodiment of the present disclosure; Figure 2 This is a flowchart illustrating another file verification method provided in an embodiment of this disclosure; Figure 3 This is a flowchart illustrating another file verification method provided in an embodiment of this disclosure; Figure 4 This is a flowchart illustrating another file verification method provided in an embodiment of this disclosure; Figure 5 This is a flowchart illustrating another file verification method provided in an embodiment of this disclosure; Figure 6 This is a flowchart illustrating another file verification method provided in an embodiment of this disclosure; Figure 7 This is a flowchart illustrating another file verification method provided in an embodiment of this disclosure; Figure 8 This is a flowchart illustrating another file verification method provided in an embodiment of this disclosure; Figure 9 This is a flowchart illustrating another file verification method provided in an embodiment of this disclosure; Figure 10 This is a flowchart illustrating another file verification method provided in an embodiment of this disclosure; Figure 11 This is a flowchart illustrating another file verification method provided in an embodiment of this disclosure; Figure 12 This is a schematic diagram of the structure of a document verification device provided in an embodiment of the present disclosure; Figure 13 This is a schematic diagram of another document verification device provided in an embodiment of the present disclosure; Figure 14 A schematic block diagram of an example electronic device provided for embodiments of this disclosure. Detailed Implementation

[0029] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0030] The document verification method and apparatus of this disclosure are described below with reference to the accompanying drawings.

[0031] Figure 1 This is a schematic flowchart of a file verification method provided in an embodiment of this disclosure.

[0032] like Figure 1 As shown, the method includes the following steps: Step 101: Perform format verification on the file to be verified based on the verification rule base to obtain a format verification file; wherein, the verification rule base is constructed by the format rules in the preset file template.

[0033] In some embodiments, the preset file template is a standardized format template common to the field to which the file belongs, which contains the common format requirements of the file in that field; the construction process of the verification rule base is to extract format rules from the preset file template, and then organize these rules into a set of rules that can be used for verification; during format verification, the rules in the verification rule base are called to check whether the format of the file to be verified meets the requirements, and the content that does not meet the rules is marked, and finally the format verification file is output.

[0034] The above methods can standardize the format of the files to be verified, eliminate the impact of format differences on verification, and provide a unified basis for the verification process.

[0035] Step 102: Perform validity verification on the format verification file based on the validity check table to obtain a valid verification file; wherein, the validity check table and the standard database are constructed or updated through the latest standard dataset.

[0036] In some embodiments, the latest standard dataset is a collection of standard specifications and related update information published in the field to which the document belongs; the validity check table is constructed by extracting information from each standard from the latest standard dataset and organizing it in a structured manner; the standard database is constructed by storing the full text of the standards in the latest standard dataset; the validity check table and the standard database are updated by continuously acquiring newly published standard-related data in the field and supplementing, updating or annotating the data; during the validity verification process, the validity check table is used to match and verify the specifications mentioned in the format verification file to determine whether the specifications are in a valid state, and the files involving valid specifications are selected as valid verification files.

[0037] By using the above methods, we can ensure that the specifications used for content verification are valid versions, thus avoiding compliance risks to the documents caused by referencing invalid standards.

[0038] Step 103: Based on the standard database and the target language model, perform content verification on the valid verification file to obtain the target verification file.

[0039] In some embodiments, the target language model is a model with text processing, semantic understanding, and comparison functions, including but not limited to BERT series models and semantic reordering related models. During content verification, the target language model is used to process the content involving valid specifications in the valid verification file, retrieve the corresponding standard content from the standard database, compare the relevant content in the valid verification file with the retrieved standard content, and finally output the target verification file. It should be noted that the above examples are only illustrative and do not limit the specific content.

[0040] The above methods can be used to verify the consistency between the content of valid verification documents and standard specifications, identify deviations at the content level, and improve the accuracy of document content.

[0041] In summary, the file verification method provided in this disclosure includes: performing format verification on the file to be verified based on a verification rule base to obtain a format verification file; wherein the verification rule base is constructed from format rules in a preset file template; performing validity verification on the format verification file based on a validity check table to obtain a valid verification file; wherein the validity check table and the standard database are constructed or updated using the latest standard dataset; performing content verification on the valid verification file based on the standard database and the target language model to obtain a target verification file; and ensuring file format compliance, standard validity, and content accuracy through layered verification, providing a standardized and normalized implementation path for file verification and ensuring the reliability of the verification results.

[0042] Figure 2A flowchart illustrating a file verification method provided in an embodiment of this disclosure is further shown. Based on Figure 1 The illustrated embodiment further explains step 102. Figure 2 This may include the following steps: Step 201: Determine whether the publication date of the format verification file is less than the expiration date.

[0043] In some embodiments, the invalidation date is obtained from the specification information matched in the validity check table, and the publication date is the release date recorded in the format verification document itself. The determination is completed by comparing the values ​​of the invalidation date and the publication date.

[0044] Step 202: If the publication date is determined to be greater than or equal to the obsolescence date, query the alternative results of the specification information corresponding to the format verification file, and output the first prompt information corresponding to the alternative results.

[0045] In some embodiments, the substitution result is obtained by retrieving the substitution record corresponding to the specification information in the validity check table. If a substitution record exists, a corresponding substitution prompt is output; if no substitution record exists, an unusable prompt is output. Both types of prompts belong to the first prompt information.

[0046] Step 203: If the publication date is determined to be less than the obsolescence date, the specification information corresponding to the format verification file is determined to be a valid specification.

[0047] In some embodiments, based on the determination that the publication date is earlier than the obsolescence date, the specification information is confirmed to be valid at the time of document publication, and thus it is determined to be a valid specification.

[0048] Step 204: Determine whether there is a combination of specification name and standard number in the format verification file corresponding to the valid specification.

[0049] In some embodiments, the existence of a combination is determined by searching the text content of the format verification file to check whether the specification name and the corresponding standard number of the valid specification exist simultaneously.

[0050] Step 205: If it is determined that there is no combination of the specification name and the standard number, output the corresponding second prompt information.

[0051] In some embodiments, the second prompt is a special prompt for the absence of both the specification name and the standard number combination in the format verification file, used to inform the relevant verification status.

[0052] Step 206: If a combination of the specification name and the standard number is found, the standard number is matched with the corresponding standard number in the validity check table to obtain the valid verification file.

[0053] In some embodiments, the standard number corresponding to the specification name in the format verification file is compared with the standard number associated with the specification name in the validity check table. If the comparison is successful, the file is output as a valid verification file.

[0054] By using the above methods, we can accurately select documents that correspond to valid standards based on the comparison of publication date and obsolescence date and the matching and verification of standard number, thus ensuring the compliance and accuracy of the documents being verified.

[0055] Figure 3 A flowchart illustrating a file verification method provided in an embodiment of this disclosure is further shown. Based on Figure 2 The embodiment shown, Figure 3 This may include the following steps: Step 301: Determine whether the specification name corresponding to the format verification file is matched in the validity check table.

[0056] In some embodiments, the Chinese standard name marked with quotation marks in the format verification file is identified, and the name is used as the search keyword to search the validity check table to determine whether a corresponding record exists.

[0057] Step 302: If it is determined that no matching standard information is found for the standard name, output a third prompt message.

[0058] In some embodiments, the third prompt is a specific prompt indicating that no corresponding specification information was found, clearly stating that no specification information corresponding to the specification name mentioned in the format verification file was matched.

[0059] Step 303: If the standard information is found to be matched, determine whether the standard status corresponding to the standard information is valid.

[0060] In some embodiments, the specification status is the core field corresponding to the specification information in the validity check table. By reading the identifier content of this field, it is determined whether it is in a valid state.

[0061] Step 304: If the specified status is determined to be invalid, output the fourth prompt message.

[0062] In some embodiments, an invalid specification status indicates that the specification is obsolete. The fourth prompt message is a special prompt for this obsolete status, informing that the current specification status is obsolete.

[0063] Step 305: If the specification status is determined to be valid, obtain the publication date corresponding to the format verification file.

[0064] In some embodiments, the publication date is extracted from a preset field or text content of the format verification file to prepare for comparison with the obsolescence date of the specification information.

[0065] By using the above methods, we can first complete the matching of standard names and the verification of standard status, providing a basis for judging publication date-related matters and further ensuring the rigor of validity verification.

[0066] In some possible ways, Figure 4 This is a flowchart illustrating a file verification method provided in an embodiment of this disclosure, as shown below. Figure 4 As shown, the process is divided into two parts: one part is the logic for constructing the validity check table. It queries whether a newly released standard exists according to a preset cycle. If it does, the standard dataset is updated, and a validity check table is built based on its information fields. If it does not exist, a validity check table is built based on the information fields of the original standard dataset. The other part is the validity verification process. Starting with the matching of the specification name, it first checks whether the specification name is matched in the validity check table. If not matched, a third prompt message is output. If matched, it then checks whether the specification status corresponding to the specification information is valid. If the specification status is invalid, a fourth prompt message is output. If the specification status is valid, it obtains the publication date corresponding to the format verification file and checks whether it is less than the obsolescence date. If the publication date is less than the obsolescence date, it checks whether the format verification file contains a combination of specification name and standard number. If not, a corresponding second prompt message is output. If it exists, it checks whether the standard number is consistent with the one in the validity check table. If inconsistent, it outputs "The standard number is inconsistent with the one in the validity check table; please check."

[0067] Figure 5 A flowchart illustrating a file verification method provided in an embodiment of this disclosure is further shown. Based on Figure 1 The illustrated embodiment further explains step 103. Figure 5 This may include the following steps: Step 401: Determine whether the target text fragment contains an entry number; wherein the target text fragment is related to the last sentence of the text sentence in the valid verification file.

[0068] In some embodiments, the target text fragment is a semantically coherent text formed by truncating and merging the preceding sentences, and its formation is based on the last sentence of the text sentences in the valid verification document as the truncation endpoint; the entry number refers to the number used to identify specific clauses in the standard specification (such as "Article 3.8.2"), and the determination method is to match the character combinations in the target text fragment through regularization rules to identify whether there is content that conforms to the entry number format characteristics, thereby determining whether the entry number is included.

[0069] Step 402: If the target text fragment contains the entry number, extract the standard name and the entry number, and locate the corresponding vector content in the standard database.

[0070] In some embodiments, the specification name is precisely extracted using the book title marks 《》 in the target text fragment, and the item number is extracted through regularization and then associated with the specification name. The vector content in the standard database is the result of semantic vectorization encoding of the full text of the standard and the content of the clauses by a model (such as acge_text_embedding), and the vector library and the standard database form an associated mapping. Through the metadata index of the specification name and the item number, the vector content of the corresponding clause is located. After locating, the target text fragment is recorded as Text0, and the standard text corresponding to the located vector content is recorded as Text1. Both are input into the target language model for content comparison to check whether the expression is incorrect.

[0071] Step 403: If it is determined that the target text fragment does not contain the entry number, extract the standard name and locate the corresponding vector content in the standard database.

[0072] In some embodiments, when the entry number is not included, only the specification name in the target text fragment is extracted. The specification name is used as the metadata index to locate the vector content corresponding to the full text of the specification in the standard database, rather than the vector content of the specific clause. After locating, the target text fragment needs to be reconstructed by query, that is, the core content related to the specification in the fragment is extracted by the target language model, and the interference information unrelated to the specification in the paragraph is eliminated. Dynamic retrieval is carried out after the reconstruction is completed.

[0073] Step 404: The vector content is reconstructed using the target language model, and the reconstructed vector content is dynamically retrieved to obtain the target verification file.

[0074] In some embodiments, the reconstruction process of the target language model is carried out for the target text segment, extracting the content related to the specification in the target text segment and excluding irrelevant interference information. This process is the first step of the prompt template chain. The dynamic retrieval is divided into two steps: First, perform a pre-retrieval in the located vector content, expanding the initial result range by increasing the size of the top_k for sorting the retrieval similarity. Then, through a relevance re-ranking model (such as the bge-reranker-large model), take the content to be retrieved and the pre-retrieved data as inputs, output similarity scores, accurately rank the pre-retrieval results, and select the top_n (n < k) optimal results. The prompt template chain also includes two steps: In the second step, adopt techniques such as few-shot prompt, manually summarize m examples of common standard citation methods in the design document as context, input the extracted specification content, and prompt the model to judge whether it involves specific clauses. In the third step, retrieve the top_n most relevant entry contents from the standard full-text vector content and record them as Text1 to Textn. According to the judgment result of the second step, if it involves specific clauses, perform content consistency verification, and if not, perform content inclusion verification. After completion, output the target verification file.

[0075] Through the above method, it is possible to accurately locate standard data according to whether the target text segment contains item numbers in different scenarios, improve the content matching accuracy by combining dynamic retrieval, and provide reliable data support for content accuracy verification.

[0076] Figure 6 Further shows a schematic flowchart of a file verification method provided by an embodiment of the present disclosure. Based on Figure 5 the embodiments shown, Figure 6 it may include the following steps: Step 501, determine whether the semantic similarity of a preset number of adjacent sentences is greater than a preset similarity threshold; wherein, the preset number of adjacent sentences is extracted forward and backward from the current sentence.

[0077] In some embodiments, the current sentence is a sentence with valid specifications intercepted from the valid verification file. The interception process divides the complete sentence with a period as the identifier to ensure the semantic independence of the sentence. The preset number n usually takes 1 or 2, that is, 1 to 2 adjacent sentences are extracted forward and backward respectively. The semantic similarity is calculated by the BERT-Base-Chinese model, which is a version of the BERT model for Chinese texts. It is pre-trained based on Chinese texts and can learn the semantic and syntactic information of Chinese texts, and can effectively judge whether there is a semantic connection between the upper and lower sentences. The preset similarity threshold is a preset judgment benchmark used to distinguish whether there is a semantic association between sentences. Exceeding the preset similarity threshold indicates that the sentences are centered around the same specification content.

[0078] Step 502: If the semantic similarity of the preset number of adjacent sentences is less than or equal to the preset similarity threshold, store the current sentence and update the next adjacent sentence corresponding to the current sentence to the target sentence.

[0079] In some embodiments, if the semantic similarity does not reach the threshold, it indicates that the semantic relationship between the adjacent sentences and the current sentence is weak and there is no need to merge them. In this case, the current sentence is stored and the next adjacent sentence is used as the new current sentence (i.e., updated to the target sentence), and similarity judgment is continued.

[0080] Step 503: If the semantic similarity of the preset number of adjacent sentences is greater than the preset similarity threshold, merge the current sentence with the adjacent sentences that are greater than the preset similarity threshold to obtain a merged sentence, and update the merged sentence to the target sentence.

[0081] In some embodiments, a semantic similarity exceeding a preset similarity threshold indicates semantic coherence between sentences. The current sentence is then merged with the adjacent sentence to form a complete semantic unit (merged sentence), and the merged sentence is used as a new target sentence for similarity determination with other adjacent sentences.

[0082] Step 504: Determine whether the target sentence is the last sentence in the text sentence; wherein, the text sentence is a sentence extracted from the valid verification file that contains valid specifications.

[0083] In some embodiments, a text sentence is a set of all sentences containing valid specifications in a valid verification file. By locating the position of the target sentence in this set, it is determined whether the similarity judgment of all related sentences has been completed.

[0084] Step 505: If the target sentence is determined to be the last sentence in the text sentence, then the target sentence is determined to be the target text segment.

[0085] In some embodiments, when the target sentence is the last sentence, it indicates that the semantic association judgment of all related sentences has been completed. At this time, the target sentence (which may be a single sentence or a merged sentence) is a semantically complete and coherent target text fragment, which is used for content verification.

[0086] Step 506: If it is determined that the target sentence is not the last sentence in the text sentence, perform a judgment on whether the semantic similarity of the preset number of adjacent sentences is greater than the preset similarity threshold.

[0087] In some embodiments, if the target sentence is not the last sentence, it is necessary to return to step 501, extract its neighboring sentences and calculate semantic similarity based on the updated target sentence, form a loop judgment logic, until all relevant sentences are covered.

[0088] The above method can filter and merge sentences based on semantic relevance to form a complete target text fragment that reflects the normative citation context, avoiding content verification bias caused by isolated sentences and improving the comprehensiveness of verification.

[0089] Figure 7 A flowchart illustrating a file verification method provided in an embodiment of this disclosure is further shown. Based on Figure 6 The embodiment shown, Figure 7 This may include the following steps: Step 601: Extract a text sentence containing valid specifications from the valid verification file to obtain the current sentence, and determine whether the character length of the current sentence meets the preset verification conditions.

[0090] In some embodiments, the truncation method uses a period punctuation mark as an identifier to segment the complete current sentence containing valid specifications, ensuring the semantic integrity of the sentence; the preset verification condition is "the length of the characters in the current sentence after excluding the specification name, standard number, and entry number is greater than k", where k is a preset minimum character length threshold, used to determine whether the sentence contains enough content to be verified, that is, there is still substantial reference content after excluding the specification identifier, to avoid invalid verification of sentences that only mention the specification name without specific content.

[0091] Step 602: If it is determined that the character length of the current sentence does not meet the preset verification condition, skip this content verification.

[0092] In some embodiments, a character length less than or equal to k indicates that after excluding specification-related identifiers, the sentence has insufficient effective content and is not valuable for content verification. Therefore, the subsequent verification process for the sentence is skipped to improve verification efficiency.

[0093] Step 603: If the character length of the current sentence meets the preset verification condition, extract the preset number of adjacent sentences corresponding to the current sentence forward and backward, and calculate the semantic similarity between the preset number of adjacent sentences and the current sentence.

[0094] In some embodiments, a character length that meets the standard indicates that the sentence has verification value. At this time, adjacent sentences are extracted forward and backward in a preset number (such as 1 or 2). After extraction, the semantic similarity between the adjacent sentences and the current sentence is calculated by the BERT-Base-Chinese model. The calculation result directly determines whether subsequent sentences are merged. If the similarity is greater than the threshold, they are merged to ensure the integrity of the content. If the similarity is less than or equal to the threshold, they are stored separately, providing a basis for forming semantically coherent target text fragments.

[0095] The above method can pre-select sentences with verification value, avoid invalid verification processes for sentences without substantial content, and provide qualified initial data for semantic association judgment, thus balancing verification efficiency and accuracy.

[0096] In some possible ways, Figure 8 This is a flowchart illustrating a file verification method provided in an embodiment of this disclosure, as shown below. Figure 8 As shown, the process begins with "extracting a text sentence with valid specifications from a valid verification file to obtain the current sentence"; first, it determines whether the character length of the current sentence meets the preset verification conditions. If not, the current content verification is skipped; if it does, a preset number of adjacent sentences corresponding to the current sentence are extracted forward and backward, and the semantic similarity between the preset number of adjacent sentences and the current sentence is calculated; next, it determines whether the semantic similarity of the adjacent sentences is greater than a preset similarity threshold. If it is less than or equal to, the current sentence is stored, and the next adjacent sentence corresponding to the current sentence is updated to the target sentence; if it is greater, the current sentence is merged with adjacent sentences that are greater than the preset similarity threshold to obtain a merged sentence, and the merged sentence is updated to the target sentence; then, it determines whether the target sentence is the last sentence in the text sentence. If not, it returns to the step of "determining whether the semantic similarity of the adjacent sentences is greater than the preset similarity threshold". If it is, the target sentence is determined to be the target text fragment.

[0097] Figure 9 A flowchart illustrating a file verification method provided in an embodiment of this disclosure is further shown. Based on Figure 1 The embodiment shown, Figure 9 This may include the following steps: Step 701: Construct the verification rule library based on the different format rules in different preset file templates.

[0098] In some embodiments, the preset file template is a standard design document template in the field of engineering design. Apache POI (an open-source, cross-platform Java API written in Java that provides read and write functionality for Microsoft Office format files) is used to parse this standard template, identifying the document name, table of contents, chapters, figure and table titles, text structure, and corresponding attributes such as font, font size, color, and line spacing in the preset file template. Format validation rules are set according to different types of requirements, including: establishing title consistency rules for titles with strict consistency requirements; establishing title rules containing keywords for titles with less strict requirements; establishing corresponding format validation rules for text paragraph levels; and establishing different regular expression constraint rules for content within the template that needs to be adjusted by the designer (such as project name, auditor information, etc.). These rules are then structured and organized to form a validation rule library.

[0099] Step 702: Perform format processing on the original file to obtain the file to be verified.

[0100] In some embodiments, if the original file is a non-Microsoft Word (.docx) document (such as a PDF), the open-source project pdf2docx (a Python-based tool that converts PDF documents into docx format through data extraction, layout parsing, and style reconstruction) is used for format conversion; if the original file is already in docx format, it is directly used as the file to be verified, thus obtaining a file with a uniform format to be verified.

[0101] Step 703: Parse the file to be verified to obtain a parsed file.

[0102] In some embodiments, the Apache POI tool is used to parse the file to be verified, obtain information such as its document name, directory, chapters, content and format attributes, and form a parsing file to provide a data foundation for rule matching.

[0103] Step 704: Match the parsed file with the verification rule base to obtain the format verification file.

[0104] In some embodiments, the structure, format, and other information of the parsed file are matched one by one with the rules in the validation rule base. For content that fails the validation, it is added to the original document as a comment, and finally a format validation file that meets the rule requirements is output.

[0105] The above methods can be used to automate the verification of text-based design file formats in the field of engineering design, ensuring that the file formats meet the requirements of standard templates, reducing errors and omissions in manual verification, and improving the efficiency and accuracy of file format verification.

[0106] Figure 10A flowchart illustrating a file verification method provided in an embodiment of this disclosure is further shown. Based on Figure 1 The embodiment shown, Figure 10 This may include the following steps: Step 801: Construct the standard dataset and query whether a new standard is released according to a preset period.

[0107] In some embodiments, a basic standard dataset is constructed by manually collecting current / expired national standards, industry standards, enterprise standards, etc.; at the same time, a regular Internet search task is configured to retrieve newly released standards, so as to achieve dynamic data updates.

[0108] Step 802: If the newly released standard is found, update the standard dataset to obtain the updated standard dataset. Based on the information fields in the updated standard dataset, establish the validity check table and perform conversion processing on the text content in the updated standard dataset to obtain the standard database.

[0109] In some embodiments, the updated standard dataset contains complete information about newly released standards. Based on information fields such as standard name, standard number, industry, standard type, standard status, issuing organization, release time, validity period, and expiration time, a standard validity check table is established. At the same time, the text content of the updated standard dataset is transformed by table recognition, text parsing, and other conversion processes to form a standard database.

[0110] Step 803: If the newly released standard is not found, establish the validity check table based on the information fields in the standard dataset, and convert the text content in the standard dataset to obtain the standard database.

[0111] In some embodiments, a standard validity check table is established based on the information fields of the original standard dataset; the text content of the original standard dataset is transformed by table recognition, text parsing and other conversion processes to form a standard database.

[0112] The above methods enable dynamic updating and structured storage of engineering design industry standard data, providing timely and reliable basic data support for document validity and content verification.

[0113] Figure 11 A flowchart illustrating a file verification method provided in an embodiment of this disclosure is further shown. Based on Figure 10 The embodiment shown, Figure 11 This may include the following steps: Step 901: Determine whether a table exists in the text content.

[0114] In some embodiments, tools (such as ApachePOI, Python-docx, etc.) are used to identify the start and end rows of tables in the text content, as well as the cell content, in order to determine whether a table exists.

[0115] Step 902: If the table is found to exist in the text content, perform table recognition on the table to obtain a text paragraph.

[0116] In some embodiments, the table content is read and traversed, merged cells are split and their content is filled, multi-level nested tables are identified and parsed hierarchically and then processed as ordinary tables; the extracted table text is concatenated into a new paragraph by "row name + column name + cell content" and added after the original position of the table; finally, the original table is deleted one by one in reverse order to obtain the text paragraph.

[0117] Step 903: Perform preliminary slicing on the levels corresponding to the text paragraph to obtain the hierarchical structure, and parse the last level corresponding to the hierarchical structure to obtain the processed text content; wherein, the text paragraph is obtained by splitting the merged cells in the table and parsing the nested table layer by layer.

[0118] In some embodiments, text paragraphs are initially sliced ​​into parts, chapters, and sections; sections are further segmented: first, the text information of the section is saved, and then, for cases with paragraph numbers, the first paragraph number and indentation value are recorded. The text is read in sections. If the paragraph number format is consistent and the indentation value is the same, it is stored as a new key in the dictionary table. If they are inconsistent or the indentation value is larger, it is stored as the value of the current key. If the indentation value is smaller, the current round of parsing is exited. The dictionary table is expanded and the text is concatenated (e.g., the dictionary table [A:[B:[C:[D,E]]] can be expanded into two text sections, “ABCD” and “ABCE”), to ensure information integrity and obtain the processed text content.

[0119] For ease of understanding, the following is an example: "4 Indoor and Outdoor Design Parameters" is a chapter, "4.1 Indoor Design Parameters" is a section, "4.1.1 The indoor design temperature in winter shall be adopted according to the use of the building and shall comply with the following provisions" is an article, "1 The working places in production workshops, warehouses, and public auxiliary buildings shall determine the design temperature according to the labor intensity and shall comply with the following provisions" is a paragraph, and "1) For light labor, it is 18°C to 21°C; for moderate labor, it is 16°C to 18°C; for heavy labor, it is 14°C to 16°C; for extremely heavy labor, it is 12°C to 14°C" is a sub - paragraph. For the article "4.1.1 The indoor design temperature in winter shall be adopted according to the use of the building and shall comply with the following provisions", first save the text information of the article as A; traverse line by line. If it contains the label "1", record its label "1" and the indentation value a, and store it in the dictionary table as key - A; if it contains the label "1)", record its label "1)" and the indentation value aa. Since aa > a, store it as the value of the current key - A. Similarly, if there is a label "2" and the indentation value b is the same as a, store it as a new key - B in the dictionary table, and so on until a1 < a or it traverses to other articles, sections, or chapters, and the parsing of this article ends. It should be noted that the above example is only for illustrative purposes and does not limit the specific content.

[0120] Step 904, in the case of determining that the table does not exist in the text content, perform a preliminary slicing on the level corresponding to the text paragraph to obtain the hierarchical structure, and parse the last layer corresponding to the hierarchical structure to obtain the processed text content.

[0121] In some embodiments, directly perform a preliminary slicing on the text paragraph by part, chapter, and article, and then perform the above - mentioned structure parsing on the article to obtain the processed text content.

[0122] Step 905, perform vector quantization encoding on the processed text content to obtain the standard database.

[0123] In some embodiments, use an open - source model (such as acge_text_embedding) to perform text semantic vector quantization encoding on the processed text content, and at the same time vectorize the metadata of the standard entry (standard name, standard number, section number, item number, etc.) together and store it as an index in the vector library to build the standard database.

[0124] Through the above - mentioned method, the unstructured engineering design standard text can be transformed into a structured and retrievable vector knowledge base, providing technical support for the accurate retrieval and comparison of content verification, and improving the efficiency and accuracy of standard content verification.

[0125] Corresponding to the document verification method described above, this invention also proposes a document verification device. Since the device embodiments of this invention correspond to the method embodiments described above, details not disclosed in the device embodiments can be referred to in the method embodiments described above, and will not be repeated here.

[0126] Figure 12 This is a schematic diagram of the structure of a document verification device provided in an embodiment of this disclosure, as shown below. Figure 12 As shown, it includes: a first verification unit 51, a second verification unit 52, and a third verification unit 53.

[0127] The first verification unit 51 is used to perform format verification on the file to be verified based on the verification rule base to obtain a format verification file; wherein, the verification rule base is constructed by the format rules in the preset file template; The second verification unit 52 is used to perform validity verification on the format verification file based on the validity check table to obtain a valid verification file; wherein, the validity check table and the standard database are constructed or updated through the latest standard dataset; The third verification unit 53 is used to perform content verification on the valid verification file based on the standard database and the target language model to obtain the target verification file.

[0128] In summary, the document verification device provided in this disclosure includes: performing format verification on the document to be verified based on a verification rule base to obtain a format verification file; wherein the verification rule base is constructed from format rules in a preset file template; performing validity verification on the format verification file based on a validity check table to obtain a valid verification file; wherein the validity check table and standard database are constructed or updated using the latest standard dataset; and performing content verification on the valid verification file based on the standard database and a target language model to obtain a target verification file. This layered verification approach ensures that the document format is compliant, the standard is valid, and the content is accurate, providing a standardized and regulated implementation path for document verification and guaranteeing the reliability of the verification results.

[0129] Furthermore, in one possible implementation of the embodiments of this disclosure, such as Figure 13 As shown, the second verification unit 52 includes: The first judgment module 5201 is used to determine whether the publication date of the format verification file is less than the expiration date; The query module 5202 is used to query the alternative results of the specification information corresponding to the format verification file when it is determined that the publication date is greater than or equal to the obsolescence date, and output the first prompt information corresponding to the alternative results; The determination module 5203 is used to determine the specification information corresponding to the format verification file as a valid specification when it is determined that the publication date is less than the obsolescence date; The second judgment module 5204 is used to determine whether there is a combination of specification name and standard number in the format verification file corresponding to the valid specification; The first output module 5205 is used to output corresponding second prompt information when it is determined that there is no combination of the specification name and the standard number; The first matching module 5206 is used to match the standard number with the corresponding standard number in the validity check table when it is determined that there is a combination of the specification name and the standard number, so as to obtain the valid verification file.

[0130] Furthermore, in one possible implementation of the embodiments of this disclosure, such as Figure 13 As shown, the second verification unit 52 further includes: The third judgment module 5207 is used to determine whether the specification name corresponding to the format verification file is matched in the validity check table before the first judgment module 5201 determines whether the publication date corresponding to the format verification file is less than the obsolescence date. The second output module 5208 is used to output a third prompt message when it is determined that no matching specification information corresponding to the specification name is found. The fourth judgment module 5209 is used to determine whether the standard status corresponding to the standard information is valid when it is determined that the standard information is matched. The third output module 52010 is used to output a fourth prompt message when the specification status is determined to be invalid. The acquisition module 52011 is used to acquire the publication date corresponding to the format verification file when the specification status is determined to be valid.

[0131] Furthermore, in one possible implementation of the embodiments of this disclosure, such as Figure 13 As shown, the third verification unit 53 includes: The fifth judgment module 5301 is used to determine whether the target text fragment contains an entry number; wherein the target text fragment is related to the last sentence of the text sentence in the valid verification file; The first extraction module 5302 is used to extract the standard name and the entry number when it is determined that the target text fragment contains the entry number, and to locate the corresponding vector content in the standard database. The second extraction module 5303 is used to extract the standard name and locate the corresponding vector content in the standard database when it is determined that the target text fragment does not contain the entry number; The processing module 5304 is used to reconstruct the vector content through the target language model, and dynamically retrieve the reconstructed vector content to obtain the target verification file.

[0132] Furthermore, in one possible implementation of the embodiments of this disclosure, such as Figure 13 As shown, the third verification unit 53 further includes: The sixth judgment module 5305 is used to determine whether the semantic similarity of a preset number of adjacent sentences is greater than a preset similarity threshold before the fifth judgment module 5301 determines whether the target text segment contains an entry number; wherein, the preset number of adjacent sentences are extracted forward and backward from the current sentence; Storage module 5306 is used to store the current sentence and update the next adjacent sentence corresponding to the current sentence to the target sentence when the semantic similarity of the preset number of adjacent sentences is less than or equal to the preset similarity threshold. The merging module 5307 is used to merge the current sentence with adjacent sentences that have a semantic similarity greater than the preset similarity threshold when the semantic similarity of the preset number of adjacent sentences is determined to be greater than the preset similarity threshold, to obtain a merged sentence, and to update the merged sentence to the target sentence; The seventh judgment module 5308 is used to determine whether the target sentence is the last sentence in the text sentence; wherein, the text sentence is a sentence extracted from the valid verification file that contains valid specifications; The determining module 5309 is used to determine the target sentence as the target text segment when the target sentence is determined to be the last sentence in the text sentence; The execution module 53010 is used to determine whether the semantic similarity of the preset number of adjacent sentences is greater than the preset similarity threshold when it is determined that the target sentence is not the last sentence in the text sentence.

[0133] Furthermore, in one possible implementation of the embodiments of this disclosure, such as Figure 13 As shown, the third verification unit 53 further includes: The truncation module 53011 is used to truncate text sentences with valid norms from the valid verification file before the sixth judgment module 5305 judges whether the semantic similarity of a preset number of adjacent sentences is greater than a preset similarity threshold, to obtain the current sentence, and to judge whether the character length of the current sentence meets the preset verification conditions. Skip module 53012 is used to skip the current content verification when it is determined that the character length of the current sentence does not meet the preset verification condition; The calculation module 53013 is used to extract a preset number of adjacent sentences corresponding to the current sentence forward and backward, and calculate the semantic similarity between the preset number of adjacent sentences and the current sentence, provided that the character length of the current sentence meets the preset verification condition.

[0134] Furthermore, in one possible implementation of the embodiments of this disclosure, such as Figure 13 As shown, the device further includes: Construction unit 54 is used to construct the verification rule library according to different format rules in different preset file templates before the first verification unit 51 performs format verification on the file to be verified based on the verification rule library to obtain the format verification file; Processing unit 55 is used to perform format processing on the original file to obtain the file to be verified; The first verification unit 51 includes: Parsing module 5101 is used to parse the file to be verified to obtain a parsed file; The second matching module 5102 is used to match the parsed file with the verification rule base to obtain the format verification file.

[0135] Furthermore, in one possible implementation of the embodiments of this disclosure, such as Figure 13 As shown, the device further includes: The query unit 56 is used to construct the standard dataset and query whether a new standard is released according to a preset period before the second verification unit 52 performs validity verification on the format verification file based on the validity check table and obtains a valid verification file. The first establishment unit 57 is used to update the standard dataset when the newly released standard is found, to obtain the updated standard dataset, to establish the validity check table based on the information fields in the updated standard dataset, and to convert the text content in the updated standard dataset to obtain the standard database. The second establishment unit 58 is used to establish the validity check table based on the information fields in the standard dataset when the newly released standard is not found, and to convert the text content in the standard dataset to obtain the standard database.

[0136] Furthermore, in one possible implementation of the embodiments of this disclosure, such as Figure 13 As shown, the device further includes: Judgment unit 59 is used to determine whether a table exists in the text content; The recognition unit 510 is used to perform table recognition on the table when it is determined that the table exists in the text content, so as to obtain a text paragraph; The first slicing unit 511 is used to perform preliminary slicing on the level corresponding to the text paragraph to obtain the hierarchical structure, and to parse the last level corresponding to the hierarchical structure to obtain the processed text content; wherein, the text paragraph is obtained by splitting the merged cells in the table and parsing the nested table layer by layer; The second slicing unit 512 is used to perform preliminary slicing of the level corresponding to the text paragraph when it is determined that the table does not exist in the text content, to obtain the level structure, and to parse the last level corresponding to the level structure to obtain the processed text content. The encoding unit 513 is used to perform vectorization encoding on the processed text content to obtain the standard database.

[0137] It should be noted that the foregoing explanation of the method embodiments also applies to the apparatus of the embodiments of this disclosure, and the principle is the same. Therefore, the embodiments of this disclosure are not limited thereto.

[0138] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0139] Figure 14 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0140] like Figure 14As shown, the electronic device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in ROM (Read-Only Memory) 602 or loaded from storage unit 608 into RAM (Random Access Memory) 603. The RAM 603 may also store various programs and data required for the operation of the electronic device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via a bus 604. An I / O (Input / Output) interface 605 is also connected to the bus 604.

[0141] Multiple components in electronic device 600 are connected to I / O interface 605, including: input unit 606, such as keyboard, mouse, etc.; output unit 607, such as various types of displays, speakers, etc.; storage unit 608, such as disk, optical disk, etc.; and communication unit 609, such as network card, modem, wireless transceiver, etc. Communication unit 609 allows electronic device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0142] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, CPUs (Central Processing Units), GPUs (Graphics Processing Units), various special-purpose AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, DSPs (Digital Signal Processors), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as document verification methods. For example, in some embodiments, the document verification method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the methods described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the aforementioned file verification method by any other suitable means (e.g., by means of firmware).

[0143] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application-Specific Standard Products), SOCs (System-on-Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0144] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0145] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, RAM, ROM, EPROM (Electrically Programmable Read-Only Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0146] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0147] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include LANs (Local Area Networks), WANs (Wide Area Networks), the Internet, and blockchain networks.

[0148] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service system that addresses the shortcomings of traditional physical hosts and VPS (Virtual Private Server) services, such as high management difficulty and weak business scalability. Servers can also be servers for distributed systems or servers incorporating blockchain technology.

[0149] It's important to note that artificial intelligence (AI) is the study of enabling computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). It encompasses both hardware and software technologies. AI hardware technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, and big data processing. AI software technologies primarily include computer vision, speech recognition, natural language processing, machine learning / deep learning, big data processing, and knowledge graph technologies.

[0150] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0151] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A file verification method, characterized in that, The method includes: The format of the file to be verified is validated based on the validation rule base to obtain a format-validated file; wherein, the validation rule base is constructed by means of format rules in a preset file template; The validity of the format verification file is performed based on the validity check table to obtain a valid verification file; wherein, the validity check table and the standard database are constructed or updated using the latest standard dataset; Based on the standard database and target language model, the content of the valid verification file is verified to obtain the target verification file.

2. The method according to claim 1, characterized in that, The step of validating the format verification file based on the validity check table to obtain a valid verification file includes: Determine whether the publication date of the format verification file is less than the obsolescence date; If the publication date is determined to be greater than or equal to the obsolescence date, query the alternative result of the specification information corresponding to the format verification file, and output the first prompt information corresponding to the alternative result; If it is determined that the publication date is less than the obsolescence date, the specification information corresponding to the format verification file is determined to be a valid specification; Determine whether a combination of specification name and standard number exists in the format verification file corresponding to the valid specification; If it is determined that there is no combination of the specification name and the standard number, the corresponding second prompt message will be output; If a combination of the specification name and the standard number is found, the standard number is matched with the corresponding standard number in the validity check table to obtain the valid verification file.

3. The method according to claim 2, characterized in that, Before determining whether the publication date corresponding to the format verification file is less than the obsolescence date, the method further includes: Determine whether the specification name corresponding to the format verification file is matched in the validity check table; If it is determined that no matching standard information is found for the standard name, a third prompt message will be output. If the specification information is found to be matched, it is determined whether the specification status corresponding to the specification information is valid. If the specified status is determined to be invalid, a fourth prompt message will be output; If the specification status is determined to be valid, the publication date corresponding to the format verification file is obtained.

4. The method according to claim 1, characterized in that, The process of performing content verification on the valid verification file based on the standard database and the target language model to obtain the target verification file includes: Determine whether the target text fragment contains an entry number; wherein the target text fragment is related to the last sentence of the text sentence in the valid verification file; If the target text fragment contains the entry number, extract the standard name and the entry number, and locate the corresponding vector content in the standard database; If it is determined that the target text fragment does not contain the entry number, the standard name is extracted, and the corresponding vector content in the standard database is located. The vector content is reconstructed using the target language model, and the reconstructed vector content is dynamically retrieved to obtain the target verification file.

5. The method according to claim 4, characterized in that, Before determining whether the target text fragment contains an entry number, the process includes: Determine whether the semantic similarity of a preset number of adjacent sentences is greater than a preset similarity threshold; wherein, the preset number of adjacent sentences are extracted from the current sentence forward and backward; If the semantic similarity of the preset number of adjacent sentences is less than or equal to the preset similarity threshold, the current sentence is stored, and the next adjacent sentence corresponding to the current sentence is updated to the target sentence. If the semantic similarity of a predetermined number of adjacent sentences is greater than a predetermined similarity threshold, the current sentence is merged with adjacent sentences that are greater than the predetermined similarity threshold to obtain a merged sentence, and the merged sentence is updated to the target sentence. Determine whether the target sentence is the last sentence in the text sentence; wherein, the text sentence is a sentence extracted from the valid verification file that contains valid specifications; If the target sentence is determined to be the last sentence in the text sentence, the target sentence is determined to be the target text segment; The step of determining whether the semantic similarity of a preset number of adjacent sentences is greater than a preset similarity threshold includes: If it is determined that the target sentence is not the last sentence in the text sentence, the semantic similarity of the preset number of adjacent sentences is judged to be greater than the preset similarity threshold.

6. The method according to claim 5, characterized in that, Before determining whether the semantic similarity of a preset number of adjacent sentences is greater than a preset similarity threshold, the process includes: Extract the text sentence containing valid specifications from the valid verification file to obtain the current sentence, and determine whether the character length of the current sentence meets the preset verification conditions; If the character length of the current sentence does not meet the preset verification condition, skip this content verification. If the character length of the current sentence satisfies the preset verification condition, the preset number of adjacent sentences corresponding to the current sentence are extracted forward and backward, and the semantic similarity between the preset number of adjacent sentences and the current sentence is calculated.

7. The method according to any one of claims 1-6, characterized in that, Before performing format validation on the file to be validated based on the validation rule base to obtain the format-validated file, the method further includes: The verification rule library is constructed based on different format rules in different preset file templates; The original file is formatted to obtain the file to be verified; The process of performing format validation on the file to be validated based on the validation rule base to obtain a format validation file includes: The file to be verified is parsed to obtain a parsed file; The parsed file is matched against the verification rule base to obtain the format verification file.

8. The method according to any one of claims 1-6, characterized in that, Before performing validity checks on the format verification file based on the validity check table to obtain a valid verification file, the method further includes: Construct the standard dataset and query whether a new standard has been released according to a preset period; If the newly released standard is found, the standard dataset is updated to obtain the updated standard dataset. Based on the information fields in the updated standard dataset, the validity check table is established, and the text content in the updated standard dataset is transformed to obtain the standard database. If the newly released standard is not found, a validity check table is established based on the information fields in the standard dataset, and the text content in the standard dataset is transformed to obtain the standard database.

9. The method according to claim 8, characterized in that, The process of converting the text content in the standard dataset to obtain the standard database includes: Determine whether a table exists in the text content; If the table is found to exist in the text content, the table is identified to obtain a text paragraph; The text paragraphs are initially sliced ​​to obtain a hierarchical structure, and the last layer of the hierarchical structure is parsed to obtain the processed text content; wherein, the text paragraphs are obtained by splitting the merged cells in the table and parsing the nested tables layer by layer; If it is determined that the table does not exist in the text content, the hierarchy corresponding to the text paragraph is initially sliced ​​to obtain the hierarchy structure, and the last layer corresponding to the hierarchy structure is parsed to obtain the processed text content; The processed text content is vectorized and encoded to obtain the standard database.

10. A document verification device, characterized in that, The device includes: The first verification unit is used to perform format verification on the file to be verified based on the verification rule base to obtain a format verification file; wherein, the verification rule base is constructed by the format rules in the preset file template; The second verification unit is used to perform validity verification on the format verification file based on the validity check table to obtain a valid verification file; wherein the validity check table and the standard database are constructed or updated through the latest standard dataset; The third verification unit is used to perform content verification on the valid verification file based on the standard database and the target language model to obtain the target verification file.