Dwg file and pdf file consistency verification method based on information abstract algorithm
Through the information summary algorithm, the consistency verification of the dwg file and the pdf file is solved, and the problem of no tampering, no loss or omission in the printing process of drawing information in the survey and design industry is achieved, and the information consistency between the dwg file and the pdf file is achieved. Compare to ensure the integrity of the reviewed information.
Patent Information
- Application Number
- CN202411201888.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2025-01-07
AI Technical Summary
In the survey and design industry, the existing technology cannot effectively ensure that the drawing information is not tampered, lost or omission during the printing process. Especially when the dwg file is converted into a pdf file, the review opinions cannot be reproduced in the dwg file, resulting in difficulty in tracing the problem .
The consistency verification method of dwg file and pdf file based on the information digest algorithm is used to generate an information summary by obtaining the specified key content of the dwg file and writing it to the metadata of the pdf file. The consistency between the two is compared when uploading. , ensure that file information is not tampered, lost or omissioned.
It realizes the direct information consistency comparison between the dwg file and the pdf file during the electronic review process, ensuring that the review information is not tampered, lost, and omission, and solves the problem of information integrity during the file conversion process.
Smart Images

Figure CN119272345A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electronic submission of drawings for review in the survey and design industry, and in particular to a method for verifying the consistency of dwg files and pdf files based on an information summary algorithm. Background Art
[0002] At present, design companies generally use online PDF file transfer for drawing review, that is, users complete the DWG file production in CAD software, and then print the DWG file into PDF file for review. During the review process, only PDF files can be reviewed, and the review opinions cannot be reproduced in the DWG file, which greatly hinders the tracing of problems. Some survey and design platforms use DWG files for online review. After the review is completed, the DWG files are printed into PDF files for delivery or archiving. However, during the printing process, it cannot be guaranteed that the drawing information is not tampered with, lost, or omitted.
[0003] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0004] The main purpose of this application is to provide a consistency verification method for dwg files and pdf files based on an information summary algorithm, aiming to solve the technical problem in the prior art that it is impossible to ensure that the drawing information is not tampered with, lost or omitted during the printing process.
[0005] To achieve the above purpose, the present application proposes a method for verifying the consistency of a dwg file and a pdf file based on an information digest algorithm. The method for verifying the consistency of a dwg file and a pdf file based on an information digest algorithm includes:
[0006] Obtaining designated key content in the first dwg file, and generating a first information summary according to the designated key content;
[0007] When printing the first dwg file as a pdf file, writing the first information summary into the pdf file metadata;
[0008] When uploading the second dwg file and the pdf file, generating a second information summary according to the specified key content in the second dwg file, and extracting the first information summary from the metadata in the pdf file;
[0009] The first information summary is compared with the second information summary to determine the consistency result between the second dwg file and the pdf file.
[0010] In one embodiment, the step of obtaining the designated key content in the first dwg file and generating the first information summary according to the designated key content includes:
[0011] Get the preset key content directory of the dwg file;
[0012] Extracting structured data of the first dwg file according to the key content directory, and determining structured parameters in the first dwg file based on the structured data and the key content directory;
[0013] First summary information is generated according to the structured parameters.
[0014] In one embodiment, the step of generating the first summary information according to the structural parameters includes:
[0015] Performing text marking on the structured parameters to obtain preprocessed data;
[0016] Obtaining a sentence vector of the text according to the text tag;
[0017] Calculating the similarity between the sentence vectors based on a cosine similarity algorithm, and reallocating the weights of the sentence vectors according to the similarity;
[0018] Based on the weight of the sentence vector, first summary information is generated according to the sentence vector.
[0019] In one embodiment, when printing the first dwg file as a pdf file, the step of writing the first information summary into the pdf file metadata comprises:
[0020] receiving the first dwg file and loading the first information summary;
[0021] When receiving a print instruction, the file attribute of the PDF file can be read, and the file attribute can be modified based on the first summary information to obtain the modified file attribute;
[0022] The modified file attributes are written into the metadata of the pdf file.
[0023] In one embodiment, when uploading the second dwg file and the pdf file, the steps of generating the second information summary according to the specified key content in the second dwg file and extracting the first information summary from the metadata in the pdf file include:
[0024] When uploading the second dwg file and the pdf file, text marking is performed on the structural parameters of the second dwg file, and a sentence vector of the second dwg file is generated according to the text marking;
[0025] Generate second summary information according to the sentence vector of the second dwg file;
[0026] The metadata of the PDF file is parsed to obtain the first information summary.
[0027] In one embodiment, the step of comparing the first information digest with the second information digest to determine the consistency result between the second dwg file and the pdf file includes:
[0028] Comparing the first information digest with the second information digest to obtain a comparison result;
[0029] When the comparison result is that the first information summary is consistent with the second information summary, outputting a consistency result that the second dwg file is consistent with the pdf file;
[0030] When the comparison result is that the first information summary and the second information summary are inconsistent, a consistency result indicating that the second dwg file and the pdf file are inconsistent is output.
[0031] In one embodiment, after the step of comparing the first information digest with the second information digest to determine the consistency result between the second dwg file and the pdf file, the method further includes:
[0032] When the consistency result is that the second dwg file is consistent with the pdf file, reading the icon information of the pdf file, and reading the icon header file information of the printed pdf file;
[0033] Compare the icon information with the icon header file information to obtain a comparison result;
[0034] When the comparison result is consistent, associating the PDF file with the printed PDF file;
[0035] When the comparison result is inconsistent, the PDF file is printed out;
[0036] When the consistency result is that the second dwg file is inconsistent with the pdf file, the print command is not executed, and a prompt message indicating that the file has been modified is output.
[0037] In addition, to achieve the above purpose, the present application also proposes a dwg file and pdf file consistency verification device based on an information digest algorithm, and the dwg file and pdf file consistency verification device based on an information digest algorithm includes:
[0038] A summary generation module, used for obtaining designated key content in the first dwg file, and generating a first information summary according to the designated key content;
[0039] A summary writing module, used for writing the first information summary into the PDF file metadata when printing the first DWG file as a PDF file;
[0040] A judgment preparation module, used for generating a second information summary according to the specified key content in the second dwg file and extracting the first information summary from the metadata in the pdf file when uploading the second dwg file and the pdf file;
[0041] The consistency judgment module is used to compare the first information summary with the second information summary to determine the consistency result between the second dwg file and the pdf file.
[0042] In addition, to achieve the above-mentioned purpose, the present application also proposes a dwg file and pdf file consistency verification device based on an information digest algorithm, the device comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the dwg file and pdf file consistency verification method based on the information digest algorithm as described above.
[0043] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the method for verifying the consistency of dwg files and pdf files based on the information summary algorithm as described above are implemented.
[0044] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the method for consistency verification of dwg files and pdf files based on the information summary algorithm as described above.
[0045] One or more technical solutions proposed in the present application have at least the following technical effects: by obtaining designated key content in a first dwg file, a first information summary is generated according to the designated key content; when the first dwg file is printed as a pdf file, the first information summary is written into the pdf file metadata; when uploading a second dwg file and a pdf file, a second information summary is generated according to the designated key content in the second dwg file, and the first information summary is extracted from the metadata in the pdf file; the first information summary is compared with the second information summary to determine the consistency result between the second dwg file and the pdf file; and through consistency comparison, it can be ensured that the direct information of the reviewed dwg file and the pdf file is not tampered with, lost, or omitted. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0048] Figure 1 A flow chart of a method for verifying the consistency between a dwg file and a pdf file based on an information summary algorithm according to an embodiment of the present invention;
[0049] Figure 2 A schematic diagram of summary information provided in an embodiment of a method for verifying consistency between a dwg file and a pdf file based on an information summary algorithm of the present application;
[0050] Figure 3 A schematic diagram of a file comparison process provided for an embodiment of a method for checking consistency between a dwg file and a pdf file based on an information summary algorithm of the present application;
[0051] Figure 4 This is a schematic diagram of the module structure of a device for checking consistency between a dwg file and a pdf file based on an information digest algorithm according to an embodiment of the present application;
[0052] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the method for verifying the consistency of dwg files and pdf files based on the information summary algorithm in the embodiment of the present application.
[0053] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0054] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0055] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0056] The main solution of the embodiment of the present application is: obtain the specified key content in the first dwg file, and generate a first information summary according to the specified key content; when printing the first dwg file as a pdf file, write the first information summary into the pdf file metadata; when uploading the second dwg file and the pdf file, generate a second information summary according to the specified key content in the second dwg file, and extract the first information summary from the metadata in the pdf file; compare the first information summary with the second information summary to determine the consistency result between the second dwg file and the pdf file.
[0057] In this embodiment, for ease of description, the following description is made by taking the identification of a consistency check device for dwg files and pdf files based on an information digest algorithm as the execution subject.
[0058] The existing technology currently generally adopts online transmission of PDF files for drawing review, that is, users complete the production of DWG files in CAD software, and then print the DWG files into PDF files for review. During the review process, only PDF files can be reviewed, and the review opinions cannot be reproduced in the DWG files, which greatly hinders the tracing of problems. Some survey and design platforms use DWG files for online review. After the review is completed, the DWG files are printed into PDF files for delivery or archiving. However, during the printing process, it cannot be guaranteed that the drawing information is not tampered with, lost, or omitted.
[0059] This application provides a solution that verifies the consistency of dwg files and pdf files through an information summary algorithm, so that the dwg drawings can be directly reviewed during the electronic review process of the design drawings, ensuring that the direct information of the reviewed dwg files and pdf files is not tampered with, lost, or omitted.
[0060] It can be seen from the above embodiments that the present application obtains the specified key content in the first dwg file, generates a first information summary according to the specified key content, and when printing the first dwg file as a pdf file, writes the first information summary into the pdf file metadata, and when uploading the second dwg file and the pdf file, generates a second information summary according to the specified key content in the second dwg file, extracts the first information summary from the metadata in the pdf file, compares the first information summary with the second information summary, determines the consistency result between the second dwg file and the pdf file, and can ensure, through consistency comparison, that the direct information of the reviewed dwg file and the pdf file is not tampered with, lost, or omitted.
[0061] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a dwg file and pdf file consistency check device based on an information digest algorithm, etc. The following takes a dwg file and pdf file consistency check device based on an information digest algorithm as an example to illustrate this embodiment and the following embodiments.
[0062] Based on this, the embodiment of the present application provides a method for checking the consistency between a dwg file and a pdf file based on an information digest algorithm. Figure 1 , Figure 1 This is a flow chart of the first embodiment of the method for verifying the consistency between a dwg file and a pdf file based on an information summary algorithm of the present application.
[0063] In this embodiment, the method for checking consistency between a dwg file and a pdf file based on an information digest algorithm includes steps S10 to S40:
[0064] Step S10, obtaining designated key content in the first dwg file, and generating a first information summary according to the designated key content.
[0065] It should be noted that the dwg file is a file format for graphic information of two-dimensional and three-dimensional design data and metadata, mainly used in the field of computer-aided design (CAD) technology, for storing two-dimensional drawings, three-dimensional models and other design and product data, and the first dwg file refers to the dwg file completed by the user in the CAD software, the dwg file that needs to be reviewed online, and the designated key content refers to the content that needs to be reviewed, including but not limited to the atlas information, the name of the drawing, the last edit time, the last editor and other information. The first information summary refers to the short text content generated based on the designated key content.
[0066] In a specific implementation, during online drawing review, the designated key content in the first dwg file can be determined, and the designated key content is the file content that can be reflected in the dwg file, as well as the editing information of the dwg file, etc. After determining the designated key content, the graphic information and text information in the dwg file can be read, and the information that meets the designated key content can be extracted, and it can be determined as a summary information generation data set, and summary information is generated by an information summary algorithm based on the summary information generation data set.
[0067] In a feasible implementation manner, the step of obtaining the designated key content in the first dwg file and generating the first information summary according to the designated key content includes:
[0068] Get the preset key content directory of the dwg file;
[0069] Extracting structured data of the first dwg file according to the key content directory, and determining structured parameters in the first dwg file based on the structured data and the key content directory;
[0070] First summary information is generated according to the structured parameters.
[0071] It should be noted that the key content directory refers to a data set that stores specified key content. Users can edit the key content directory, including adding, deleting, and modifying the key content in the key content directory. In the dwg file, the data is composed of multiple structural blocks, and structured data refers to the data in each structural block, and the specific parameters are structured parameters.
[0072] In the specific implementation, refer to Figure 2 , Figure 2 It is a schematic diagram of summary information. When generating the first information summary according to the specified key content in the first dwg file, the dwg file can be globally scanned to determine the structural blocks in the dwg file, and the structural blocks can be read to obtain the structured data in the dwg file, and the structural parameters in the structured data can be quickly determined and extracted, including atlas information (tcmc), drawing number information (tcth), update time (Update_Time), updater (User), etc., and the first summary information S_infodwg is generated through the structural parameters.
[0073] In a feasible implementation manner, the step of generating the first summary information according to the structural parameter includes:
[0074] Performing text marking on the structured parameters to obtain preprocessed data;
[0075] Obtaining a sentence vector of the text according to the text tag;
[0076] Calculating the similarity between the sentence vectors based on a cosine similarity algorithm, and reallocating the weights of the sentence vectors according to the similarity;
[0077] Based on the weight of the sentence vector, first summary information is generated according to the sentence vector.
[0078] It should be noted that text tagging is to divide the original text into smaller units, such as sentences or phrases. Preprocessed data refers to the data set obtained after tagging the structured parameters. Sentence vector refers to the conversion of a sentence into a numerical vector form. The similarity between sentence vectors refers to the degree of proximity of the semantic content expressed by two sentences quantified by mathematical methods. The weight of the sentence vector refers to the numerical value that quantifies the importance of each element in the sentence (such as words, phrases or the entire sentence itself) in text processing or natural language processing tasks.
[0079] In a specific implementation, when generating the first summary information according to the structured parameters, the structured parameters can be loaded first, and the structured parameters can be marked in text, such as performing word segmentation in the text, adding specific tags, etc. The text tags can be fine-tuned based on the Bert algorithm to determine the summary tasks that need to be performed. At the same time, the sample data is processed based on the Bert algorithm to determine that the text length is suitable for the model input, and the summary is appropriately truncated to control the maximum length of the input and output. Based on this, the sentence vector is obtained, and the similarity between different sentences is measured by the cosine similarity algorithm. The similarity is evaluated by calculating the cosine value of the angle between two terms, and its value ranges from -1 (completely dissimilar) to 1 (completely identical). According to the calculated similarity, the sentence vector is weighted. For example, if the sentence vectors of two sentences are highly similar, their weights may be reduced to avoid repeating similar information in the summary. According to the adjusted weights, the most important sentences are selected or the sentences are merged to generate the first information summary.
[0080] Step S20: when printing the first dwg file as a pdf file, writing the first information summary into the pdf file metadata.
[0081] It should be noted that the PDF file is the file obtained by printing the DWG file when it is submitted for review. The PDF file metadata refers to a set of information that describes the PDF file, including but not limited to the file title, author, subject, keywords, creation date, modification date, etc. Metadata is usually stored in the XML format in the PDF file.
[0082] In a specific implementation, when the first dwg file is printed as a pdf file, the process of writing the first information summary into the metadata of the pdf file can be to use a pdf editing tool or library to edit and add metadata, and write the first information summary in text form into the metadata part of the pdf file through the "properties" or "metadata" editing function of the pdf editing software. When writing metadata, the security and permission settings of the pdf file are considered to ensure that the metadata will not be modified without authorization. Therefore, the step of writing the first information summary into the metadata of the pdf file will be executed only when the authorization is successful.
[0083] In a feasible implementation manner, when printing the first dwg file as a pdf file, the step of writing the first information summary into the pdf file metadata includes:
[0084] receiving the first dwg file and loading the first information summary;
[0085] When receiving a print instruction, the file attribute of the PDF file can be read, and the file attribute can be modified based on the first summary information to obtain the modified file attribute;
[0086] The modified file attributes are written into the metadata of the pdf file.
[0087] It should be noted that the printing instruction refers to a control instruction for controlling the printing of a dwg file into a pdf file.
[0088] In a specific implementation, a first DWG file containing a design and metadata is received, and a first information summary is extracted or generated from the DWG file, including design instructions, key parameters, author information, etc. When the system or user issues an instruction to print the DWG file as a PDF file, the PDF file properties are read. After the PDF file is generated, PDF processing software or a library is used to read its existing file properties, such as title, author, subject, etc. The properties of the PDF file are modified accordingly based on the first information summary loaded from the DWG file, and the modified file properties are saved as a new data set. These data will be used to update the metadata of the PDF file, and the PDF editing function is used to write the modified file properties into the metadata part of the PDF file. After writing the metadata, it is verified whether the update is correctly reflected in the properties of the PDF file to ensure the accuracy and completeness of the information.
[0089] Step S30, when uploading the second dwg file and the pdf file, generating a second information summary according to the designated key content in the second dwg file, and extracting the first information summary from the metadata in the pdf file.
[0090] It should be noted that the second dwg file refers to the dwg file used when performing document comparison, and the second information summary is based on summary information obtained from the second dwg file.
[0091] In a specific implementation, when uploading a second dwg file and a pdf file, text marking is performed on the structural parameters of the second dwg file, and a sentence vector of the second dwg file is generated based on the text marking; second summary information is generated based on the sentence vector of the second dwg file, and the metadata of the pdf file is parsed to obtain the first information summary.
[0092] Step S40: compare the first information summary with the second information summary to determine the consistency result between the second dwg file and the pdf file.
[0093] It should be noted that the consistency result refers to the result of comparing the first information digest with the second information digest, which is used to reflect the consistency of the dwg file and the pdf file.
[0094] In the specific implementation, when uploading dwg files and pdf files, the dwg file information is re-extracted and a new summary is generated, which is compared with the summary embedded in the pdf file to automatically identify the differences and inconsistencies between the two. The comparison process uses a hash algorithm to ensure the accuracy and real-time nature of the verification results.
[0095] In a feasible implementation manner, the step of comparing the first information digest with the second information digest to determine the consistency result between the second dwg file and the pdf file includes:
[0096] Comparing the first information digest with the second information digest to obtain a comparison result;
[0097] When the comparison result is that the first information summary is consistent with the second information summary, outputting a consistency result that the second dwg file is consistent with the pdf file;
[0098] When the comparison result is that the first information summary and the second information summary are inconsistent, a consistency result indicating that the second dwg file and the pdf file are inconsistent is output.
[0099] In a specific implementation, when printing, the dwg file and the pdf file can be compared, the second information summary in the current second dwg file can be detected, and the first information summary saved in the pdf file can be obtained at the same time, and the first information summary and the second information summary are compared to determine whether they are consistent. The comparison result can be obtained through the relevant status query mechanism provided by AutoCAD. When the comparison result is that the first information summary is consistent with the second information summary, the consistency result that the second dwg file and the pdf file are consistent is output; when the comparison result is that the first information summary and the second information summary are inconsistent, the consistency result that the second dwg file and the pdf file are inconsistent is output.
[0100] In a feasible implementation manner, after the step of comparing the first information digest with the second information digest to determine the consistency result between the second dwg file and the pdf file, the step further includes:
[0101] When the consistency result is that the second dwg file is consistent with the pdf file, reading the icon information of the pdf file, and reading the icon header file information of the printed pdf file;
[0102] Compare the icon information with the icon header file information to obtain a comparison result;
[0103] When the comparison result is consistent, associating the PDF file with the printed PDF file;
[0104] When the comparison result is inconsistent, the PDF file is printed out;
[0105] When the consistency result is that the second dwg file is inconsistent with the pdf file, the print command is not executed, and a prompt message indicating that the file has been modified is output.
[0106] It should be noted that the icon information refers to a thumbnail of a file or a graphic representation related to a file type, and the icon header file information refers to file information or configuration file information containing these icons.
[0107] In the specific implementation, refer to Figure 3 , Figure 3 It is a schematic diagram of the file comparison process. When the consistency result is that the second dwg file is consistent with the pdf file, the printing operation can be performed, and the icon information of the pdf file can be read, and the icon header file information of the printed pdf file can be read, and the icon information can be compared with the icon header file information to obtain the comparison result. When the comparison result is consistent, that is, when the current icon information is consistent with the printed drawing header file, the current pdf file can be associated with the existing file. When the comparison result is inconsistent, when the current icon information is inconsistent with the printed drawing header file, the normal printing procedure is executed at this time. When the consistency result is that the second dwg file is inconsistent with the pdf file, the print command is not executed, and a prompt message that the file has been modified is output to notify the user that "the file has been modified and cannot be printed. It needs to be closed and reopened."
[0108] This embodiment provides a method for verifying the consistency of a dwg file and a pdf file based on an information summary algorithm, by obtaining designated key content in a first dwg file, generating a first information summary according to the designated key content, and writing the first information summary into the pdf file metadata when printing the first dwg file as a pdf file, and generating a second information summary according to the designated key content in the second dwg file when uploading a second dwg file and a pdf file, and extracting the first information summary from the metadata in the pdf file, and comparing the first information summary with the second information summary to determine the consistency result between the second dwg file and the pdf file, so that the direct information of the reviewed dwg file and the pdf file is not tampered with, lost, or omitted through consistency comparison.
[0109] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the consistency verification method of dwg files and pdf files based on the information summary algorithm of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0110] This application also provides a dwg file and pdf file consistency verification device based on information summary algorithm, please refer to Figure 4 The dwg file and pdf file consistency verification device based on the information summary algorithm includes:
[0111] A summary generation module 10 is used to obtain a specified key content in the first dwg file and generate a first information summary according to the specified key content;
[0112] A summary writing module 20, used for writing the first information summary into the PDF file metadata when printing the first DWG file as a PDF file;
[0113] A judgment preparation module 30, used for generating a second information summary according to the specified key content in the second dwg file and extracting the first information summary from the metadata in the pdf file when uploading the second dwg file and the pdf file;
[0114] The consistency judgment module 40 is used to compare the first information summary with the second information summary to determine the consistency result between the second dwg file and the pdf file.
[0115] The dwg file and pdf file consistency verification device based on the information digest algorithm provided by the present application adopts the dwg file and pdf file consistency verification method based on the information digest algorithm in the above embodiment, which can solve the technical problem in the prior art that it is impossible to ensure that the drawing information is not tampered with, lost, or omitted during the printing process. Compared with the prior art, the beneficial effects of the dwg file and pdf file consistency verification device based on the information digest algorithm provided by the present application are the same as the beneficial effects of the dwg file and pdf file consistency verification method based on the information digest algorithm provided by the above embodiment, and the other technical features of the dwg file and pdf file consistency verification device based on the information digest algorithm are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0116] The present application provides a device for verifying the consistency of a dwg file and a pdf file based on an information digest algorithm. The device for verifying the consistency of a dwg file and a pdf file based on an information digest algorithm comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for verifying the consistency of a dwg file and a pdf file based on the information digest algorithm in the first embodiment above.
[0117] Reference below Figure 5 , which shows a schematic diagram of the structure of a dwg file and pdf file consistency check device based on an information digest algorithm suitable for implementing the embodiment of the present application. The dwg file and pdf file consistency check device based on an information digest algorithm in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The dwg file and pdf file consistency verification device based on the information summary algorithm shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0118] like Figure 5As shown, the consistency check device for dwg files and pdf files based on the information digest algorithm may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM: ReadOnly Memory) 1002 or the program loaded from the storage device 1003 to the random access memory (RAM: RandomAccess Memory) 1004. In RAM1004, various programs and data required for the operation of the consistency check device for dwg files and pdf files based on the information digest algorithm are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the dwg file and pdf file consistency verification device based on the information digest algorithm to communicate wirelessly or wired with other devices to exchange data. Although the dwg file and pdf file consistency verification device based on the information digest algorithm with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.
[0119] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0120] The dwg file and pdf file consistency verification device based on the information digest algorithm provided by the present application adopts the dwg file and pdf file consistency verification method based on the information digest algorithm in the above embodiment, which can solve the technical problem that the prior art cannot ensure that the drawing information is not tampered with, lost, or omitted during the printing process. Compared with the prior art, the beneficial effects of the dwg file and pdf file consistency verification device based on the information digest algorithm provided by the present application are the same as the beneficial effects of the dwg file and pdf file consistency verification method based on the information digest algorithm provided in the above embodiment, and the other technical features of the dwg file and pdf file consistency verification device based on the information digest algorithm are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0121] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0122] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0123] The present application provides a computer-readable storage medium having computer-readable program instructions (i.e., computer programs) stored thereon, and the computer-readable program instructions are used to execute the method for verifying the consistency of dwg files and pdf files based on the information summary algorithm in the above-mentioned embodiment.
[0124] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0125] The above-mentioned computer-readable storage medium can be included in the dwg file and pdf file consistency verification device based on the information digest algorithm; or it can exist independently without being assembled into the dwg file and pdf file consistency verification device based on the information digest algorithm.
[0126] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the dwg file and pdf file consistency verification device based on the information digest algorithm, the dwg file and pdf file consistency verification device based on the information digest algorithm:
[0127] Obtaining designated key content in the first dwg file, and generating a first information summary according to the designated key content;
[0128] When printing the first dwg file as a pdf file, writing the first information summary into the pdf file metadata;
[0129] When uploading the second dwg file and the pdf file, generating a second information summary according to the specified key content in the second dwg file, and extracting the first information summary from the metadata in the pdf file;
[0130] The first information summary is compared with the second information summary to determine the consistency result between the second dwg file and the pdf file.
[0131] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0132] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0133] The modules involved in the embodiments of the present application may be implemented by software or hardware, wherein the name of the module does not limit the unit itself in some cases.
[0134] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned method for verifying the consistency of dwg files and pdf files based on the information digest algorithm, and can solve the technical problem in the prior art that it is impossible to ensure that the drawing information is not tampered with, lost, or omitted during the printing process. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the method for verifying the consistency of dwg files and pdf files based on the information digest algorithm provided by the above-mentioned embodiment, and will not be repeated here.
[0135] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the above-mentioned method for verifying the consistency of a dwg file and a pdf file based on an information summary algorithm.
[0136] The computer program product provided by the present application can solve the technical problem in the prior art that it is impossible to ensure that the drawing information is not tampered with, lost, or omitted during the printing process. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the consistency verification method of the dwg file and the pdf file based on the information summary algorithm provided in the above embodiment, and will not be repeated here.
[0137] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for checking consistency between a dwg file and a pdf file based on an information summary algorithm, characterized in that: The method for checking consistency between a dwg file and a pdf file based on an information summary algorithm includes: Obtaining designated key content in the first dwg file, and generating a first information summary according to the designated key content; When printing the first dwg file as a pdf file, writing the first information summary into the pdf file metadata; When uploading the second dwg file and the pdf file, generating a second information summary according to the specified key content in the second dwg file, and extracting the first information summary from the metadata in the pdf file; The first information summary is compared with the second information summary to determine the consistency result between the second dwg file and the pdf file.
2. The method according to claim 1, characterized in that The step of obtaining the designated key content in the first dwg file and generating the first information summary according to the designated key content comprises: Get the preset key content directory of the dwg file; Extracting structured data of the first dwg file according to the key content directory, and determining structured parameters in the first dwg file based on the structured data and the key content directory; First summary information is generated according to the structured parameters.
3. The method according to claim 2, characterized in that The step of generating the first summary information according to the structural parameters comprises: Performing text marking on the structured parameters to obtain preprocessed data; Obtaining a sentence vector of the text according to the text tag; Calculating the similarity between the sentence vectors based on a cosine similarity algorithm, and reallocating the weights of the sentence vectors according to the similarity; Based on the weight of the sentence vector, first summary information is generated according to the sentence vector.
4. The method according to claim 1, characterized in that When printing the first dwg file as a pdf file, the step of writing the first information summary into the pdf file metadata comprises: receiving the first dwg file and loading the first information summary; When receiving a print instruction, the file attribute of the PDF file can be read, and the file attribute can be modified based on the first summary information to obtain the modified file attribute; The modified file attributes are written into the metadata of the pdf file.
5. The method according to claim 1, characterized in that When uploading the second dwg file and the pdf file, the steps of generating a second information summary according to the specified key content in the second dwg file and extracting the first information summary from the metadata in the pdf file include: When uploading the second dwg file and the pdf file, text marking is performed on the structural parameters of the second dwg file, and a sentence vector of the second dwg file is generated according to the text marking; Generate second summary information according to the sentence vector of the second dwg file; The metadata of the PDF file is parsed to obtain the first information summary.
6. The method according to claim 1, characterized in that The step of comparing the first information summary with the second information summary to determine the consistency result between the second dwg file and the pdf file includes: Comparing the first information digest with the second information digest to obtain a comparison result; When the comparison result is that the first information summary is consistent with the second information summary, outputting a consistency result that the second dwg file is consistent with the pdf file; When the comparison result is that the first information summary and the second information summary are inconsistent, a consistency result indicating that the second dwg file and the pdf file are inconsistent is output.
7. The method according to any one of claims 1 to 6, characterized in that After the step of comparing the first information summary with the second information summary to determine the consistency result between the second dwg file and the pdf file, the method further includes: When the consistency result is that the second dwg file is consistent with the pdf file, reading the icon information of the pdf file, and reading the icon header file information of the printed pdf file; Compare the icon information with the icon header file information to obtain a comparison result; When the comparison result is consistent, associating the PDF file with the printed PDF file; When the comparison result is inconsistent, the PDF file is printed out; When the consistency result is that the second dwg file is inconsistent with the pdf file, the print command is not executed, and a prompt message indicating that the file has been modified is output.
8. A device for checking consistency between a dwg file and a pdf file based on an information summary algorithm, characterized in that: The device comprises: A summary generation module, used for obtaining designated key content in the first dwg file, and generating a first information summary according to the designated key content; A summary writing module, used for writing the first information summary into the PDF file metadata when printing the first DWG file as a PDF file; A judgment preparation module, used for generating a second information summary according to the specified key content in the second dwg file and extracting the first information summary from the metadata in the pdf file when uploading the second dwg file and the pdf file; The consistency judgment module is used to compare the first information summary with the second information summary to determine the consistency result between the second dwg file and the pdf file.
9. A device for checking consistency between dwg files and pdf files based on information summary algorithm, characterized in that: The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of a method for verifying consistency between a dwg file and a pdf file based on an information summary algorithm as described in any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the method for verifying the consistency of a dwg file and a pdf file based on an information summary algorithm as described in any one of claims 1 to 7 are implemented.