Material file management method and device, computer device and storage medium
By adopting a four-tiered B/S architecture in the document management system, automatic association and bidirectional traceability of documents and materials are achieved, solving problems related to document security, system stability, and access control. This improves processing capacity and system self-healing capabilities, and avoids data silos and coarse access control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ABLE NEW ENERGY CO LTD
- Filing Date
- 2025-11-05
- Publication Date
- 2026-06-02
AI Technical Summary
Existing document management systems suffer from problems such as document security issues, insufficient system stability, difficulty in managing the association between materials and documents, insufficient granularity of access control, limited document processing capabilities, and a lack of intelligent monitoring and self-healing capabilities. These issues lead to data security risks, system crash risks, information silos, coarse access control, and low processing efficiency.
It adopts a four-layer design based on B/S architecture, including presentation layer, business layer, tool service layer and data storage layer, to realize automatic association and bidirectional traceability of files and materials, support multi-format file processing, build a multi-level system monitoring and automatic recovery mechanism, and provide fine-grained permission control and file safe deletion and recovery mechanism.
It enables automatic association and two-way traceability of documents and materials, enhances document security and system stability, improves processing capabilities and the flexibility of access control, and reduces maintenance costs.
Smart Images

Figure CN121070877B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of document management technology, and in particular to methods, apparatus, computer equipment and storage media for material document management. Background Technology
[0002] As enterprises deepen their digital transformation, the amount of document data generated within enterprises is growing exponentially. Traditional document management methods face numerous challenges and technical bottlenecks, mainly in the following aspects:
[0003] 1. The main technical shortcomings of existing document management systems are:
[0004] (11) File security issues: Existing file management systems generally adopt physical deletion mechanisms. Once a user performs a deletion operation, the file is permanently deleted and cannot be recovered. This design poses serious data security risks, especially in enterprise environments, where accidental deletion of important documents may cause significant losses. At the same time, the lack of effective file access control and watermark protection mechanisms makes it impossible to effectively prevent the unauthorized dissemination of sensitive documents.
[0005] (12) Insufficient system stability, meaning that the existing file system is prone to memory leaks and file handle leaks when handling large files or high-concurrency operations, leading to system crashes or deadlocks. The lack of effective resource monitoring and automatic recovery mechanisms makes it difficult to guarantee system reliability.
[0006] 2. There are technological gaps in the management of the association between materials and documents, and the following problems also exist:
[0007] (21) The problem of information silos: In traditional enterprises, material management systems and document management systems are often independent of each other and lack effective data interaction and association mechanisms; the correspondence between technical documents, design drawings, specifications and other materials and specific materials needs to be maintained manually, which is inefficient and prone to errors.
[0008] (22) Difficulty in two-way traceability, that is, the existing system cannot achieve rapid two-way traceability from material to document and from document to material. When technicians search for relevant documents of specific materials, they need to switch between multiple systems, which is complicated and time-consuming.
[0009] 3. Insufficient granularity of access control, specifically:
[0010] (31) Coarse access control: The access control of existing file management systems usually only reaches the folder level, and cannot achieve fine-grained access control based on file type, user role, and business process. This coarse access management model cannot meet the complex business needs of enterprises.
[0011] (32) Lack of dynamic permission adjustment, that is, the permission configuration of traditional systems is highly static and cannot automatically adapt permission settings according to changes in business processes and user roles, resulting in high maintenance costs and insufficient flexibility.
[0012] 4. Limited file processing capabilities, specifically:
[0013] (41) Insufficient format support, that is, the existing system has limited support for professional formats such as multimedia files and Office documents, lacks a unified preview and conversion mechanism, and has a poor user experience.
[0014] (42) Weak batch processing capability, that is, traditional systems lack effective concurrency control and resource scheduling mechanisms when handling large-scale file uploads, conversions, approvals and other operations, resulting in low processing efficiency.
[0015] 5. Lack of intelligent monitoring and self-healing capabilities. Specifically, existing systems generally lack intelligent system monitoring mechanisms, are unable to detect system health status and resource usage in real time, and are unable to automatically perform recovery operations when system anomalies occur, relying on manual intervention and resulting in high maintenance costs. Summary of the Invention
[0016] The embodiments of the present invention provide a material document management method, apparatus, computer equipment and storage medium, which aim to solve the problem that in the prior art, material management systems and document management systems are often independent of each other, lack effective data interaction and association mechanisms, and cannot achieve bidirectional rapid traceability from materials to documents and from documents to materials.
[0017] In a first aspect, embodiments of the present invention provide a material document management method, comprising:
[0018] In response to a material file processing instruction, obtain the current file processing type corresponding to the material file processing instruction;
[0019] If the current file processing type is determined to be a file upload type, the current file to be uploaded is obtained based on the preset file upload strategy, and the file is written to disk and the material association is processed in sequence to complete the storage of the current file to be uploaded.
[0020] If the current file processing type is determined to be a two-way traceability type, the current traceable information is obtained based on the preset two-way traceability strategy, and the local file information or material information is traced to obtain the current traceability result.
[0021] Secondly, embodiments of the present invention also provide a material document management device, comprising:
[0022] The file processing type acquisition unit is used to acquire the current file processing type corresponding to the material file processing instruction in response to the material file processing instruction.
[0023] The file upload processing unit is used to, if it is determined that the current file processing type is a file upload type, obtain the current file to be uploaded based on a preset file upload strategy and perform file disk storage and material association processing in sequence to complete the storage of the current file to be uploaded.
[0024] The document bidirectional traceability processing unit is used to obtain the current traceable information based on a preset bidirectional traceability strategy and perform local document information or material information traceability if it is determined that the current document processing type is a bidirectional traceability type, so as to obtain the current traceability result.
[0025] Thirdly, embodiments of the present invention also provide a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect above.
[0026] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, the computer program including program instructions that, when executed by a processor, can implement the method described in the first aspect above.
[0027] This invention provides a material document management method, apparatus, computer equipment, and storage medium. The method includes: responding to a material document processing instruction, obtaining the current document processing type corresponding to the instruction; if the current document processing type is determined to be a file upload type, obtaining the file to be uploaded based on a preset file upload strategy and sequentially performing file storage and material association processing to complete the storage of the file to be uploaded; if the current document processing type is determined to be a two-way traceability type, obtaining the information to be traced based on a preset two-way traceability strategy and performing local file information or material information traceability to obtain the current traceability result. This invention enables automatic association between documents and materials, and also allows for two-way traceability of documents and materials by combining stored data, avoiding the data silo problem between the material management system and the document management system. Attached Figure Description
[0028] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0029] Figure 1 This is a schematic diagram illustrating an application scenario of the material document management method provided in this embodiment of the invention;
[0030] Figure 2 A flowchart illustrating the material document management method provided in an embodiment of the present invention;
[0031] Figure 3 This is a schematic diagram of a sub-process of the material document management method provided in an embodiment of the present invention;
[0032] Figure 4 This is a schematic diagram of another sub-process of the material document management method provided in an embodiment of the present invention;
[0033] Figure 5 This is a schematic diagram illustrating the construction process of the current file and material association table in the material file management method provided in this embodiment of the invention;
[0034] Figure 6 This is a schematic diagram of another sub-process of the material document management method provided in an embodiment of the present invention;
[0035] Figure 7 A schematic block diagram of a material document management device provided in an embodiment of the present invention;
[0036] Figure 8 A schematic block diagram of a computer device provided for an embodiment of the present invention. Detailed Implementation
[0037] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0038] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0039] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0040] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0041] Please also refer to Figure 1 and Figure 2 ,in Figure 1 This is a schematic diagram illustrating a scenario of the material document management method according to an embodiment of the present invention. Figure 2 This is a flowchart illustrating the material document management method provided in an embodiment of the present invention. Figure 1 As shown, the material document management method provided in this embodiment of the invention is applied to server 10, and user terminal 20 is communicatively connected to server 10. Figure 2 As shown, the method includes the following steps S110-S130.
[0042] S110. In response to the material file processing instruction, obtain the current file processing type corresponding to the material file processing instruction.
[0043] In this embodiment, the technical solution is described with the server as the execution entity. A material document management platform is deployed on the server, specifically adopting a four-layer B / S architecture (B / S architecture refers to Browser / Server architecture). This architecture includes a presentation layer (specifically, React SPA), a business layer (specifically, Node.js / Express), a tool service layer (specifically, PDF watermarking, file streaming, Office conversion, monitoring and self-healing, etc.), and a data storage layer (specifically, MySQL database and file system). The modular and cross-cutting design employed here, i.e., a decoupled design of controller-middleware-tools-services-routing, and the REST interfaces (REST stands for Representational State Transfer) between the above modules form a mesh connection.
[0044] More specifically, the material document management platform on the server adopts a four-tier B / S architecture, in which the presentation layer, which deploys the front-end module, provides a user interface that allows users to log in, search, upload, approve, preview, download, delete, and perform other operations, as well as preview documents online.
[0045] The business layer, which deploys controller modules, includes a file controller capable of file upload / download, categorized storage, version control and approval, logical deletion and recovery, preview scheduling, and more. It also includes user / settings / material controllers for user, role, department, system configuration, watermark parameters, material information and mapping. The middleware module, also part of the business layer, primarily handles authentication and permissions (including JWT authentication and RBAC fine-grained authorization), upload protection and timeout (including concurrency limits, timeout thresholds, exception handling, and request timeout processing), and error handling and logging (including exception capture and structured logging).
[0046] The tools and services module is deployed in the tools service layer, which mainly includes a PDF watermarking engine (which performs dynamic watermarking operations based on pdf-lib), a file stream manager (which manages the stream lifecycle and handles, and handles leakage prevention), an Office converter (which performs unified document conversion / preview), and monitoring and self-healing (which performs health checks, process / response monitoring, threshold-triggered GC / cleanup / restart), etc.
[0047] The data access and storage module is deployed in the data storage layer, where the MySQL database is used to store metadata, permissions and audit logs; the file system is used to manage the category directory, the delete recycle area and version archive.
[0048] After introducing the architecture of the material file management platform on the server, the following section details the specific file management methods. When the server detects a material file processing instruction, it needs to parse the instruction to obtain the current file processing type. This current file processing type includes at least file viewing, file upload, two-way traceability, file approval, file download, file deletion / recovery, monitoring and self-healing, user management, and access control.
[0049] S120. If the current file processing type is determined to be a file upload type, the current file to be uploaded is obtained based on the preset file upload strategy, and the file is written to disk and the material is associated with it in sequence to complete the storage of the current file to be uploaded.
[0050] In this embodiment, if the current file processing type is determined to be a file upload type, the file to be uploaded by the user is generally a document related to material data. In this case, specific processing after file upload can be performed, such as associating it with material metadata.
[0051] In one embodiment, such as Figure 3 As shown, step S120 includes:
[0052] S121. Obtain the current user's authentication information;
[0053] S122. If it is determined that the current user verification information passes the verification, then obtain the current user permission information;
[0054] S123. If it is determined that the current user permission information has passed the verification, then obtain the current file to be uploaded and add it to the waiting queue;
[0055] S124. If it is determined that the preset upload protection condition of the waiting queue has not been triggered, then the current target directory corresponding to the current file to be uploaded is obtained, and the current file to be uploaded is written to the storage area corresponding to the current target directory.
[0056] S125. Obtain the current target metadata corresponding to the current file to be uploaded in the current target directory, and establish a unique association between the current file to be uploaded and the current target metadata.
[0057] In this embodiment, when a user logs into the material file management platform through a user terminal (such as a smartphone) and uploads a file on the front-end page, the file to be uploaded is not directly uploaded to the server. Instead, the user verification information (such as the user's login account and password) corresponding to the user terminal is verified first. Once it is determined that the user verification information corresponding to the user terminal is registered user information and has passed the verification, the user's current permission information (such as administrator permissions, ordinary user permissions, etc.) can be further obtained. Only when the current user permission information is verified is the file to be uploaded obtained from the user terminal and added to the waiting queue in the server. At this point, the waiting queue will check its current queue status to determine whether the preset upload protection conditions have been triggered. Specifically, the upload protection conditions are set to a current concurrent user count of less than 10 and a file upload start time of no more than 5 minutes (of course, the specific values of the current concurrent user count of less than 10 and the file upload start time of no more than 5 minutes are not limited to the above example and can be customized according to the user's actual needs and the server's own performance). After determining that the preset upload protection conditions of the waiting queue have not been triggered, the current target directory corresponding to the file to be uploaded can be obtained, and the file to be uploaded can be written to the storage area corresponding to the current target directory. Finally, the current target metadata corresponding to the file to be uploaded can be obtained in the current target directory, and a unique association relationship can be established between the file to be uploaded and the current target metadata.
[0058] Specifically, when the current concurrent number of requests in the waiting queue is determined to be less than 10, regardless of whether the file upload startup time exceeds 5 minutes, an execution token is first obtained, then a timeout is started to count the file upload startup time, and the currently pending file is streamed into a temporary file. Afterwards, if the file upload startup time exceeds 5 minutes, the execution token is released, the temporary file is cleaned up, and a file upload error message is returned and logged. If the file upload startup time does not exceed 5 minutes, the current target directory corresponding to the currently pending file is obtained, and the currently pending file is written to the storage area corresponding to the current target directory. Furthermore, the current target metadata corresponding to the currently pending file can be obtained in this storage area, and a unique association is established between the currently pending file and the current target metadata. Simultaneously, the execution token is released, and a file upload success message is returned.
[0059] In one embodiment, such as Figure 4 As shown, step S125 includes:
[0060] S1251. Obtain the current file table structure information corresponding to the current file to be uploaded, and obtain the current material number from the current file table structure information;
[0061] S1252. Obtain the current target metadata with the current material number, and obtain the current material table structure information corresponding to the current target metadata;
[0062] S1253. Construct a file-material association table based on the current file table structure information and the current material table structure information to establish a unique association between the current file to be uploaded and the current target metadata.
[0063] In this embodiment, during the process of establishing a unique association between the currently uploaded file and the current target metadata, reference can be made to... Figure 5After the server obtains the structure information of the file to be uploaded, the specific structure information of the file to be uploaded (which can be represented by a FILES table) includes the following fields: id (file ID, data type int, and primary key PK), filename (file name, data type int), part_number (part number, which can be understood as material part number, data type varchrar), part_name (part name, which can be understood as material part name, data type varchrar), specification (specification, data type text), upload_id (uploader, data type int, and foreign key FK), upload_date (upload time, data type timestamp), and file_path (file path, data type varchrar). The current user information table corresponding to the file to be uploaded can be represented by the USERS table, which includes the following fields: id (user ID, data type int, and primary key PK), username (user name, data type varchrar), name (name, data type varchrar), and department (department, data type varchrar).
[0064] Continue to refer to Figure 5 The current material table structure information (which can be represented by a MATERIALS table) corresponding to the current target metadata with the current material number obtained by the server includes the following fields: id (material ID, data type int, and primary key PK), part_number (part number, which can be understood as material part number, data type varchrar, and is a unique key UK), name (part name, which can be understood as material part name, data type varchrar), specification (specification, data type text), status (status, data type enum), created_by (creator, data type int, and is a foreign key FK), and created_at (creation time, data type timestamp).
[0065] Still referencing Figure 5In the server, a file-material association table (FILES_MATERIALS_RELATIONS) is constructed based on the current file table structure information and the current material table structure information. This table represents the association and includes the following fields: id (association ID, data type int, primary key), file_id (file ID, data type int, foreign key), material_id (material ID, data type int, foreign key), created_by (association creator, data type int, foreign key), and created_at (association creation time, data type in timestamp). After constructing the file-material association table (FILES_MATERIALS_RELATIONS) based on the current file table structure information (FILES table) and the current material table structure information (MATERIALS table), the file-material association table can be linked to the current user information table (USERS table), thus completing the intelligent association between material files and material metadata.
[0066] S130. If it is determined that the current file processing type is a two-way traceability type, the current traceability information is obtained based on the preset two-way traceability strategy, and the local file information or material information is traced to obtain the current traceability result.
[0067] In this embodiment, if the current file processing type is determined to be a two-way traceability type, it means that the user inputs file information or material information on the front-end user interface. At this time, the file information or material information is used as the query condition, and a relevant query is performed in the local database of the server to obtain the current traceability result.
[0068] In one embodiment, such as Figure 6 As shown, step S130 includes:
[0069] S131. If it is determined that the current traceable information includes file information, then a first SQL statement is generated based on the bidirectional traceability strategy with the file name corresponding to the file information, and a query is performed in the local file and material association table to obtain the current traceability result;
[0070] S132. If it is determined that the current traceability information includes material information, then based on the two-way traceability strategy, the material information is used as the query condition, and a query is performed in the local database to obtain the current traceability result.
[0071] In this embodiment, step S131 can obtain the current material number of the current traceable information by using a first preset regular expression (such as [A-Z0-9]+-[A-Z0-9]+|[A-Z0-9]+_[A-Z0-9]+). If the current traceable information corresponds to the current file, the current material number is obtained from the file name of the current file first. If the current material number can be obtained from the file name based on the first preset regular expression, it is not necessary to obtain it from the specific file data of the current file. For example, if the obtained initial material number is ABC_123, the initial material number needs to be standardized to convert the underscores into hyphens to obtain the current material number as ABC-123. Then, an SQL statement is generated using the current material number as the query condition, and the material table structure information with the current material number is obtained by querying the local database (such as MySQL database) of the server. After confirming the retrieval of the material table structure information containing the current material item number and the current file-material association table, the system automatically populates the file information and writes it to the file. If the association between the current file and the material association table (i.e., the FILES_MATERIALS_RELATIONS table) is confirmed to be effective, a two-way traceability relationship between the current file table structure information and the current material table structure information becomes effective. This enables traceability from file to material, displaying complete material information, and also traceability from material to file, displaying all related documents. Through this intelligent association between material files and material metadata, the system can automatically identify item numbers and establish material associations during file uploads without manual intervention. It can also intelligently complete information such as item name and specifications in logistics data based on the file, and automatically inherit material association relationships when the file version is updated. Furthermore, users can quickly find all related documents by material item number for rapid location, view complete material information associated with any document for complete traceability, fully trace historical versions of material documents for version tracking, and perform batch operations on multiple documents of the same material for batch management.
[0072] If the first preset regular expression cannot obtain the current material number from the file name, it needs to be obtained from the specific file data of the current file, that is, from the current file table structure information corresponding to the current file. The subsequent intelligent association process is the intelligent association process executed after the first preset regular expression can obtain the current material number from the file name, which will not be elaborated here.
[0073] In one embodiment, the method further includes the following after step S110:
[0074] If the current file processing type is determined to be a file viewing type, then the current file viewing information is obtained based on the preset file viewing strategy, and the file is acquired to obtain the current target file.
[0075] In this embodiment, when a user sends a request to the server to view a specific file (which can be understood as a file viewing request) through the user interface on the front end, the server verifies the user authentication information (such as the user's login account and password) included in the current file viewing information according to the file viewing strategy. If the user authentication information corresponding to the user terminal is confirmed to be registered user information and passes verification, the server can further obtain the current user permission information (such as administrator permissions, ordinary user permissions, etc.) corresponding to the current file viewing information. Only when the current user permission information passes verification can the server retrieve the current target file corresponding to the current file viewing information from its database. Furthermore, if the file type of the current target file is determined to be PDF or an Office product file format (such as doc, ppt, etc.), the current target file is previewed and rendered, generating a preview address or stream to be returned to the front end for display. If the file type of the current target file is determined to be other than PDF or an Office product file format, the server first reads the thumbnail and basic information of the current target file, then generates a preview address or stream to be returned to the front end for display. Therefore, the above method enables rapid viewing of material-related files.
[0076] In one embodiment, the method further includes the following after step S110:
[0077] If the current file processing type is determined to be a file approval type, then the current file to be approved is obtained based on the preset file approval strategy and the file is automatically approved to obtain the current file approval result.
[0078] In this embodiment, when a user sends a current file approval request (which can be understood as submitting an approval request) to the server through the user interface on the front end, the server verifies the user verification information (such as the user's login account and password) corresponding to the file to be approved through the file approval strategy. When it is determined that the user verification information corresponding to the user terminal is registered user information and has passed the verification, the server can further obtain the current user permission information (such as administrator permission, ordinary user permission, etc.) corresponding to the current file viewing information. Only when the current user permission information is verified can the server automatically approve the current file to be approved.
[0079] The specific process of automatically approving the currently pending document on the server is as follows: First, the approval process node is loaded. Then, the approval process node automatically reviews whether the currently pending document is legal and compliant and conforms to the document specifications. If the currently pending document fails the legality and compliance check or does not conform to the document specifications, the approval process node returns it for modification and records the reason for return for subsequent rejection audit record query. If the currently pending document is legal, compliant and conforms to the document specifications, the approval process node releases the currently pending document. However, it should be noted that if the approval process node is the last node in the complete document approval process, the currently pending document is marked as published, and the version status and approval log are updated. The document distribution and watermarking strategy can also be triggered, and the current document approval result (such as document approval passed) corresponding to the currently pending document is sent to the corresponding applicant and subscriber. In addition, the approval record is added to the audit log.
[0080] In one embodiment, the method further includes the following after step S110:
[0081] If the current file processing type is determined to be a file download type, then the current file to be downloaded corresponding to the current file download information is obtained based on the preset file download strategy, and the current file to be downloaded is sent to the corresponding requesting end.
[0082] In this embodiment, when a user sends a request to the server via a user interface (which can be considered a user terminal), requesting the download of a specific file, the server verifies the user authentication information (such as the user's login account and password) included in the download information using a file download strategy. If the user authentication information corresponding to the user terminal is confirmed to be registered user information and passes verification, the server can further obtain the current user permission information (such as administrator or regular user permissions). Only when the current user permission information passes verification can the server retrieve the file to be downloaded corresponding to the current file download information from its database. After obtaining the file to be downloaded, the server needs to determine whether to automatically add a file watermark based on the current user permission information. If it is determined that an automatic watermark is needed, a watermark is automatically added to each page of the file to be downloaded, and then a download stream is generated for the requesting client to download. Thus, the above method enables the rapid download of material-related files.
[0083] In one embodiment, the method further includes the following after step S110:
[0084] If the current file processing type is determined to be file deletion / recovery, then the current file to be processed is obtained based on the preset file deletion / recovery type strategy, and deletion or recovery operations are performed accordingly to obtain the current processing result of the current file to be processed.
[0085] In this embodiment, when a user sends a file deletion request or file recovery request to the server through the user interface, the server verifies the user authentication information (such as user login account and password) included in the file deletion / recovery request using a file deletion / recovery type policy. If the server determines that the user authentication information corresponding to the user terminal is registered user information and passes the verification, it can further obtain the current user permission information (such as administrator permissions, ordinary user permissions, etc.) corresponding to the file recovery request. Only when the current user permission information passes verification can the server retrieve the file to be processed from its database. For example, if the server detects a file deletion request, and determines that the requesting user has file deletion permissions, it adds a logical deletion flag (delete) to the file to be processed, then moves the file to the Delete recycle area on the server while maintaining its original file structure. Afterward, it updates the server's database records, records the corresponding deletion audit information, and cleans up the associated permissions corresponding to the file to be processed to achieve recoverable deletion of the file.
[0086] If the currently pending file that has been deleted needs to be restored, a user with administrator privileges needs to log in to the server using their user terminal, locate the Delete directory in the server's Delete recycle area, read the deletion record corresponding to the currently pending file, move the currently pending file back to its original storage location before it was last deleted, update the server's database record, rebuild the associated permissions corresponding to the currently pending file, and record the corresponding recovery audit information.
[0087] Of course, the server can also process requests of different types, such as monitoring and self-healing, user management, and permission management. For example, if the current file processing type is determined to be monitoring and self-healing, the system's memory usage, file handles, database anomalies, and response time can be monitored and collected at preset intervals. When memory usage > 90%, file handles > 1000, database response is abnormal, or response time > 5 seconds, it can be determined that the server system has a fault. At this time, a health snapshot can be recorded and the recovery result can be evaluated. If the system has recovered, a recovery log is written and monitoring continues; if the system has not recovered, a smooth restart is performed (the specific operation is to stop new requests, wait for in-transit completion, release resources, and restart processes).
[0088] If the current file processing type is determined to be user management type, then a user with administrator privileges needs to log in to the server and perform operations such as creating new users, resetting passwords, enabling / disabling users, and editing user information.
[0089] If the current file processing type is determined to be the permission management type, then a user with administrator privileges needs to log in to the server and perform operations such as creating new roles, configuring permissions, assigning roles, and runtime authentication.
[0090] As can be seen, the implementation of this method can achieve automatic association between documents and materials, and can also perform bidirectional traceability of documents and materials by combining stored data, thus avoiding the data silo problem between the material management system and the document management system.
[0091] Of course, implementing this method can also achieve the following beneficial effects:
[0092] 1) Enhanced security, namely, establishing a secure file deletion and recovery mechanism, and achieving document watermark protection and fine-grained access control;
[0093] 2) System self-healing capability, namely, building a multi-layered system monitoring and automatic recovery mechanism;
[0094] 3) Enhanced processing capabilities: Supports unified processing of multiple file formats and efficient batch operations.
[0095] Figure 7 This is a schematic block diagram of a material document management device provided in an embodiment of the present invention. Figure 7 As shown, corresponding to the above-described material document management method, the present invention also provides a material document management device 100. This material document management device 100 includes a unit for performing the above-described material document management method. Please refer to... Figure 7 The material document management device 100 includes: a document processing type acquisition unit 110, a document upload processing unit 120, and a document bidirectional traceability processing unit 130.
[0096] The document processing type acquisition unit 110 is used to acquire the current document processing type corresponding to the material document processing instruction in response to the material document processing instruction.
[0097] In this embodiment, the technical solution is described with the server as the execution entity. A material document management platform is deployed on the server, specifically adopting a four-layer B / S architecture (B / S architecture refers to Browser / Server architecture). This architecture includes a presentation layer (specifically, React SPA), a business layer (specifically, Node.js / Express), a tool service layer (specifically, PDF watermarking, file streaming, Office conversion, monitoring and self-healing, etc.), and a data storage layer (specifically, MySQL database and file system). The modular and cross-cutting design employed here, i.e., a decoupled design of controller-middleware-tools-services-routing, and the REST interfaces (REST stands for Representational State Transfer) between the above modules form a mesh connection.
[0098] More specifically, the material document management platform on the server adopts a four-tier B / S architecture, in which the presentation layer, which deploys the front-end module, provides a user interface that allows users to log in, search, upload, approve, preview, download, delete, and perform other operations, as well as preview documents online.
[0099] The business layer, which deploys controller modules, includes a file controller capable of file upload / download, categorized storage, version control and approval, logical deletion and recovery, preview scheduling, and more. It also includes user / settings / material controllers for user, role, department, system configuration, watermark parameters, material information and mapping. The middleware module, also part of the business layer, primarily handles authentication and permissions (including JWT authentication and RBAC fine-grained authorization), upload protection and timeout (including concurrency limits, timeout thresholds, exception handling, and request timeout processing), and error handling and logging (including exception capture and structured logging).
[0100] The tools and services module is deployed in the tools service layer, which mainly includes a PDF watermarking engine (which performs dynamic watermarking operations based on pdf-lib), a file stream manager (which manages the stream lifecycle and handles, and handles leakage prevention), an Office converter (which performs unified document conversion / preview), and monitoring and self-healing (which performs health checks, process / response monitoring, threshold-triggered GC / cleanup / restart), etc.
[0101] The data access and storage module is deployed in the data storage layer, where the MySQL database is used to store metadata, permissions and audit logs; the file system is used to manage the category directory, the delete recycle area and version archive.
[0102] After introducing the architecture of the material file management platform on the server, the following section details the specific file management methods. When the server detects a material file processing instruction, it needs to parse the instruction to obtain the current file processing type. This current file processing type includes at least file viewing, file upload, two-way traceability, file approval, file download, file deletion / recovery, monitoring and self-healing, user management, and access control.
[0103] The file upload processing unit 120 is used to, if it is determined that the current file processing type is a file upload type, obtain the current file to be uploaded based on a preset file upload strategy and perform file disk writing and material association processing in sequence to complete the storage of the current file to be uploaded.
[0104] In this embodiment, if the current file processing type is determined to be a file upload type, the file to be uploaded by the user is generally a document related to material data. In this case, specific processing after file upload can be performed, such as associating it with material metadata.
[0105] In one embodiment, the file upload processing unit 120 is specifically used for:
[0106] Get the current user's authentication information;
[0107] If it is determined that the current user's verification information passes the verification, then obtain the current user's permission information;
[0108] If the current user's permission information is verified, then the file to be uploaded is obtained and added to the waiting queue;
[0109] If it is determined that the preset upload protection condition of the waiting queue has not been triggered, then the current target directory corresponding to the current file to be uploaded is obtained, and the current file to be uploaded is written to the storage area corresponding to the current target directory;
[0110] Obtain the current target metadata corresponding to the file to be uploaded in the current target directory, and establish a unique association between the file to be uploaded and the current target metadata.
[0111] In this embodiment, when a user logs into the material file management platform through a user terminal (such as a smartphone) and uploads a file on the front-end page, the file to be uploaded is not directly uploaded to the server. Instead, the user verification information (such as the user's login account and password) corresponding to the user terminal is verified first. Once it is determined that the user verification information corresponding to the user terminal is registered user information and has passed the verification, the user's current permission information (such as administrator permissions, ordinary user permissions, etc.) can be further obtained. Only when the current user permission information is verified is the file to be uploaded obtained from the user terminal and added to the waiting queue in the server. At this point, the waiting queue will check its current queue status to determine whether the preset upload protection conditions have been triggered. Specifically, the upload protection conditions are set to a current concurrent user count of less than 10 and a file upload start time of no more than 5 minutes (of course, the specific values of the current concurrent user count of less than 10 and the file upload start time of no more than 5 minutes are not limited to the above example and can be customized according to the user's actual needs and the server's own performance). After determining that the preset upload protection conditions of the waiting queue have not been triggered, the current target directory corresponding to the file to be uploaded can be obtained, and the file to be uploaded can be written to the storage area corresponding to the current target directory. Finally, the current target metadata corresponding to the file to be uploaded can be obtained in the current target directory, and a unique association relationship can be established between the file to be uploaded and the current target metadata.
[0112] Specifically, when the current concurrent number of requests in the waiting queue is determined to be less than 10, regardless of whether the file upload startup time exceeds 5 minutes, an execution token is first obtained, then a timeout is started to count the file upload startup time, and the currently pending file is streamed into a temporary file. Afterwards, if the file upload startup time exceeds 5 minutes, the execution token is released, the temporary file is cleaned up, and a file upload error message is returned and logged. If the file upload startup time does not exceed 5 minutes, the current target directory corresponding to the currently pending file is obtained, and the currently pending file is written to the storage area corresponding to the current target directory. Furthermore, the current target metadata corresponding to the currently pending file can be obtained in this storage area, and a unique association is established between the currently pending file and the current target metadata. Simultaneously, the execution token is released, and a file upload success message is returned.
[0113] In one embodiment, obtaining the current target metadata corresponding to the file to be uploaded in the current target directory and establishing a unique association between the file to be uploaded and the current target metadata includes:
[0114] Obtain the current file table structure information corresponding to the file to be uploaded, and obtain the current material number from the current file table structure information;
[0115] Obtain the current target metadata with the current material number, and obtain the current material table structure information corresponding to the current target metadata;
[0116] Based on the current file table structure information and the current material table structure information, a current file-material association table is constructed to establish a unique association between the current file to be uploaded and the current target metadata.
[0117] In this embodiment, during the process of establishing a unique association between the currently uploaded file and the current target metadata, reference can be made to... Figure 5 After the server obtains the structure information of the file to be uploaded, the specific structure information of the file to be uploaded (which can be represented by a FILES table) includes the following fields: id (file ID, data type int, and primary key PK), filename (file name, data type int), part_number (part number, which can be understood as material part number, data type varchrar), part_name (part name, which can be understood as material part name, data type varchrar), specification (specification, data type text), upload_id (uploader, data type int, and foreign key FK), upload_date (upload time, data type timestamp), and file_path (file path, data type varchrar). The current user information table corresponding to the file to be uploaded can be represented by the USERS table, which includes the following fields: id (user ID, data type int, and primary key PK), username (user name, data type varchrar), name (name, data type varchrar), and department (department, data type varchrar).
[0118] Continue to refer to Figure 5The current material table structure information (which can be represented by a MATERIALS table) corresponding to the current target metadata with the current material number obtained by the server includes the following fields: id (material ID, data type int, and primary key PK), part_number (part number, which can be understood as material part number, data type varchrar, and is a unique key UK), name (part name, which can be understood as material part name, data type varchrar), specification (specification, data type text), status (status, data type enum), created_by (creator, data type int, and is a foreign key FK), and created_at (creation time, data type timestamp).
[0119] Still referencing Figure 5 In the server, a file-material association table (FILES_MATERIALS_RELATIONS) is constructed based on the current file table structure information and the current material table structure information. This table represents the association and includes the following fields: id (association ID, data type int, primary key), file_id (file ID, data type int, foreign key), material_id (material ID, data type int, foreign key), created_by (association creator, data type int, foreign key), and created_at (association creation time, data type in timestamp). After constructing the file-material association table (FILES_MATERIALS_RELATIONS) based on the current file table structure information (FILES table) and the current material table structure information (MATERIALS table), the file-material association table can be linked to the current user information table (USERS table), thus completing the intelligent association between material files and material metadata.
[0120] The document bidirectional traceability processing unit 130 is used to obtain the current traceable information based on a preset bidirectional traceability strategy and perform local document information or material information traceability if it is determined that the current document processing type is a bidirectional traceability type, so as to obtain the current traceability result.
[0121] In this embodiment, if the current file processing type is determined to be a two-way traceability type, it means that the user inputs file information or material information on the front-end user interface. At this time, the file information or material information is used as the query condition, and a relevant query is performed in the local database of the server to obtain the current traceability result.
[0122] In one embodiment, the document bidirectional traceability processing unit 130 is specifically used for:
[0123] If it is determined that the current traceable information includes file information, then a first SQL statement is generated based on the bidirectional traceability strategy using the file name corresponding to the file information, and a query is performed in the local file and material association table to obtain the current traceability result;
[0124] If it is determined that the current traceability information includes material information, then based on the two-way traceability strategy, the material information is used as the query condition, and a query is performed in the local database to obtain the current traceability result.
[0125] In this embodiment, the current material number of the current traceable information can be obtained by using a first preset regular expression (such as [A-Z0-9]+-[A-Z0-9]+|[A-Z0-9]+_[A-Z0-9]+). If the current traceable information corresponds to the current file, the current material number is first obtained from the file name of the current file. If the current material number can be obtained from the file name based on the first preset regular expression, it is not necessary to obtain it from the specific file data of the current file. For example, if the obtained initial material number is ABC_123, it is necessary to standardize the initial material number to convert the underscores into hyphens to obtain the current material number as ABC-123. Then, an SQL statement is generated using the current material number as the query condition, and the material table structure information with the current material number is obtained by querying the local database (such as MySQL database) of the server. After confirming the retrieval of the material table structure information containing the current material item number and the current file-material association table, the system automatically populates the file information and writes it to the file. If the association between the current file and the material association table (i.e., the FILES_MATERIALS_RELATIONS table) is confirmed to be effective, a two-way traceability relationship between the current file table structure information and the current material table structure information becomes effective. This enables traceability from file to material, displaying complete material information, and also traceability from material to file, displaying all related documents. Through this intelligent association between material files and material metadata, the system can automatically identify item numbers and establish material associations during file uploads without manual intervention. It can also intelligently complete information such as item name and specifications in logistics data based on the file, and automatically inherit material association relationships when the file version is updated. Furthermore, users can quickly find all related documents by material item number for rapid location, view complete material information associated with any document for complete traceability, fully trace historical versions of material documents for version tracking, and perform batch operations on multiple documents of the same material for batch management.
[0126] If the first preset regular expression cannot obtain the current material number from the file name, it needs to be obtained from the specific file data of the current file, that is, from the current file table structure information corresponding to the current file. The subsequent intelligent association process is the intelligent association process executed after the first preset regular expression can obtain the current material number from the file name, which will not be elaborated here.
[0127] In one embodiment, the material document management device 100 further includes:
[0128] The file viewing and processing unit is used to obtain the current file viewing information and acquire the file based on a preset file viewing strategy if it is determined that the current file processing type is a file viewing type, thereby obtaining the current target file.
[0129] In this embodiment, when a user sends a request to the server to view a specific file (which can be understood as a file viewing request) through the user interface on the front end, the server verifies the user authentication information (such as the user's login account and password) included in the current file viewing information according to the file viewing strategy. If the user authentication information corresponding to the user terminal is confirmed to be registered user information and passes verification, the server can further obtain the current user permission information (such as administrator permissions, ordinary user permissions, etc.) corresponding to the current file viewing information. Only when the current user permission information passes verification can the server retrieve the current target file corresponding to the current file viewing information from its database. Furthermore, if the file type of the current target file is determined to be PDF or an Office product file format (such as doc, ppt, etc.), the current target file is previewed and rendered, generating a preview address or stream to be returned to the front end for display. If the file type of the current target file is determined to be other than PDF or an Office product file format, the server first reads the thumbnail and basic information of the current target file, then generates a preview address or stream to be returned to the front end for display. Therefore, the above method enables rapid viewing of material-related files.
[0130] In one embodiment, the material document management device 100 further includes:
[0131] The document approval processing unit is used to obtain the current document to be approved based on a preset document approval strategy and automatically approve the document if the current document processing type is determined to be a document approval type, thereby obtaining the current document approval result.
[0132] In this embodiment, when a user sends a current file approval request (which can be understood as submitting an approval request) to the server through the user interface on the front end, the server verifies the user verification information (such as the user's login account and password) corresponding to the file to be approved through the file approval strategy. When it is determined that the user verification information corresponding to the user terminal is registered user information and has passed the verification, the server can further obtain the current user permission information (such as administrator permission, ordinary user permission, etc.) corresponding to the current file viewing information. Only when the current user permission information is verified can the server automatically approve the current file to be approved.
[0133] The specific process of automatically approving the currently pending document on the server is as follows: First, the approval process node is loaded. Then, the approval process node automatically reviews whether the currently pending document is legal and compliant and conforms to the document specifications. If the currently pending document fails the legality and compliance check or does not conform to the document specifications, the approval process node returns it for modification and records the reason for return for subsequent rejection audit record query. If the currently pending document is legal, compliant and conforms to the document specifications, the approval process node releases the currently pending document. However, it should be noted that if the approval process node is the last node in the complete document approval process, the currently pending document is marked as published, and the version status and approval log are updated. The document distribution and watermarking strategy can also be triggered, and the current document approval result (such as document approval passed) corresponding to the currently pending document is sent to the corresponding applicant and subscriber. In addition, the approval record is added to the audit log.
[0134] In one embodiment, the material document management device 100 further includes:
[0135] The file download processing unit is used to, if it is determined that the current file processing type is a file download type, obtain the current file to be downloaded corresponding to the current file download information based on a preset file download strategy, and send the current file to be downloaded to the corresponding requesting end.
[0136] In this embodiment, when a user sends a request to the server via a user interface (which can be considered a user terminal), requesting the download of a specific file, the server verifies the user authentication information (such as the user's login account and password) included in the download information using a file download strategy. If the user authentication information corresponding to the user terminal is confirmed to be registered user information and passes verification, the server can further obtain the current user permission information (such as administrator or regular user permissions). Only when the current user permission information passes verification can the server retrieve the file to be downloaded corresponding to the current file download information from its database. After obtaining the file to be downloaded, the server needs to determine whether to automatically add a file watermark based on the current user permission information. If it is determined that an automatic watermark is needed, a watermark is automatically added to each page of the file to be downloaded, and then a download stream is generated for the requesting client to download. Thus, the above method enables the rapid download of material-related files.
[0137] In one embodiment, the material document management device 100 further includes:
[0138] The file deletion and recovery processing unit is used to obtain the current file to be processed based on a preset file deletion / recovery type strategy and perform deletion or recovery operations accordingly if the current file processing type is determined to be a file deletion / recovery type, so as to obtain the current processing result of the current file to be processed.
[0139] In this embodiment, when a user sends a file deletion request or file recovery request to the server through the user interface, the server verifies the user authentication information (such as user login account and password) included in the file deletion / recovery request using a file deletion / recovery type policy. If the server determines that the user authentication information corresponding to the user terminal is registered user information and passes the verification, it can further obtain the current user permission information (such as administrator permissions, ordinary user permissions, etc.) corresponding to the file recovery request. Only when the current user permission information passes verification can the server retrieve the file to be processed from its database. For example, if the server detects a file deletion request, and determines that the requesting user has file deletion permissions, it adds a logical deletion flag (delete) to the file to be processed, then moves the file to the Delete recycle area on the server while maintaining its original file structure. Afterward, it updates the server's database records, records the corresponding deletion audit information, and cleans up the associated permissions corresponding to the file to be processed to achieve recoverable deletion of the file.
[0140] If the currently pending file that has been deleted needs to be restored, a user with administrator privileges needs to log in to the server using their user terminal, locate the Delete directory in the server's Delete recycle area, read the deletion record corresponding to the currently pending file, move the currently pending file back to its original storage location before it was last deleted, update the server's database record, rebuild the associated permissions corresponding to the currently pending file, and record the corresponding recovery audit information.
[0141] Of course, the server can also process requests of different types, such as monitoring and self-healing, user management, and permission management. For example, if the current file processing type is determined to be monitoring and self-healing, the system's memory usage, file handles, database anomalies, and response time can be monitored and collected at preset intervals. When memory usage > 90%, file handles > 1000, database response is abnormal, or response time > 5 seconds, it can be determined that the server system has a fault. At this time, a health snapshot can be recorded and the recovery result can be evaluated. If the system has recovered, a recovery log is written and monitoring continues; if the system has not recovered, a smooth restart is performed (the specific operation is to stop new requests, wait for in-transit completion, release resources, and restart processes).
[0142] If the current file processing type is determined to be user management type, then a user with administrator privileges needs to log in to the server and perform operations such as creating new users, resetting passwords, enabling / disabling users, and editing user information.
[0143] If the current file processing type is determined to be the permission management type, then a user with administrator privileges needs to log in to the server and perform operations such as creating new roles, configuring permissions, assigning roles, and runtime authentication.
[0144] As can be seen, the implementation of this device can achieve automatic association between documents and materials, and can also perform bidirectional traceability of documents and materials by combining stored data, thus avoiding the data silo problem between the material management system and the document management system.
[0145] The aforementioned material document management device can be implemented as a computer program, which can, for example... Figure 8 It runs on the computer device shown.
[0146] Please see Figure 8 , Figure 8 This is a schematic block diagram of a computer device provided in an embodiment of the present invention. This computer device integrates any of the material document management devices provided in the embodiments of the present invention.
[0147] See Figure 8 The computer device 400 includes a processor 402, a memory, and a network interface 405 connected via a system bus 401. The memory may include a storage medium 403 and internal memory 404.
[0148] The storage medium 403 may store an operating system 4031 and a computer program 4032. The computer program 4032 includes program instructions that, when executed, cause the processor 402 to perform a material document management method.
[0149] The processor 402 provides computing and control capabilities to support the operation of the entire computer device.
[0150] The internal memory 404 provides an environment for the operation of the computer program 4032 in the storage medium 403. When the computer program 4032 is executed by the processor 402, the processor 402 can perform the above-mentioned material document management method.
[0151] This network interface 405 is used for network communication with other devices. Those skilled in the art will understand that... Figure 8The structure shown is merely a block diagram of a portion of the structure related to the present invention and does not constitute a limitation on the computer device to which the present invention is applied. A specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0152] The processor 402 is used to run the computer program 4032 stored in the memory to implement the above-described material document management method.
[0153] It should be understood that, in this embodiment of the invention, the processor 402 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0154] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program includes program instructions and can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.
[0155] Therefore, the present invention also provides a computer-readable storage medium. This computer-readable storage medium stores a computer program, wherein the computer program includes program instructions. When executed by a processor, the program instructions cause the processor to perform the above-described material document management method.
[0156] The storage medium can be any computer-readable storage medium that can store program code, such as a USB flash drive, external hard drive, read-only memory (ROM), magnetic disk, or optical disk.
[0157] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0158] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0159] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0160] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0161] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A material document management method, applied to a material document management platform, characterized in that, The material document management platform adopts a four-layer B / S-based architecture, specifically including a presentation layer, a business layer, a tool service layer, and a data storage layer. The controller module in the business layer specifically includes a file controller and a user / settings / material controller. The tool service layer's tool and service modules specifically include a PDF watermarking engine, a file stream manager, and an Office converter. The data storage layer includes a data access and storage module and a file system. The method includes: In response to a material file processing instruction, obtain the current file processing type corresponding to the material file processing instruction; If the current file processing type is determined to be a file upload type, the current file to be uploaded is obtained based on the preset file upload strategy, and the file is written to disk and the material association is processed in sequence to complete the storage of the current file to be uploaded. If the current file processing type is determined to be a two-way traceability type, the current traceability information is obtained based on the preset two-way traceability strategy, and the local file information or material information is traced to obtain the current traceability result. After the step of obtaining the current file processing type corresponding to the material file processing instruction in response to the material file processing instruction, the method further includes: If the current file processing type is determined to be a file download type, then the current file to be downloaded corresponding to the current file download information is obtained based on the preset file download strategy, and the current file to be downloaded is sent to the corresponding requesting end; Specifically, when obtaining the current file to be downloaded corresponding to the current file download information based on the preset file download strategy, the user verification information included in the current file download information is verified through the file download strategy. When it is determined that the user verification information is registered user information and the verification is passed, the current user permission information corresponding to the current file download information is obtained. When the current user permission information is verified, the current file to be downloaded corresponding to the current file download information is obtained from the server's database. Based on the current user permission information, it is determined whether to automatically add a file watermark. If it is determined that an automatic file watermark needs to be added, a watermark is automatically added to each page of the current file to be downloaded. Then, a download stream is generated for the requesting end to download and obtain. The method involves obtaining the current traceability information based on a preset two-way traceability strategy and performing local file or material information traceability to obtain the current traceability result, including: If it is determined that the current traceable information includes file information, then a first SQL statement is generated based on the bidirectional traceability strategy using the file name corresponding to the file information, and a query is performed in the local file and material association table to obtain the current traceability result; the generation of the first SQL statement based on the bidirectional traceability strategy using the file name corresponding to the file information includes: if it is determined that the initial material number has been obtained from the current traceable information through a first preset regular expression, then the underscores in the initial material number are converted into hyphens to obtain the current material number, and the first SQL statement is generated using the current material number as the query condition; the first preset regular expression is [A-Z0-9]+-[A-Z0-9]+|[A-Z0-9]+_[A-Z0-9]+; If it is determined that the current traceability information includes material information, then based on the two-way traceability strategy, the material information is used as the query condition, and a query is performed in the local database to obtain the current traceability result.
2. The method according to claim 1, characterized in that, The process of obtaining the current file to be uploaded based on a preset file upload strategy and sequentially performing file write-to-disk and material association processing to complete the storage of the current file to be uploaded includes: Get the current user's authentication information; If it is determined that the current user's verification information passes the verification, then obtain the current user's permission information; If the current user's permission information is verified, then the file to be uploaded is obtained and added to the waiting queue; If it is determined that the preset upload protection condition of the waiting queue has not been triggered, then the current target directory corresponding to the current file to be uploaded is obtained, and the current file to be uploaded is written to the storage area corresponding to the current target directory; Obtain the current target metadata corresponding to the file to be uploaded in the current target directory, and establish a unique association between the file to be uploaded and the current target metadata.
3. The method according to claim 2, characterized in that, The step of obtaining the current target metadata corresponding to the file to be uploaded in the current target directory and establishing a unique association between the file to be uploaded and the current target metadata includes: Obtain the current file table structure information corresponding to the file to be uploaded, and obtain the current material number from the current file table structure information; Obtain the current target metadata with the current material number, and obtain the current material table structure information corresponding to the current target metadata; Based on the current file table structure information and the current material table structure information, a current file-material association table is constructed to establish a unique association between the current file to be uploaded and the current target metadata.
4. The method according to claim 1, characterized in that, After the step of obtaining the current file processing type corresponding to the material file processing instruction in response to the material file processing instruction, the method further includes: If the current file processing type is determined to be a file viewing type, then the current file viewing information is obtained based on the preset file viewing strategy, and the file is acquired to obtain the current target file.
5. The method according to claim 1, characterized in that, After the step of obtaining the current file processing type corresponding to the material file processing instruction in response to the material file processing instruction, the method further includes: If the current file processing type is determined to be a file approval type, then the current file to be approved is obtained based on the preset file approval strategy and the file is automatically approved to obtain the current file approval result.
6. A material document management device, applied to a material document management platform, characterized in that, The material document management platform adopts a four-layer B / S-based architecture, specifically including a presentation layer, a business layer, a tool service layer, and a data storage layer. The controller module in the business layer specifically includes a file controller and a user / settings / material controller. The tool service layer's tool and service modules specifically include a PDF watermarking engine, a file stream manager, and an Office converter. The data storage layer includes a data access and storage module and a file system. The device includes: The file processing type acquisition unit is used to acquire the current file processing type corresponding to the material file processing instruction in response to the material file processing instruction. The file upload processing unit is used to, if it is determined that the current file processing type is a file upload type, obtain the current file to be uploaded based on a preset file upload strategy and perform file disk storage and material association processing in sequence to complete the storage of the current file to be uploaded. The document bidirectional traceability processing unit is used to obtain the current traceable information based on a preset bidirectional traceability strategy and perform local document information or material information traceability if it is determined that the current document processing type is a bidirectional traceability type, so as to obtain the current traceability result. The material document management device also includes: The file download processing unit is used to, if it is determined that the current file processing type is a file download type, obtain the current file to be downloaded corresponding to the current file download information based on a preset file download strategy, and send the current file to be downloaded to the corresponding requesting end; Specifically, when obtaining the current file to be downloaded corresponding to the current file download information based on the preset file download strategy, the user verification information included in the current file download information is verified through the file download strategy. When it is determined that the user verification information is registered user information and the verification is passed, the current user permission information corresponding to the current file download information is obtained. When the current user permission information is verified, the current file to be downloaded corresponding to the current file download information is obtained from the server's database. Based on the current user permission information, it is determined whether to automatically add a file watermark. If it is determined that an automatic file watermark needs to be added, a watermark is automatically added to each page of the current file to be downloaded. Then, a download stream is generated for the requesting end to download and obtain. The document bidirectional traceability processing unit is specifically used for: If it is determined that the current traceable information includes file information, then a first SQL statement is generated based on the bidirectional traceability strategy using the file name corresponding to the file information, and a query is performed in the local file and material association table to obtain the current traceability result; the generation of the first SQL statement based on the bidirectional traceability strategy using the file name corresponding to the file information includes: if it is determined that the initial material number has been obtained from the current traceable information through a first preset regular expression, then the underscores in the initial material number are converted into hyphens to obtain the current material number, and the first SQL statement is generated using the current material number as the query condition; the first preset regular expression is [A-Z0-9]+-[A-Z0-9]+|[A-Z0-9]+_[A-Z0-9]+; If it is determined that the current traceability information includes material information, then based on the two-way traceability strategy, the material information is used as the query condition, and a query is performed in the local database to obtain the current traceability result.
7. A computer device, characterized in that, The computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the material document management method as described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions, which, when executed by a processor, can implement the material document management method as described in any one of claims 1-5.