Safe generation method of electronic file
By organically combining structured metadata collection, electronic file creation, format conversion, digital signature and encryption processing, the problems of data security and standardization in electronic file management in the existing technology are solved, safe generation and efficient management of electronic files are realized, and the file management quality of engineering projects is improved.
Patent Information
- Application Number
- CN202510315086.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-18
- Publication Date
- 2025-04-18
AI Technical Summary
The prior art has shortcomings in data security, standardization of format conversion, combination of digital signature and encryption processing in the management of electronic files, and it is difficult to achieve the secure generation and management of electronic files.
By organically combining the collection of structured metadata, the creation of electronic files, format conversion, digital signature and encryption processing, the standardization and automation of electronic file generation and security management are achieved. The specific steps include extracting metadata from the business system database, creating electronic files, format conversion, digital signature and encryption processing, and finally recording and archived in the archive management system.
It improves the efficiency of file generation and archiving, ensures the security and integrity of electronic files during storage and transmission, realizes the immutability of files and the confidentiality of data, and improves the file management quality of engineering projects.
Smart Images

Figure CN119848905A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic file management and processing, and in particular to a method for securely generating electronic files. Background Art
[0002] With the advent of the information age, electronic files have been widely used in all walks of life. Especially in the fields of engineering project management and archive management, the requirements for the security and standardization of electronic files are increasing. How to effectively manage the generation, storage and archiving of electronic files and ensure the security of their data has become an urgent problem for major companies and institutions.
[0003] In the prior art, common electronic file management methods have achieved basic file storage and management functions, but they have certain deficiencies in data security, standardization of format conversion, and the combination of digital signature and encryption processing. For example, traditional file management systems lack standardization of the file generation process, and the encryption and signature processing of electronic files are often performed separately, making it difficult to form an integrated security generation process.
[0004] Therefore, the present invention provides a method for securely generating an electronic file. Summary of the invention
[0005] The present invention provides a method for securely generating electronic files, which is used to achieve standardization and automation of electronic file generation and security management by organically combining the collection of structured metadata, creation of electronic files, format conversion, digital signatures, and encryption processing. This method not only improves the efficiency of file generation and archiving, but also ensures the security and integrity of electronic files during storage and transmission. Through digital signatures and encryption processing, the non-tamperability of files and the confidentiality of data are ensured. In addition, the systematic archiving process helps to achieve efficient archive management, improves the traceability and management standardization of files, and thus improves the file management quality of engineering projects. The present invention provides a method for securely generating electronic files, comprising: Step 1: Extract basic information related to the target project from the database of the business system. At the same time, obtain the responsible person information from the personnel information table, and organize the collected metadata according to the preset format to determine the structured metadata set; Step 2: Create an electronic file based on the structured metadata set and save the electronic file as a temporary file; Step 3: Based on the preset file format standard, call the corresponding format conversion tool to convert the temporary file into the preset format, and overwrite the temporary file to generate a new electronic file; Step 4: Digitally sign the new electronic file and the structured metadata set to generate a signed electronic file; Step 5: Encrypt the signed electronic file to generate the final encrypted electronic file, save the encrypted electronic file according to the preset storage path, record the relevant information of the encrypted electronic file in the archive management system, and enter the encrypted electronic file into the pre-archiving library, thereby completing the secure generation and preliminary archiving of the electronic file.
[0006] The present invention provides a method for safely generating an electronic file, and the preset archive format standard includes: a file format standard, a content structure standard, a metadata standard, a typesetting style standard, a security standard and a file rule standard.
[0007] The present invention provides a method for securely generating an electronic file, which extracts basic information related to a target engineering project from a database of a business system, including: Verify access rights to business systems and establish a secure connection with business system databases; Obtain the project type information of the current engineering project based on the business system database, and determine the focus and scope of the metadata to be collected based on the project type; Based on preset query statements, query and extract data from several data tables in the business system database; Perform preliminary data cleaning on the extracted data to remove duplicate and invalid data; The data is classified and sorted according to the key information of the preset type to obtain the basic information related to the target engineering project.
[0008] The present invention provides a method for securely generating an electronic file, which organizes the collected metadata according to a preset format to determine a structured metadata set, including: Perform attribute analysis on metadata to determine the attributes of metadata; A unique identifier is assigned to each metadata field based on the metadata's attributes and a preset attribute-identifier.
[0009] The present invention provides a method for securely generating an electronic file, which creates an electronic file based on a structured metadata set, comprising: Based on the item type and template information in the metadata, the corresponding electronic file template is called; populate the data in the structured metadata collection into the corresponding fields of the electronic document template; Adding metadata information to electronic files, thereby generating electronic files; Generate a unique file name for the electronic file based on a combination of a timestamp and a random number; Add a custom label containing project information and temporary file identification to the file header of the electronic file; Store the electronic file in the specified temporary file storage directory and record the storage path of the electronic file.
[0010] The present invention provides a method for securely generating an electronic file. Based on a preset archive format standard, a corresponding format conversion tool is called to convert a temporary file into a preset format, and the temporary file is overwritten to generate a new electronic file, including: Perform character analysis on the temporary file, and then perform escape processing on the special characters in the temporary file; Call the format conversion tool to convert the format of the processed temporary file, and perform a preliminary format preview check on the converted file; In the original temporary file storage path, the temporary file after format preview check will overwrite the original temporary file with the same file name to generate a new electronic file.
[0011] The present invention provides a method for securely generating an electronic file, which digitally signs a new electronic file and a structured metadata set to generate a signed electronic file, including: Obtain a digital certificate for digital signature, and use the private key corresponding to the digital certificate to sign the generated hash value; attaching the generated digital signature to new electronic documents and structured metadata collections; After the signature is attached, the public key of the digital certificate is used to decrypt the signature to obtain the original hash value, and the new electronic file and structured metadata set are hashed again. The obtained hash value is compared with the decrypted hash value. If the two are consistent, it means that the signature is valid and the file and metadata set have not been tampered with after signing; if they are inconsistent, it means that the signature is invalid, the file may have been tampered with, and the signing operation needs to be performed again to generate a signed electronic file.
[0012] The present invention provides a method for securely generating an electronic file, encrypting a signed electronic file to generate a final encrypted electronic file, saving the encrypted electronic file according to a preset storage path, recording relevant information of the encrypted electronic file in an archive management system, and entering the encrypted electronic file into a pre-archiving library, thereby completing the secure generation and preliminary archiving of the electronic file, including: Check the preset storage path to confirm whether the storage path exists. If not, create the corresponding folder or directory; Check the permission settings of the storage path to see if the current user has permission to write files. Also, check the available space of the storage medium. If the storage space is insufficient, clear the space and replace the storage medium. Use the file system API or related storage service interface to save the encrypted electronic file to a preset storage path, and set the corresponding file name and file attributes for the file; Extract key information from encrypted electronic files and related operation records, organize and classify the extracted information, and format it according to the requirements of the archive management system; Send the processed encrypted electronic file related information to the archive management system, communicate with the archive management system interface, and pass the information to the system; The information related to the encrypted electronic file is recorded in the system's database, a unique identifier is assigned to each record, and a corresponding index is established. At the same time, the information is classified and archived.
[0013] Compared with the prior art, the present invention has the following beneficial effects: By organically combining the collection of structured metadata, the creation of electronic files, format conversion, digital signatures, and encryption processing, the standardization and automation of electronic file generation and security management are achieved, which not only improves the efficiency of file generation and archiving, but also ensures the security and integrity of electronic files during storage and transmission. Through digital signatures and encryption processing, the immutability of files and the confidentiality of data are ensured. In addition, the systematic archiving process helps to achieve efficient archive management, improves the traceability and management standardization of files, and thus improves the file management quality of engineering projects. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0015] Figure 1 It is a flowchart of a method for securely generating an electronic file provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0016] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0017] Embodiment 1: The embodiment of the present invention provides a method for securely generating an electronic file. Figure 1 As shown, including: Step 1: Extract basic information related to the target project from the database of the business system. At the same time, obtain the responsible person information from the personnel information table, and organize the collected metadata according to the preset format to determine the structured metadata set; Step 2: Create an electronic file based on the structured metadata set and save the electronic file as a temporary file; Step 3: Based on the preset file format standard, call the corresponding format conversion tool to convert the temporary file into the preset format, and overwrite the temporary file to generate a new electronic file; Step 4: Digitally sign the new electronic file and the structured metadata set to generate a signed electronic file; Step 5: Encrypt the signed electronic file to generate the final encrypted electronic file, save the encrypted electronic file according to the preset storage path, record the relevant information of the encrypted electronic file in the archive management system, and enter the encrypted electronic file into the pre-archiving library, thereby completing the secure generation and preliminary archiving of the electronic file.
[0018] In this embodiment, the temporary file is stored in the temporary storage space, waiting for subsequent processing. The temporarily stored file is the object of subsequent format conversion and security processing.
[0019] In this embodiment, the new electronic file may be a native process signature form file generated by the platform, and the specific implementation process is as follows: The functional modules of the engineering platform correspond to the archived file names one by one. The content is filled in through the business function form of the engineering platform. The initiator fills in the information, and the approver approves it through a digital signature.
[0020] The form filling control designs and publishes the archive file style according to the provided archive form.
[0021] After the business form is approved, the final version of the form field information is pushed to the form filling control to form a PDF file, and the coordinates of the PDF that need to be stamped are pushed to the engineering platform. The engineering platform integrates electronic signatures for unified stamping. The form ledger is automatically generated by the engineering platform. The engineering platform pushes the stamped file data, infrastructure metadata, and structured data to the archive system.
[0022] After receiving the metadata, structured data and file data transmitted by the engineering platform, the archive system will compile the archives and formally archive them after the compilation is completed.
[0023] In this embodiment, the process of securely generating an electronic file is as follows: import os import sqlite3 from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import padding from cryptography.hazmat.primitives import serialization from cryptography.hazmat.primitives.serialization import load_pem_private_key from cryptography.hazmat.primitives.ciphers import Cipher,algorithms, modes import subprocess #Metadata collection module def collect_metadata(project_id): """Collect project metadata from the database""" conn = sqlite3.connect('project_database.db') cursor = conn.cursor() # Query basic project information cursor.execute('SELECT name, code, owner FROM projects WHERE id = ?',(project_id,)) project_info = cursor.fetchone() # Query the relevant responsible person cursor.execute('SELECT name, role FROM members WHERE project_id = ?',(project_id,)) members = cursor.fetchall() metadata = { "project_name": project_info[0], "project_code": project_info[1], "owner": project_info[2], "members": members } conn.close() return metadata #Format conversion module def convert_file_format(input_path, output_format='pdf'): """Convert a file to a specified format (example uses pandoc tool)""" output_path = os.path.splitext(input_path)[0] + '.' + output_format try: subprocess.run(['pandoc', input_path, '-o', output_path], check=True) return output_path except subprocess.CalledProcessError as e: print(f"Format conversion failed: {e}") return None #Digital signature module def sign_file(file_path, private_key_path): """Digitally sign a file using a private key""" with open(file_path, 'rb') as f: data = f.read() with open(private_key_path, 'rb') as key_file: private_key = load_pem_private_key( key_file.read(), password=None ) signature = private_key.sign( data, padding.PSS( mgf=padding.MGF1(hashes.SHA256()), salt_length=padding.PSS.MAX_LENGTH ), hashes.SHA256() ) return signature # Encryption module def encrypt_file(file_path, key): """Encrypt a file using AES""" iv = os.urandom(16) cipher = Cipher(algorithms.AES(key), modes.CBC(iv)) encryptor = cipher.encryptor() with open(file_path, 'rb') as f: plaintext = f.read() # Pad the data to meet the block size pad_length = 16 - (len(plaintext) % 16) plaintext_padded = plaintext + bytes([pad_length] * pad_length) ciphertext = encryptor.update(plaintext_padded) + encryptor.final() encrypted_path = file_path + '.enc' with open(encrypted_path, 'wb') as f: f.write(iv + ciphertext) return encrypted_path #Main process def generate_secure_document(project_id, input_file, private_key_path, aes_key): """Main process for securely generating electronic documents""" # 1. Metadata Collection metadata = collect_metadata(project_id) print(f"Collect metadata: {metadata}") # 2. Format conversion converted_file = convert_file_format(input_file) if not converted_file: return None # 3. Digital Signature signature = sign_file(converted_file, private_key_path) print(f"Generate digital signature: {signature.hex()}") # 4. Encryption encrypted_file = encrypt_file(converted_file, aes_key) print(f"Encrypted file path: {encrypted_file}") # Clean up temporary files os.remove(converted_file) return encrypted_file # Test execution if __name__ == "__main__": # Test parameters project_id = 1 input_file = "project_draft.docx" private_key_path = "private_key.pem" aes_key = os.urandom(32) # Generate 256-bit AES key # Execute the generation process final_file = generate_secure_document(project_id, input_file,private_key_path, aes_key) if final_file: print("Electronic file security generation completed!") The beneficial effects of the above technical solution are as follows: by organically combining the collection of structured metadata, the creation of electronic files, format conversion, digital signatures and encryption processing, the standardization and automation of electronic file generation and security management are achieved. This method not only improves the efficiency of file generation and archiving, but also ensures the security and integrity of electronic files during storage and transmission. Through digital signatures and encryption processing, the immutability of files and the confidentiality of data are ensured. In addition, the systematic archiving process helps to achieve efficient archive management, improves the traceability and management standardization of files, and thus improves the file management quality of engineering projects.
[0024] Embodiment 2: The embodiment of the present invention provides a method for securely generating an electronic file, and the preset archive format standard includes: a file format standard, a content structure standard, a metadata standard, a typesetting style standard, a security standard, and a file rule standard.
[0025] In this embodiment, the file format standard is: General format selection: Prioritize the use of general, open and long-term preservation value file formats, such as PDF / A (for electronic documents), TIFF (for images), XML (for structured data), etc. These formats are not limited by specific software and can be read and displayed normally in different systems and software. For example, PDF / A is a PDF format designed for long-term archiving. It removes dynamic elements and scripts that may cause the document to be inaccurately presented in the future, ensuring the stability and readability of the document content.
[0026] In this embodiment, version compatibility: clearly specify the specific version requirements of the file format used. Different versions of file formats may have functional differences and compatibility issues. Choosing the right version helps ensure the long-term availability of the archive. For example, PDF / A has multiple versions (PDF / A - 1, PDF / A - 2, PDF / A - 3, etc.), and the version to be used must be determined based on actual needs and technical support; In this embodiment, content structure standard: Document chapters and hierarchy: For text archives, the chapter division, title level and hierarchy of the document are specified. For example, a multi-level title system is adopted to clarify the font, font size, format, etc. of the titles at each level, so that the document structure is clear, easy to read and understand. At the same time, the logical relationship and arrangement order between chapters are specified, such as organizing according to chronological order, importance, etc. Data record format: For structured data archives such as tables and databases, a unified data record format is formulated. Including field name, data type, length limit, value range, etc., to ensure the standardization and consistency of data. For example, in the personnel information archive, the format of the "Date of Birth" field is specified as "YYYY-MM-DD", and the value of the "Gender" field can only be "Male" or "Female".
[0027] In this embodiment, metadata standards: Metadata element definition: Determine the metadata elements that must be included, such as file name, creation date, creator, file type, storage period, project number, etc. The meaning, filling requirements and data type of each metadata element are defined in detail to ensure the accuracy and completeness of metadata. Metadata encoding rules: Specify the encoding method of metadata, such as using a standardized code table to encode certain metadata elements. For example, the "region" metadata is encoded using the national standard administrative division code to facilitate data classification, retrieval and statistics.
[0028] In this embodiment, the typesetting style standard: Font and font size: uniformly specify the font and font size used in the document to ensure the overall beauty and readability of the document. For example, the main text uses Songti, size 5, and the title uses different font sizes and bold styles according to the level. Paragraph format: clarify the format requirements of paragraph indentation, line spacing, paragraph spacing, etc. For example, the first line of the main text paragraph is indented by 2 characters, the line spacing is 1.5 times or a fixed value, etc., so that the document layout is neat and standardized. Page layout: specify the page margins, header and footer content and format, etc. For example, the page margins are 2.5 cm up and down, left and right, the header contains the file name and page number, and the footer contains the date and unit name, etc.
[0029] In this embodiment, the file rule standard: File naming rules: formulate a unified file naming rule so that the file name can accurately reflect the content and characteristics of the archive. For example, the file name adopts the format of "project number-file type-date-serial number" to facilitate file management and search. File size limit: according to the actual situation of the storage device and transmission network, the size limit of single file and batch file is stipulated. Avoid storage and transmission difficulties caused by excessively large files, and also help improve the efficiency of archive management.
[0030] The beneficial effects of the above technical solution are as follows: by presetting multiple archive format standards, it is ensured that the generation of electronic files complies with unified specifications. The file format standard ensures the compatibility and readability of the file, the content structure standard improves the orderliness and traceability of the file, the metadata standard ensures the accurate transmission and management of information, and the typesetting style standard optimizes the visual presentation of the file and improves the user experience. The security standard strengthens the file protection mechanism to prevent data leakage or tampering, and the file rule standard further refines the operation process to ensure that the generated electronic files have high security and reliability and meet the needs of various application scenarios. This technical solution provides comprehensive protection for the safe generation of electronic files and improves the standardization and security of file processing.
[0031] Embodiment 3: The embodiment of the present invention provides a method for securely generating an electronic file, which extracts basic information related to a target engineering project from a database of a business system, including: Verify access rights to business systems and establish a secure connection with business system databases; Obtain the project type information of the current engineering project based on the business system database, and determine the focus and scope of the metadata to be collected based on the project type; Based on preset query statements, query and extract data from several data tables in the business system database; Perform preliminary data cleaning on the extracted data to remove duplicate and invalid data; The data is classified and sorted according to the key information of the preset type to obtain the basic information related to the target engineering project.
[0032] The beneficial effects of the above technical solution are as follows: Through secure access to and data extraction from the business system database, it is ensured that basic information related to the target engineering project can be accurately obtained. First, access rights are verified and a secure connection is established to effectively ensure the security of data transmission. By analyzing the project type, the focus and scope of metadata to be collected are accurately determined. Preset query statements are used to extract data from multiple data tables, and preliminary cleaning is performed to remove invalid and duplicate information, thereby improving data quality. Finally, classification and organization based on key information ensure the standardization and availability of data, lay a solid foundation for the safe generation of electronic documents, and ensure the efficiency of project management and data security.
[0033] Embodiment 4: The embodiment of the present invention provides a method for securely generating an electronic file, which organizes the collected metadata according to a preset format to determine a structured metadata set, including: Perform attribute analysis on metadata to determine the attributes of metadata; A unique identifier is assigned to each metadata field based on the metadata's attributes and a preset attribute-identifier.
[0034] The beneficial effects of the above technical solution are as follows: by performing attribute analysis on metadata and assigning unique identifiers based on preset attribute-identifiers, efficient structural processing of metadata is achieved, the standardization and consistency of metadata are ensured, and it helps to avoid field duplication or confusion, and improve the accuracy and integrity of data. In this way, the secure generation of electronic files can be effectively supported, ensuring the precise correspondence between file content and metadata, while also facilitating subsequent file management and traceability. Ultimately, this technical solution provides reliable support for the efficient generation, storage, and management of electronic files, and helps to improve the security and reliability of data processing.
[0035] Embodiment 5: The embodiment of the present invention provides a method for securely generating an electronic file, which creates an electronic file based on a structured metadata set, including: Based on the item type and template information in the metadata, the corresponding electronic file template is called; populate the data in the structured metadata collection into the corresponding fields of the electronic document template; Adding metadata information to electronic files, thereby generating electronic files; Generate a unique file name for the electronic file based on a combination of a timestamp and a random number; Add a custom label containing project information and temporary file identification to the file header of the electronic file; Store the electronic file in the specified temporary file storage directory and record the storage path of the electronic file.
[0036] The beneficial effects of the above technical solution are as follows: by creating electronic files based on structured metadata, the high consistency and accuracy of the file content and metadata are ensured. By calling the corresponding electronic file template and filling the structured data into the template, the efficiency and standardization of file generation are effectively improved. Adding custom tags to the file header further enhances the traceability of the file, facilitating subsequent management and retrieval. The generated unique file name is based on a combination of timestamp and random number, which avoids file name conflicts and improves the security of the file. Finally, the file is stored in the specified directory and the storage path is recorded, ensuring the integrity and manageability of the file, providing a reliable technical guarantee for the safe generation and subsequent processing of electronic files.
[0037] Embodiment 6: The embodiment of the present invention provides a method for securely generating an electronic file, which, based on a preset archive format standard, calls a corresponding format conversion tool, converts a temporary file into a preset format, and overwrites the temporary file to generate a new electronic file, including: Perform character analysis on the temporary file, and then perform escape processing on the special characters in the temporary file; Call the format conversion tool to convert the format of the processed temporary file, and perform a preliminary format preview check on the converted file; In the original temporary file storage path, the temporary file after format preview check will overwrite the original temporary file with the same file name to generate a new electronic file.
[0038] The beneficial effects of the above technical solution are as follows: by performing character analysis and special character escape processing on temporary files, file damage or parsing failure caused by format incompatibility or character errors is avoided. The format conversion tool is called and a format preview check is performed to ensure that the converted file meets the preset archive format standard, thereby improving the accuracy and stability of the file format conversion. Overwriting the generated new electronic file under the original temporary file storage path avoids redundant storage and improves file management efficiency. At the same time, by ensuring the uniformity and standardization of file formats, a more reliable file storage and processing solution is provided for the archive management system, thereby enhancing the compatibility and security of files.
[0039] Embodiment 7: The embodiment of the present invention provides a method for securely generating an electronic file, which digitally signs a new electronic file and a structured metadata set to generate a signed electronic file, including: Obtain a digital certificate for digital signature, and use the private key corresponding to the digital certificate to sign the generated hash value; attaching the generated digital signature to new electronic documents and structured metadata collections; After the signature is attached, the public key of the digital certificate is used to decrypt the signature to obtain the original hash value, and the new electronic file and structured metadata set are hashed again. The obtained hash value is compared with the decrypted hash value. If the two are consistent, it means that the signature is valid and the file and metadata set have not been tampered with after signing; if they are inconsistent, it means that the signature is invalid, the file may have been tampered with, and the signing operation needs to be performed again to generate a signed electronic file.
[0040] In this embodiment, the digital certificate can be applied for from a legitimate certificate authority (CA) or issued using the enterprise's internal certificate management system. After obtaining the certificate, the validity of the certificate is strictly verified. Check the validity period of the certificate to ensure that the certificate is valid within the current time range; verify the signature of the certificate by comparing it with the CA's public key to confirm the authenticity and integrity of the certificate; check whether the certificate has been revoked by querying the certificate revocation list (CRL) or the online certificate status protocol (OCSP). If the certificate verification fails, prompt the user to re-obtain a valid digital certificate; In this embodiment, the private key corresponding to the digital certificate is used to sign the generated hash value. The private key is the confidential information of the digital certificate owner, and only the user holding the private key can sign. In the signing process, an asymmetric encryption algorithm (such as RSA) is used to encrypt the hash value with the private key to generate a digital signature. The signing process needs to be strictly confidential to prevent the private key from being leaked and causing the signature to be forged; In this embodiment, the generated digital signature is attached to the new electronic file and the structured metadata collection by using a specific file format or protocol to embed the signature information into a specific location of the file, such as the file header, file footer, or a special signature area. At the same time, the relevant information of the signature, such as the signing time, signature algorithm, and relevant information of the digital certificate, is recorded for subsequent verification and tracing.
[0041] The beneficial effects of the above technical solution are as follows: By adding digital signatures to electronic files and structured metadata, the integrity verification of files and data is achieved. By signing the hash value with the private key of the digital certificate and comparing the hash value after decryption with the public key, it is possible to effectively verify whether the file and metadata have been tampered with after signing. This solution enhances the security of electronic files, ensures that the files are not tampered with during storage and transmission, and provides higher reliability and credibility. At the same time, if the verification fails, the risk of file tampering can be discovered in a timely manner, ensuring the security of electronic files and ensuring the integrity and validity of data in the archive management process.
[0042] Embodiment 8: The embodiment of the present invention provides a method for securely generating an electronic file, encrypting a signed electronic file to generate a final encrypted electronic file, saving the encrypted electronic file according to a preset storage path, recording the information related to the encrypted electronic file in an archive management system, and entering the encrypted electronic file into a pre-archiving library, thereby completing the secure generation and preliminary archiving of the electronic file, including: Check the preset storage path to confirm whether the storage path exists. If not, create the corresponding folder or directory; Check the permission settings of the storage path to see if the current user has permission to write files. Also, check the available space of the storage medium. If the storage space is insufficient, clear the space and replace the storage medium. Use the API of the file system or the relevant storage service interface to save the encrypted electronic file to a preset storage path, and set the corresponding file name and file attributes for the file; Extract key information from encrypted electronic files and related operation records, organize and classify the extracted information, and format it according to the requirements of the archive management system; Send the processed encrypted electronic file related information to the archive management system, communicate with the archive management system interface, and pass the information to the system; The information related to the encrypted electronic file is recorded in the system's database, a unique identifier is assigned to each record, and a corresponding index is established. At the same time, the information is classified and archived.
[0043] The beneficial effects of the above technical solution are as follows: by encrypting and storing the signed electronic files in a standardized manner, the security and integrity of the files during storage are ensured. The encrypted electronic files undergo detailed path checks, permission settings, and storage space management to avoid file loss or damage due to storage problems. At the same time, the operation records and key information of the files are extracted and formatted to ensure compliance with the requirements of the archive management system. Data is transmitted through the interface with the archive management system, which enables accurate recording, classification, and archiving of files, ensuring the traceability, integrity, and security of electronic files, and providing a more reliable and standardized solution for the enterprise's archive management.
[0044] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for securely generating an electronic file, characterized in that: include: Step 1: Extract basic information related to the target project from the database of the business system. At the same time, obtain the responsible person information from the personnel information table, and organize the collected metadata according to the preset format to determine the structured metadata set; Step 2: Create an electronic file based on the structured metadata set and save the electronic file as a temporary file; Step 3: Based on the preset file format standard, call the corresponding format conversion tool to convert the temporary file into the preset format, and overwrite the temporary file to generate a new electronic file; Step 4: Digitally sign the new electronic file and the structured metadata set to generate a signed electronic file; Step 5: Encrypt the signed electronic file to generate the final encrypted electronic file, save the encrypted electronic file according to the preset storage path, record the relevant information of the encrypted electronic file in the archive management system, and enter the encrypted electronic file into the pre-archiving library, thereby completing the secure generation and preliminary archiving of the electronic file.
2. A method for securely generating an electronic file according to claim 1, characterized in that: The preset archive format standards include: file format standards, content structure standards, metadata standards, typesetting style standards, security standards and file rule standards.
3. A method for securely generating an electronic file according to claim 1, characterized in that: Extract basic information related to the target project from the database of the business system, including: Verify access rights to business systems and establish a secure connection with business system databases; Obtain the project type information of the current engineering project based on the business system database, and determine the focus and scope of the metadata to be collected based on the project type; Based on preset query statements, query and extract data from several data tables in the business system database; Perform preliminary data cleaning on the extracted data to remove duplicate and invalid data; The data is classified and sorted according to the key information of the preset type to obtain the basic information related to the target engineering project.
4. A method for securely generating an electronic file according to claim 1, characterized in that: The collected metadata is sorted according to the preset format to determine the structured metadata set, including: Perform attribute analysis on metadata to determine the attributes of metadata; A unique identifier is assigned to each metadata field based on the metadata's attributes and a preset attribute-identifier.
5. The method for securely generating an electronic file according to claim 1, characterized in that: Creation of electronic records based on structured metadata collections, including: Based on the item type and template information in the metadata, the corresponding electronic file template is called; populate the data in the structured metadata collection into the corresponding fields of the electronic document template; Adding metadata information to electronic files, thereby generating electronic files; Generate a unique file name for the electronic file based on a combination of a timestamp and a random number; Add a custom label containing project information and temporary file identification to the file header of the electronic file; Store the electronic file in the specified temporary file storage directory and record the storage path of the electronic file.
6. A method for securely generating an electronic file according to claim 1, characterized in that: Based on the preset file format standard, call the corresponding format conversion tool to convert the temporary file to the preset format, and overwrite the temporary file to generate a new electronic file, including: Perform character analysis on the temporary file, and then perform escape processing on the special characters in the temporary file; Call the format conversion tool to convert the format of the processed temporary file, and perform a preliminary format preview check on the converted file; In the original temporary file storage path, the temporary file after format preview check will overwrite the original temporary file with the same file name to generate a new electronic file.
7. A method for securely generating an electronic file according to claim 1, characterized in that: Digitally sign new electronic files and structured metadata collections to generate signed electronic files, including: Obtain a digital certificate for digital signature, and use the private key corresponding to the digital certificate to sign the generated hash value; attaching the generated digital signature to new electronic documents and structured metadata collections; After the signature is attached, the public key of the digital certificate is used to decrypt the signature to obtain the original hash value, and the new electronic file and structured metadata set are hashed again. The obtained hash value is compared with the decrypted hash value. If the two are consistent, it means that the signature is valid and the file and metadata set have not been tampered with after signing; if they are inconsistent, it means that the signature is invalid, the file may have been tampered with, and the signing operation needs to be performed again to generate a signed electronic file.
8. A method for securely generating an electronic file according to claim 1, characterized in that: Encrypt the signed electronic file to generate the final encrypted electronic file, save the encrypted electronic file according to the preset storage path, record the relevant information of the encrypted electronic file in the archive management system, and enter the encrypted electronic file into the pre-archiving library, thereby completing the secure generation and preliminary archiving of the electronic file, including: Check the preset storage path to confirm whether the storage path exists. If not, create the corresponding folder or directory; Check the permission settings of the storage path to see if the current user has permission to write files. Also, check the available space of the storage medium. If the storage space is insufficient, clear the space and replace the storage medium. Use the file system API or related storage service interface to save the encrypted electronic file to a preset storage path, and set the corresponding file name and file attributes for the file; Extract key information from encrypted electronic files and related operation records, organize and classify the extracted information, and format it according to the requirements of the archive management system; Send the processed encrypted electronic file related information to the archive management system, communicate with the archive management system interface, and pass the information to the system; The information related to the encrypted electronic file is recorded in the system's database, a unique identifier is assigned to each record, and a corresponding index is established. At the same time, the information is classified and archived.
Citation Information
Patent Citations
Electronic certificate processing method based on layout file
CN106598930A
Engineering electronic archive implementation method and system
CN110008270A
Cited By
Engineering file digital generation and management method and system, and electronic equipment
CN121303617A