Method for automatically generating Word document of verification certificate of pressure gauge
By obtaining and organizing spreadsheet data to fill Word document templates, the problem of low efficiency in the generation of pressure gauge verification certificates in the existing technology is solved, automatic generation and efficient processing are achieved, and the accuracy and consistency of certificates are ensured.
Patent Information
- Application Number
- CN202411324196.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2024-12-27
AI Technical Summary
Existing document processing methods cannot automatically generate pressure gauge verification certificates, resulting in complicated processing steps and inefficient efficiency.
By obtaining the Word document template for the pressure gauge verification certificate, calling a spreadsheet with the pressure gauge verification certificate data, extracting and organizing the data, filling and positioning the data according to the template format, and merging and generating a multi-page pressure gauge verification certificate Word document, using Data sorting models and cleaning algorithms ensure data accuracy and consistency.
It realizes automatic generation of pressure gauge verification certificates, simplifies processing steps, improves document processing efficiency, and ensures the accuracy and consistency of certificate generation.
Smart Images

Figure CN119203971A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of document automation, and in particular relates to a method for automatically generating a Word document of a pressure gauge calibration certificate. Background Art
[0002] The traditional method of document processing is to manually generate verification certificates, which involves a lot of repetitive work, such as filling in data, format adjustment and content verification. This method is prone to errors and inefficient. With the development of computer technology, various document automation tools and libraries have been developed to simplify and automate the document creation process. These tools support dynamic content generation, template use and data integration. The template engine can preset the document format and structure, and generate the final document by filling in dynamic data. This can ensure the consistency and accuracy of the document and reduce human errors. The method of automatically generating documents usually requires extracting and integrating data from databases or other data sources to ensure that the generated certificate contains the correct verification information and format. This automation method is widely used in various fields that require standardized documents, such as medical, engineering, auditing, etc., especially when a large number of duplicate documents need to be processed, which can significantly improve efficiency and accuracy.
[0003] The existing document processing method cannot automatically generate the pressure gauge calibration certificate, the document processing steps are relatively complicated, and the processing efficiency is low. Summary of the invention
[0004] In view of the deficiencies in the prior art, the present invention provides a method for automatically generating a Word document of a pressure gauge calibration certificate to solve the above technical problems.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] A method for automatically generating a pressure gauge calibration certificate Word document, comprising:
[0007] Get the Word document template of the pressure gauge calibration certificate;
[0008] Call up the electronic spreadsheet with the pressure gauge calibration certificate data to be sorted;
[0009] Extract the data in the spreadsheet to obtain the data to be filled in accordance with the format of the Word document template;
[0010] Based on the format of the data to be filled, the data position is located and filled in the Word document template to obtain a Word document of the pressure gauge calibration certificate.
[0011] Furthermore, the method also includes:
[0012] The prepared pressure gauge calibration certificate Word documents are merged to prepare a multi-page pressure gauge calibration certificate Word document.
[0013] Further, the step of extracting data from the electronic form to obtain data to be filled in accordance with the format of the Word document template includes:
[0014] Confirm the format of the spreadsheet and open the spreadsheet;
[0015] Check the data content and confirm the data structure;
[0016] Based on the data structure, the data in the spreadsheet is classified to obtain different types of target data;
[0017] The format of the target data is adjusted to obtain target data with a unified format; based on the order of the data in the data structure, a unique association relationship is established between data with the same position in different types of target data to obtain data to be filled that conforms to the format of the Word document template.
[0018] Further, the steps of locating and filling the data in the Word document template based on the format of the data to be filled include:
[0019] According to the association relationship, determine the target location of the data to be filled in the Word document;
[0020] Based on the target location, the data to be filled that complies with the format of the Word document template is filled into the Word document template.
[0021] Furthermore, before the step of classifying the data in the electronic form based on the structure of the data to obtain a plurality of different types of target data, the method further includes:
[0022] Clean the data in the spreadsheet to remove useless data;
[0023] Classify the cleaned data to obtain different types of target data;
[0024] The data after data cleaning includes at least one of the following: calibration certificate number, instrument name, manufacturer, factory number, measurement range, accuracy level, model specification, calibration date, and next calibration date.
[0025] Furthermore, a data sorting model is constructed to sort the data in the data structure, establish a unique association relationship between data with the same position in different types of target data, and obtain data to be filled that conforms to the format of the Word document template;
[0026] The methods for constructing data sorting models include:
[0027] A training set is obtained, wherein the training set includes an input data set and an output data set; the input data set includes: target data in a unified format;
[0028] Build a data sorting model based on the merge algorithm;
[0029] Input the input data set into the data ranking model for training, and use the output data set as the result to determine the weight of the data ranking model;
[0030] The data sorting model is trained using multiple sets of training sets, and the final weights are adjusted and obtained to obtain the data sorting model.
[0031] Furthermore, in the data sorting model:
[0032] Use the merge_sort function to recursively divide the target data with a unified format into multiple categories;
[0033] Call the merge function to merge the sorted target data in each category with a unified format;
[0034] The merge function is used to merge the sorted target data with a unified format in each category to obtain the data to be filled that conforms to the format of the Word document template.
[0035] Furthermore, the method also includes:
[0036] The data in the electronic spreadsheet having the pressure gauge calibration certificate data are traversed, and each set of traversed data is checked in the corresponding pressure gauge calibration certificate Word document, so as to verify the pressure gauge calibration certificate Word document.
[0037] Furthermore, the method also includes:
[0038] Load the pressure gauge calibration certificate Word documents and append them to the main document;
[0039] Save the merged new automatically generated pressure gauge calibration certificate Word document.
[0040] Furthermore, before the step of classifying the cleaned data, the method further includes: recording an alarm for removing useless data;
[0041] Steps to remove useless data for alarm logging include:
[0042] Verify the data in Excel;
[0043] Report the data that does not meet the validation rules of the model and generate and record the exception information;
[0044] Verify the data in the spreadsheet based on the anomaly information.
[0045] Compared with the prior art, the present invention has the following beneficial effects:
[0046] The present application proposes a method for automatically generating a Word document of a pressure gauge calibration certificate, comprising: obtaining a Word document template of a pressure gauge calibration certificate; calling an electronic spreadsheet with pressure gauge calibration certificate data to be sorted; extracting data from the electronic spreadsheet to obtain data to be filled in accordance with the format of the Word document template; locating and filling data in the Word document template based on the format of the data to be filled, to obtain the Word document of the pressure gauge calibration certificate; the method can realize the automatic generation of the pressure gauge calibration certificate, realize the automation of document processing, simplify the processing steps, and make the document processing more efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 The present invention is a flow chart of a method for automatically generating a Word document of a pressure gauge calibration certificate. DETAILED DESCRIPTION
[0048] In order to better understand the present application, a more detailed description will be made of various aspects of the present application with reference to the accompanying drawings. It should be understood that these detailed descriptions are only descriptions of exemplary embodiments of the present application, and are not intended to limit the scope of the present application in any way. Throughout the specification, the same reference numerals refer to the same elements. The expression "and / or" includes any and all combinations of one or more of the associated listed items.
[0049] In the accompanying drawings, the size, dimensions and shapes of the elements have been slightly adjusted for ease of illustration. The drawings are for illustration only and are not strictly drawn to scale. As used herein, the terms "substantially", "approximately" and similar terms are used as terms of approximation, not as terms of degree, and are intended to illustrate the inherent deviations in measurements or calculations that would be recognized by a person of ordinary skill in the art. In addition, in this application, the order in which the processing of each step is described does not necessarily represent the order in which these processes occur in actual operation, unless otherwise specified or can be derived from the context.
[0050] It should also be understood that expressions such as "include", "including", "have", "contain" and / or "comprising" are open rather than closed expressions in this specification, which indicate the presence of the stated features, elements and / or components, but do not exclude the presence of one or more other features, elements, components and / or combinations thereof. In addition, when expressions such as "at least one of..." appear after a list of listed features, they modify the entire list of features rather than just the individual elements in the list. In addition, when describing embodiments of the present application, "may" is used to mean "one or more embodiments of the present application". And, the term "exemplary" is intended to refer to an example or illustration.
[0051] Unless otherwise defined, all words (including engineering terms and scientific and technological terms) used in this article have the same meaning as commonly understood by ordinary technical citizens in the field to which this application belongs. It should also be understood that, unless explicitly stated in this application, words defined in commonly used dictionaries should be interpreted as having the same meaning as their meaning in the context of the relevant technology, and should not be interpreted in an idealized or overly formal sense.
[0052] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0053] The present invention provides a method for automatically generating a pressure gauge calibration certificate Word document, comprising: Step S1-Step S4:
[0054] Step S1. Obtain a Word document template of a pressure gauge calibration certificate.
[0055] In this embodiment, the docxtpl library can be used to read the pressure gauge calibration certificate Word document template.
[0056] Step S2: Calling the electronic spreadsheet with the pressure gauge calibration certificate data to be sorted.
[0057] In this embodiment, the pandas library can be used to read an Excel spreadsheet, which stores the pressure gauge calibration certificate data that needs to be read. Furthermore, the pressure gauge calibration certificate data includes: calibration certificate number, instrument name, manufacturer, factory number, measurement range, accuracy level, model specification, calibration date, next calibration date, etc. Of course, users can select the above data types according to actual statistical needs. For example, users can select one or more data as data to be filled in the Word document template.
[0058] Furthermore, you can also use the read_excel function of pandas to load the Excel file; specify the worksheet to be read through the sheet_name parameter; use head to view the first few rows of data to ensure that the file is read correctly.
[0059] Step S3: extract the data in the electronic form to obtain the data to be filled in accordance with the format of the Word document template.
[0060] In this embodiment, step S3 includes: step S301-step S304
[0061] Step S301: confirm the format of the electronic form and open the electronic form.
[0062] In this embodiment, the format of the electronic spreadsheet (eg, Excel, CSV) is confirmed, and the control system can automatically control the corresponding software to open the electronic spreadsheet.
[0063] Step S302: Check the data content and confirm the data structure.
[0064] In this embodiment, after opening the spreadsheet, it is necessary to judge the data content in the spreadsheet and determine the data structure. For example, in the statistical data of the pressure gauge calibration certificate, there are 10 data, namely Pressure Gauge Calibration Certificate 1, Pressure Gauge Calibration Certificate 2... Pressure Gauge Calibration Certificate 10; the 10 data correspond to their respective information, and in the spreadsheet, they are arranged vertically in sequence according to the serial number; at this point, we have obtained the storage format of each pressure gauge calibration certificate data in the spreadsheet.
[0065] Step S303: Based on the structure of the data, classify the data in the electronic form to obtain a plurality of different types of target data.
[0066] In this step, according to the structure of the data, the system algorithm can be used to classify the data according to the data structure obtained in step S302. For example, the serial number is divided into a group of data, the device name is divided into a group of data, and so on. After the classification is completed, a variety of different types of target data are obtained.
[0067] Step S304. Adjust the format of the target data to obtain target data with a unified format; based on the order of the data in the structure of the data, establish a unique association relationship between data with the same position in different types of target data to obtain data to be filled that conforms to the format of the Word document template.
[0068] In this step, an association relationship is established in each category of data according to different types of target data. For example, in the serial number classification data, data serial numbers 1-10 are included; correspondingly, in the data classification of the device name, serial number 1 shifts the device name corresponding to device 1. In this way, a unique association relationship can be established between data with the same position in different types of target data.
[0069] Step S4. Locate and fill in the data in the Word document template based on the format of the data to be filled, and obtain the pressure gauge calibration certificate Word document.
[0070] In this step, according to the association relationship obtained in step S3, the data recorded in the electronic form of the pressure gauge verification certificate is filled into the Word document one by one according to the association relationship. For example, the data such as serial number 1 and device 1 are used as a row or a column in the Word document, which can be set by the user. In this way, the data in the electronic form can be automatically organized into the Word document to obtain the Word document of the pressure gauge verification certificate.
[0071] In this embodiment, the technical solution of the present application is adopted, and the system recognizes and organizes the data in the spreadsheet and automatically fills it into the Word document, so that the pressure gauge calibration certificate can be automatically generated, the document processing is automated, the processing steps are simplified, and the document processing efficiency is higher.
[0072] In a specific implementation, the method further includes: step S5:
[0073] Step S5 combines the prepared pressure gauge calibration certificate Word documents to prepare a multi-page pressure gauge calibration certificate Word document.
[0074] In this embodiment, the specific implementation steps may be: create a new document through the Document class in the python-docx library; read all the pressure gauge calibration certificate Word documents obtained in step S4 through the Composer class; add all the pressure gauge calibration certificate Word documents to the new document through the append method of the Composer class to make it a multi-page single-file Word document; save the new document through the save method of the Composer class to generate a pressure gauge calibration certificate Word document.
[0075] By adopting the technical solution of this embodiment, when there is a lot of data in the pressure gauge calibration certificate, it can be automatically sorted into a multi-page Word document to record the data more comprehensively.
[0076] In a specific implementation, the step of locating and filling the data in the Word document template based on the format of the data to be filled includes:
[0077] According to the association relationship, the target position of the data to be filled in the Word document is determined.
[0078] In this embodiment, after the association relationship is determined, specifically, the Word document can be typeset based on information such as character length to determine the position. For example, if the length of the data in the association relationship is greater than the page width of the Word document, the direction of the Word document can be changed, and the vertical placement can be changed to horizontal placement, and then it can be further determined whether the horizontal length meets the data length in the association relationship. If it meets the requirements, the Word document is defined as a horizontal layout. If the data length in the association relationship is greater than the length of the horizontal layout, two lines can be planned as the storage format of the current data, and the data in other association relationships are judged in turn, all in two-line format. In this way, it is convenient to improve the layout aesthetics of the entire page and facilitate users to view the record data in the Word document later.
[0079] Further, based on the target position, the data to be filled that conforms to the format of the Word document template is filled into the Word document template. In this way, a Word document of the pressure gauge verification certificate can be obtained.
[0080] In a specific implementation manner, before the step of classifying the data in the electronic form based on the structure of the data to obtain a plurality of different types of target data, the method further includes:
[0081] Cleaning the data in the electronic form to remove useless data;
[0082] Classify the cleaned data to obtain different types of target data;
[0083] The data after data cleaning includes at least one of the following: calibration certificate number, instrument name, manufacturer, factory number, measurement range, accuracy level, model specification, calibration date, and next calibration date.
[0084] In this embodiment, there are various ways to clean data, for example, to kick out abnormal data, or to kick out data that does not need to be counted. Specifically:
[0085] Filter useless data columns and retain data columns related to the content of the calibration pressure gauge certificate, including: calibration certificate number, instrument name, manufacturer, factory number, measurement range, accuracy level, model specification, calibration date, and next calibration date; filter by the calibration certificate number, instrument name, manufacturer, factory number, measurement range, accuracy level, model specification, calibration date, and next calibration date; convert the date type data in the data column to the standard "year-month-day" format; convert the date type data in the data column to the standard "year-month-day" format; determine whether the measurement range is in Kpa or Psi by whether the filtered characters contain the keywords "K and S"; use the pydantic library in Python to define the data model and validate the data in Excel; in the try block, try to convert the data row to a CertificateData instance. If the data does not meet the validation rules of the model, a ValiError will be thrown. dationError exception, and print the error information in the except block; use the logging library to record the error information to the log file; check whether the Excel data column name matches the placeholder in the Word template; use the get_context method of the docxtpl library to obtain the placeholder in the template, and compare it with the Excel column name. If a mismatch is found, a warning will be generated and recorded in the log; create a dictionary row in the code, which includes all the fields of the pressure gauge calibration certificate that need to be processed; call the auto_fix_data function to repair the data; the repaired data is stored in the fixed_row variable; use the constructor of the CertificateData model to create a judgment model; if the data meets the definition and validation rules of the model, a confirmation message is output; if the data does not meet the rules, the ValidationError exception is caught and an error message is output.
[0086] In a specific implementation, a data sorting model is constructed to establish a unique association relationship between data having the same position in different types of target data based on the sorting of data in the structure of the data, so as to obtain data to be filled that conforms to the format of a Word document template; the method for constructing the data sorting model includes:
[0087] A training set is obtained, wherein the training set includes an input data set and an output data set; the input data set includes: target data in a unified format; a data sorting model is built based on a merging algorithm; the input data set is input into the data sorting model for training, and the weight of the data sorting model is determined based on the output data set; the data sorting model is trained using multiple sets of training sets, and the final weight is adjusted and obtained to obtain the data sorting model.
[0088] In this embodiment, a data sorting model is provided to arrange and distribute data in a unified data format, thereby building an association relationship. Specifically:
[0089] In the data sorting model:
[0090] The merge_sort function is used to recursively sort the target data with a unified format into multiple categories.
[0091] Call the merge function to merge the sorted target data in each category with a unified format.
[0092] The merge function is used to merge the sorted target data with a unified format in each category to obtain the data to be filled that conforms to the format of the Word document template.
[0093] In this embodiment, a merge algorithm is used to build a data sorting model, which divides the data into smaller parts, sorts them, and then merges them. It is stable and suitable for large data sets. By using a stable merge sorting algorithm, that is, equal elements maintain relative positions after sorting, it is easier to fill the data in the spreadsheet into the Word document template later, thereby obtaining the pressure gauge calibration certificate Word document.
[0094] In a specific embodiment, the method further comprises:
[0095] The data in the electronic spreadsheet having the pressure gauge calibration certificate data are traversed, and each set of traversed data is checked in the corresponding pressure gauge calibration certificate Word document, so as to verify the pressure gauge calibration certificate Word document.
[0096] Specifically: This embodiment provides a method for verifying a Word document: traverse the data table through a for loop in Python, and use the render method of the DocxTemplate class in the docxtpl library to determine whether the data in the spreadsheet is filled in the pressure gauge calibration certificate Word document template. It should be noted that the data in the spreadsheet in this embodiment is a spreadsheet that has been cleaned, that is, the data in the spreadsheet are all the data that the user needs to register. This execution can avoid data loss and omission.
[0097] In a specific embodiment, the method further comprises:
[0098] Load the pressure gauge calibration certificate Word document and append it to the main document;
[0099] Save the merged new automatically generated pressure gauge calibration certificate Word document.
[0100] Specifically, the following steps can be used to implement it: create a new document through the Document class in the python-docx library; read all the pressure gauge calibration certificate Word documents obtained in the S4 step through the Composer class; add all the pressure gauge calibration certificate Word documents to the new document through the append method of the Composer class, for example, import the Document class in the Python script; read data from Excel and fill in the corresponding position of the certificate template; make it a multi-page single-file Word document; save this new document through the save method of the Composer class to generate a pressure gauge calibration certificate Word document, for example, import the required library in the Python script; initialize a blank Word document as the target document for merging; use the Composer class to merge the main document with other documents; traverse the Word documents to be merged, and use the append method to add each document to the main document.
[0101] In a specific implementation, before the step of classifying the data after data cleaning, the method also includes: recording an alarm for removing useless data; the step of recording an alarm for removing useless data includes: verifying the data in Excel; reporting the data that does not meet the verification rules of the model and forming and recording abnormal information; and verifying the data in the spreadsheet based on the abnormal information.
[0102] In this embodiment, the applicant provides a specific embodiment, which is as follows:
[0103] Install the docxtpl library; create a Word document template; create a dictionary that includes the data that needs to be filled in the template; use the render method to fill the data into the template; use pip to install pandas and openpyxl; import pandas in a Python script or interactive environment; use pandas's read_excel function to load Excel files; specify the worksheet to be read through the sheet_name parameter; use head to view the first few rows of data to ensure that the file is read correctly; filter out useless data columns and retain data columns related to the content of the pressure gauge calibration certificate; use data=data calibration certificate Filter by book number, instrument name, manufacturer, factory number, measurement range, accuracy level, model specification, calibration date and next calibration date; convert the date type data in the data column to the standard "year-month-day" format by the apply method; convert the date type data in the data column to the standard "year-month-day" format; filter the data in the "measurement range" column with a regular expression by using the sub method in the re library in Python; distinguish whether the measurement range unit is Kpa or Psi by whether the filtered characters contain the keywords "K and S"; define the data model using the pydantic library in Python, and perform the calculation on the data in Excel ; in the try block, try to convert the data row into a CertificateData instance. If the data does not meet the validation rules of the model, a ValidationError exception will be thrown and an error message will be printed in the except block; use the logging library to record error messages to the log file; check whether the Excel data column name matches the placeholder in the Word template; use the get_context method of the docxtpl library to obtain the placeholder in the template and compare it with the Excel column name. If a mismatch is found, a warning will be generated and recorded in the log; create a dictionary row in the code, which includes all the fields of the pressure gauge calibration certificate that need to be processed; call the auto_fix_data function to fix the data; the repaired data is stored in the fixed_row variable; use the constructor of the CertificateData model to create a judgment model; traverse the data table through a for loop in python, and use the render method of the DocxTemplate class in the docxtpl library to fill each row of data into the pressure gauge calibration certificate Word document template; finally, use the save method to save each pressure gauge calibration certificate Word document template as a separate Word document.
[0104] Obtain multiple pressure gauge calibration certificate Word documents; create a new document through the Document class in the python-docx library; read all the pressure gauge calibration certificate Word documents obtained in step S4 through the Composer class; add all the pressure gauge calibration certificate Word documents to the new document through the append method of the Composer class to make it a multi-page single-file Word document; save this new document through the save method of the Composer class, and the document is the pressure gauge calibration certificate Word document generated by the present invention.
[0105] To sum up, the advantages of the present invention are: this application uses the docxtpl library to read the pressure gauge calibration certificate Word document template, uses the pandas library to read the Excel spreadsheet, and merges multiple single-page pressure gauge calibration certificate Word documents into a multi-page Word document through the python-docx library, which can realize the automatic generation of the pressure gauge calibration certificate, realize the automation of document processing, simplify the processing steps, and make the document processing more efficient.
[0106] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0107] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for automatically generating a Word document of a pressure gauge calibration certificate, characterized in that: include: Get the Word document template of the pressure gauge calibration certificate; Call up the electronic spreadsheet with the pressure gauge calibration certificate data to be sorted; Extracting data from the electronic form to obtain data to be filled in accordance with the format of the Word document template; Based on the format of the data to be filled, the data position is located and filled in the Word document template to obtain a Word document of the pressure gauge calibration certificate.
2. The method for automatically generating a Word document of a pressure gauge calibration certificate according to claim 1, characterized in that: The method further comprises: The prepared pressure gauge calibration certificate Word documents are merged to prepare a multi-page pressure gauge calibration certificate Word document.
3. The method for automatically generating a Word document of a pressure gauge calibration certificate according to claim 1, characterized in that: The extracting of data from the electronic form to obtain data to be filled in conformity with the format of the Word document template comprises: confirming the format of the spreadsheet and opening said spreadsheet; Check the data content and confirm the data structure; Based on the structure of the data, the data in the electronic form is classified to obtain a plurality of different types of target data; The format of the target data is adjusted to obtain target data with a unified format; based on the order of the data in the structure of the data, a unique association relationship is established between data with the same position in different types of target data to obtain data to be filled that conforms to the format of the Word document template.
4. The method for automatically generating a Word document of a pressure gauge calibration certificate according to claim 3, characterized in that: The locating and filling the data in the Word document template based on the format of the data to be filled includes: Determine the target location of the data to be filled in the Word document according to the association relationship; Based on the target position, the data to be filled that complies with the format of the Word document template is filled into the Word document template.
5. The method for automatically generating a Word document of a pressure gauge calibration certificate according to claim 3, characterized in that: Before classifying the data in the electronic form based on the structure of the data to obtain a plurality of different types of target data, the method further includes: Cleaning the data in the electronic form to remove useless data; Classify the cleaned data to obtain different types of target data; The data after data cleaning includes at least one of the following: calibration certificate number, instrument name, manufacturer, factory number, measurement range, accuracy level, model specification, calibration date, and next calibration date.
6. The method for automatically generating a Word document of a pressure gauge verification certificate according to claim 3, characterized in that: include: Constructing a data sorting model for establishing a unique association relationship between data having the same position in different types of target data based on the sorting of data in the structure of the data, and obtaining data to be filled that conforms to the format of the filling Word document template; The method for constructing the data sorting model includes: Acquire a training set, wherein the training set includes an input data set and an output data set; the input data set includes: target data in a unified format; Build a data sorting model based on the merge algorithm; Inputting the input data set into the data sorting model for training, and determining the weight of the data sorting model with the output data set as the result; The data sorting model is trained using multiple sets of training sets, and final weights are adjusted and obtained to obtain the data sorting model.
7. The method for automatically generating a Word document of a pressure gauge verification certificate according to claim 6, characterized in that: The data sorting model includes: Use the merge_sort function to recursively divide the target data with a unified format into multiple categories; Call the merge function to merge the sorted target data in each category with a unified format; The merge function is used to merge the sorted target data with a unified format in each category to obtain the data to be filled that conforms to the format of the Word document template.
8. The method for automatically generating a Word document of a pressure gauge verification certificate according to claim 1, characterized in that: The method further comprises: The data in the electronic spreadsheet having the pressure gauge calibration certificate data are traversed, and each set of traversed data is checked in the corresponding pressure gauge calibration certificate Word document, so as to verify the pressure gauge calibration certificate Word document.
9. The method for automatically generating a pressure gauge calibration certificate Word document according to claim 1, characterized in that: The method further comprises: Load the pressure gauge calibration certificate Word document and append it to the main document; Save the merged new automatically generated pressure gauge calibration certificate Word document.
10. The method for automatically generating a Word document of a pressure gauge verification certificate according to claim 5, characterized in that: Before classifying the cleaned data, the method further includes: Record alarms for removing useless data; The removal of useless data for alarm recording comprises: Verify the data in Excel; Report the data that does not meet the validation rules of the model and generate and record the exception information; The data in the electronic form is verified based on the abnormal information.
