An online editing-based document approval method, device, equipment and medium
By deeply embedding online editing and asynchronous write-back operations into the approval node, the problem of the disconnect between editing and submission in the document approval system is solved, enabling real-time editing and submission, improving approval efficiency and user experience, and ensuring the high reliability and compliance of the system.
Patent Information
- Application Number
- CN202611123163.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-27
- Publication Date
- 2026-11-03
AI Technical Summary
In existing technologies, document approval systems cannot achieve real-time editing and submission, resulting in a fragmented user experience and a disjointed approval process, which affects efficiency.
The approval node is deeply embedded with the online editing function. Pre-set third-party plugins enable online editing and saving of files. The status of the approval node is synchronized through asynchronous write-back operations. Combined with a message queue mechanism, data consistency and access control are guaranteed.
It enables instant editing and submission of documents for approval, improving approval efficiency and user experience, ensuring high system reliability and availability, and providing excellent version traceability and compliance audit capabilities.
Smart Images

Figure CN123031671A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computers, and in particular to a document approval method, apparatus, device, and medium based on online editing. Background Technology
[0002] Existing technology employs a simple combination of a "workflow engine" and "attachment upload," whose architecture renders document editing functionality external to the approval process. When approvers need to modify documents, the system lacks built-in editing capabilities, forcing them to perform a series of manual operations: "download → launch local application for editing → save → upload." This series of manual operations is not only cumbersome and time-consuming, but more importantly, it forcibly interrupts the approval process that should be running continuously within the system. The user's attention and focus are forced to switch repeatedly between the browser (approval system) and the local office software. Ultimately, this leads to the core drawbacks of "fragmented user experience" and "artificially fragmented approval process." The automation level of the approval process is disrupted at this point, severely impacting overall efficiency.
[0003] In conclusion, how to achieve real-time editing and submission of documents for approval is a problem that urgently needs to be solved. Summary of the Invention
[0004] In view of this, the purpose of this invention is to provide a document approval method, apparatus, device, and medium based on online editing, capable of enabling real-time editing and submission of documents for approval. The specific solution is as follows: Firstly, this application provides a document approval method based on online editing, applied to a document approval system, including: The form information sent by the first user terminal is parsed to obtain the corresponding approval requirements. A target approval process is created based on the approval requirements. A corresponding task sequence and corresponding task nodes are generated based on the target approval process. The task nodes include file upload nodes and various approval nodes. The first user terminal is the initiator of the creation of the file to be approved. According to the task sequence, the initial file uploaded by the first user client is opened at the file upload node so that the first user client can edit the initial file online to generate an edited file and save it to the file upload node. Then, according to the task sequence, the edited file is submitted to the current approval node. After the file is saved successfully, an asynchronous write-back operation is triggered. The status of the current approval node is synchronized through the asynchronous write-back operation to open the processing permission of the current approval node to the second user terminal, so that the second user terminal can perform approval and online editing operations on the edited file at the current approval node. The approval operation result of the second user terminal is obtained at the current approval node. A new current approval node is determined based on the approval operation result, and the step of triggering asynchronous write-back operation after successful file saving is re-executed until the target approval process is completed.
[0005] Optionally, the step of creating a target approval process based on the approval requirements, and generating a corresponding task sequence and corresponding task nodes based on the target approval process, includes: Create the target approval process based on the approval requirements using a preset workflow engine; Select the target approval terminal based on the target approval process and the preset business process template; Create a task sequence and corresponding task nodes based on the preset business level of the target approval terminal.
[0006] Optionally, before opening the initial file uploaded by the first user client on the file upload node according to the task sequence, the method further includes: Obtain the metadata information of the initial file uploaded by the first user client; A preset uniqueness check operation is performed on the initial file based on the document number and document name in the metadata information; If the verification fails, a corresponding duplicate file notification will be generated and sent to the first user terminal.
[0007] Optionally, the process of opening the initial file uploaded by the first user client on the file upload node according to the task sequence further includes: Establish a communication link between the preset third-party plugin and the document approval system; Based on the process of the first user terminal performing online editing and saving operations on the initial file through the preset third-party plugin, interactive communication is carried out using the communication link; If communication is successful, the communication link is considered to be normal. If communication fails, the communication link is determined to be abnormal, and a corresponding alarm message is generated.
[0008] Optionally, the step of synchronizing the status of the current approval node through the asynchronous write-back operation to grant processing permissions of the current approval node to the second user terminal includes: When an asynchronous write-back operation is triggered, the task node corresponding to the task sequence is set to a temporary transition state based on the message queue mechanism; wherein, the temporary transition state is a temporary locked state of the task, used to restrict operation permissions on the task node and the edited file; During the temporary transition state, obtain the callback information during the asynchronous write-back operation; A Kafka message is created based on the callback information and pushed to a preset message processing queue; Listen for and consume the Kafka messages, and execute the corresponding document data synchronization business processing operations; If the business process is successful, the corresponding record in the preset message processing queue is cleared, and the status of the edited file is written back to the current approval node corresponding to the task sequence to adjust the status of the current approval node corresponding to the task sequence and grant the processing permission of the current approval node. If the business processing fails, the number of failures is counted. When the number of failures is less than a preset threshold, a retry is performed. When the number of failures is greater than or equal to the preset threshold, a corresponding alarm is generated and sent to the second user terminal.
[0009] Optionally, after obtaining the approval operation result from the second user terminal at the current approval node, the method further includes: If the approval process results in a rejection of the edited file, the process returns to the file upload node so that the first user can re-edit and resubmit the file. If the approval operation result indicates that the edited file has passed, then the approved file and its corresponding version number are determined according to the approval operation result, and a new current approval node is determined according to the task sequence. The approved file and its corresponding version number are submitted to the new current approval node, and the asynchronous write-back operation is triggered at the same time.
[0010] Optionally, the step of "until the target approval process is completed" includes: Monitor the execution progress of the target approval process; Based on the execution progress of the target approval process, determine whether there are any unexecuted task nodes; If there are no unexecuted task nodes, the target approval process is deemed to have been completed. If there are unexecuted task nodes, the asynchronous write-back operation triggered after the file is successfully saved will continue to be executed. The asynchronous write-back operation is based on a message queue mechanism to synchronize the status of the edited file with the current approval node in the task sequence, so as to open the processing permission of the current approval node to the second user terminal.
[0011] Secondly, this application provides a document approval device based on online editing, applied to a document approval system, comprising: The process determination module is used to parse the form information sent by the first user terminal to obtain the corresponding approval requirements, create a target approval process based on the approval requirements, and generate a corresponding task sequence and corresponding task nodes based on the target approval process; the task nodes include file upload nodes and various approval nodes, and the first user terminal is the initiator of the creation of the file to be approved; The file editing module is used to open the initial file uploaded by the first user terminal at the file upload node according to the task sequence, so that the first user terminal can edit the initial file online to generate an edited file and save it to the file upload node. Then, the edited file is submitted to the current approval node according to the task sequence. The file approval module is used to trigger an asynchronous write-back operation after the file is successfully saved. The asynchronous write-back operation synchronizes the status of the current approval node to open the processing permissions of the current approval node to the second user terminal, so that the second user terminal can approve and edit the edited file online at the current approval node. The approval result acquisition module is used to acquire the approval operation result of the second user terminal at the current approval node, determine a new current approval node based on the approval operation result, and re-execute the step of triggering asynchronous write-back operation after the file is successfully saved, until the target approval process is completed.
[0012] Thirdly, this application provides an electronic device, comprising: Memory, used to store computer programs; A processor is used to execute the computer program to implement the online editing-based document approval method as described above.
[0013] Fourthly, this application provides a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned document approval method based on online editing.
[0014] In summary, this application parses the form information sent by the first user terminal to obtain the corresponding approval requirements, creates a target approval process based on the approval requirements, and generates a corresponding task sequence and task nodes based on the target approval process. The task nodes include file upload nodes and various approval nodes. The first user terminal is the initiator of creating the file to be approved. According to the task sequence, the initial file uploaded by the first user terminal is opened at the file upload node so that the first user terminal can edit the initial file online to generate an edited file and save it to the file upload node. Then, according to the task sequence, the edited file is submitted to the current approval node. After the file is successfully saved, an asynchronous write-back operation is triggered to synchronize the status of the current approval node, so as to open the processing permission of the current approval node to the second user terminal, so that the second user terminal can perform approval and online editing operations on the edited file at the current approval node. The approval operation result of the second user terminal is obtained at the current approval node, a new current approval node is determined based on the approval operation result, and the step of triggering the asynchronous write-back operation after the file is successfully saved is re-executed until the target approval process is completed. As described above, this application obtains form information submitted by users based on approval requirements, parses the form information to obtain the approval requirements, creates a target approval process, and generates a corresponding task sequence and task nodes including file upload nodes and each approval node. Then, based on the task sequence, it obtains the initial file uploaded by the user at the file upload node, uses a pre-set third-party plugin for online editing to generate and save the edited file, and submits the edited file to the current approval node. After successful file saving, an asynchronous write-back operation is triggered. Based on a message queue mechanism, the status of the edited file and the current approval node in the task sequence is synchronized to grant the approver processing permissions for that approval node, enabling them to approve and edit online. Then, the approval operation result of the approver is obtained at the current approval node, the node corresponding to the new approver is determined, and the above asynchronous write-back and permission granting steps are repeated until the target approval process is completed. In this way, online editing is deeply embedded in the approval node architecture, allowing users to complete editing and submission without switching between multiple applications. This fundamentally solves the problems of cumbersome operations and fragmented processes, bringing significant improvements in approval efficiency and a smoother user experience. Furthermore, by adopting a reliable processing chain of "asynchronous callback-message queue-process driven" and supplemented by retry and alarm mechanisms, this effectively ensures that the document status and approval status can eventually remain consistent in a distributed environment, thereby solving the high risk of data inconsistency in existing technologies and forming the core advantages of high system reliability and high availability.Meanwhile, by introducing an automated version management model that is strongly linked to approval nodes, the system can automatically and accurately record the evolution of each version. This directly overcomes the technical shortcomings of version chaos and difficulty in auditing and tracing, and ultimately endows it with excellent version traceability and compliance auditing capabilities. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0016] Figure 1 This application discloses a flowchart of a document approval method based on online editing. Figure 2 This application discloses a specific document approval method based on online editing. Figure 3 This is a schematic diagram of a document approval device based on online editing disclosed in this application; Figure 4 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation
[0017] 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 embodiments of the present invention, and not all embodiments. 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.
[0018] Currently, existing technologies employ a simple combination of a "workflow engine" and "attachment upload," whose architecture renders document editing functionality external to the approval process. When approvers need to modify documents, the system lacks built-in editing capabilities, forcing them to perform a series of manual operations: "download → launch local application for editing → save → upload." This series of manual operations is not only cumbersome and time-consuming, but more importantly, it forcibly interrupts the approval process that should be running continuously within the system. The user's attention and focus are forced to switch repeatedly between the browser (approval system) and local office software. Ultimately, this leads to the core drawbacks of "fragmented user experience" and "artificially fragmented approval process." The automation level of the approval process is disrupted at this point, severely impacting overall efficiency. To address the aforementioned technical problems, this application discloses a document approval method, apparatus, device, and medium based on online editing, enabling real-time editing and submission of documents for approval.
[0019] See Figure 1 As shown, this embodiment of the invention discloses a document approval method based on online editing, applied to a document approval system, including: Step S11: Parse the form information sent by the first user terminal to obtain the corresponding approval requirements, create a target approval process based on the approval requirements, and generate a corresponding task sequence and corresponding task nodes based on the target approval process; the task nodes include file upload nodes and various approval nodes, and the first user terminal is the initiator of creating the file to be approved.
[0020] In this embodiment, the document approval system provides a fixed form interface. The first user, acting as the initiator of the document to be approved, first encounters this fixed form interface. This interface has several preset input areas. The user fills in the corresponding content according to their approval needs, forming a complete form and sending it to the system. The system also verifies the completeness of the form information to ensure the user has filled it out completely. Upon receiving the form information, the system parses and processes it to extract the approval needs expressed by the first user, such as the required approval levels, the approval order, and whether supplementary documents are needed.
[0021] Next, a target approval process is created using a preset workflow engine based on the approval requirements. A target approval endpoint is selected based on the target approval process and a preset business process template. A task sequence and corresponding task nodes are created based on the preset business level of the target approval endpoint. Specifically, a corresponding target approval process is dynamically created based on these parsed approval requirements. This process is not an abstract concept, but is further transformed into an executable task sequence, with each task sequence subdivided into several specific task nodes. These task nodes include file upload nodes for the first user to submit the original file to be approved, as well as multiple approval nodes or file translation nodes added according to user needs, corresponding to the processing position of each approval stage in the process. In this way, the user's form information is transformed into a structured approval execution path.
[0022] Step S12: Open the initial file uploaded by the first user terminal at the file upload node according to the task sequence, so that the first user terminal can edit the initial file online to generate an edited file and save it to the file upload node. Then, submit the edited file to the current approval node according to the task sequence.
[0023] In this embodiment, based on the generated task sequence, the system waits for the first user's operation at the file upload node. After the first user uploads the initial file, the system immediately retrieves the initial file and calls a preset third-party plugin to open it. This plugin provides online editing functionality, allowing the first user to modify, annotate, or supplement the file content directly in a browser or system interface without downloading the file locally. It's important to note that during file editing, a communication link is established between the preset third-party plugin and the file approval system. This communication link facilitates interactive communication based on the first user's online editing and saving of the initial file through the preset third-party plugin. If communication is successful, the communication link is considered normal; if communication fails, the communication link is considered abnormal, and a corresponding alarm is generated. Specifically, during online file editing, the system needs to establish a communication link between the preset third-party plugin and the file approval system. This link supports the interactive needs of the first user when performing editing and saving operations on the initial file within the plugin. When a user modifies file content through a plugin and triggers a save action, the plugin uses the established communication link to exchange data with the backend system. This includes synchronizing editing status, transferring temporarily saved file fragments, or confirming save commands. If this interaction completes successfully, the system determines that the communication link is in normal condition, and the editing operation can continue. Conversely, if the communication link is interrupted, times out, or returns an error response during the interaction, the system determines that the communication link is abnormal. In this case, the system will immediately generate a corresponding alarm message and push this message to the first user's client, informing the user that the connection between the current editing environment and the approval system has failed and that the network needs to be checked or the plugin reloaded.
[0024] Simultaneously, after the system retrieves the initial file, it obtains the metadata information of the initial file uploaded by the first user client. Based on the document number and document name in the metadata information, it performs a preset uniqueness check on the initial file. If the check fails, a corresponding file duplication warning is generated and sent to the first user client. Specifically, the uniqueness check during file creation does not rely solely on a single field like document number or document name, but rather on a comprehensive judgment based on a combination of three dimensions: "file number, file name, and country of origin." The check passes only if the combination of these three dimensions does not already exist in the system's existing records; otherwise, if a file with the same file number, file name, and belonging to the same country already exists in the system, the check fails. Once the check fails, the system automatically generates a corresponding file duplication warning, clearly informing the user that the currently uploaded file conflicts with an existing file in three key dimensions, and sends this warning to the first user client so that the user can promptly understand the situation and take appropriate action, such as modifying the document number or adjusting the document name.
[0025] After editing the file, the system saves the edited file back to the current file upload node to ensure the file version is updated. Then, following the defined workflow in the task sequence, the system automatically submits the edited file to the current approval node, initiating the subsequent approval process. Throughout this process, the file upload node not only receives the original file and stores the edited file, but also acts as a bridge between the editing and approval stages, allowing the file to flow smoothly from the creation end to the approval end.
[0026] Step S13: After the file is successfully saved, an asynchronous write-back operation is triggered. The status of the current approval node is synchronized through the asynchronous write-back operation to open the processing permission of the current approval node to the second user terminal, so that the second user terminal can perform approval and online editing operations on the edited file at the current approval node.
[0027] In this embodiment, when an asynchronous write-back operation is triggered after a file is successfully saved, the task node corresponding to the task sequence is set to a temporary transition state based on a message queue mechanism. This temporary transition state is a temporary locked state for the task, used to restrict operation permissions on the task node and the edited file. In the temporary transition state, callback information for the asynchronous write-back operation is obtained. A Kafka message is created based on the callback information and pushed to a preset message processing queue. The Kafka message is listened to and consumed, and the corresponding document data synchronization business processing operation is executed. If the business processing is successful, the corresponding record in the preset message processing queue is cleared, and the status of the edited file is written back to the current approval node corresponding to the task sequence to adjust the status of the current approval node and grant processing permissions to the current approval node. If the business processing fails, the number of failures is counted. When the number of failures is less than a preset threshold, a retry is performed. When the number of failures is greater than or equal to the preset threshold, a corresponding alarm is generated and sent to the second user terminal. Specifically, after a file is successfully saved, the corresponding task node in the task sequence is set to a temporary transition state. This transition state is essentially a temporary locked state, designed to restrict other users' or operations from accessing the task node and the edited file, preventing data loss or anomalies caused by concurrent operations before the file is fully updated. Upon entering the temporary transition state, the system retrieves callback information generated during the asynchronous write-back operation and creates Kafka messages based on these callbacks, then pushes them to a preset message processing queue. The system listens for and consumes these Kafka messages, executing the corresponding document data synchronization business processing. If the business processing is successful, the system clears the corresponding record in the preset message processing queue and writes the status of the edited file back to the current approval node in the task sequence, thereby adjusting the status of that current approval node and granting it processing permissions, allowing the process to continue. If the business processing fails, the system counts the number of failures; when the number of failures is less than a preset threshold, a retry is performed; when the number of failures reaches or exceeds the preset threshold, a corresponding alarm is generated and sent to a second user client for timely intervention.
[0028] Step S14: Obtain the approval operation result of the second user terminal at the current approval node, determine a new current approval node based on the approval operation result, and re-execute the step of triggering asynchronous write-back operation after the file is successfully saved, until the target approval process is completed.
[0029] In this embodiment, after the current approval node receives the approval operation result submitted by the second user, the system determines a new current approval node based on the result. If the approval operation result indicates that the edited file is rejected, the system returns to the file upload node so that the first user can re-edit and resubmit the file. If the approval operation result indicates that the edited file is approved, the system determines the approved file and its corresponding version number based on the approval operation result, determines a new current approval node based on the task sequence, submits the approved file and its corresponding version number to the new current approval node, and triggers the asynchronous write-back operation. Specifically, after the current approval node receives the approval operation result submitted by the second user, the system determines the subsequent process based on the result. If the user at the approval end rejects the edited file, the process returns to the initial file upload node so that the first user can re-edit the file based on the rejection and resubmit it, thereby restarting the subsequent approval process. If the approval operation result indicates that the edited file is approved, the system determines the approved file and its corresponding version number based on the approval result. The version number is usually incremented to mark the official version status of the file.
[0030] It's important to understand that when the task at the current approval node is completed, the execution progress of the target approval process is monitored. Based on the execution progress of the target approval process, it is determined whether there are any unexecuted task nodes. If no unexecuted task nodes are found, the target approval process is considered complete. If unexecuted task nodes exist, the asynchronous write-back operation triggered after successful file saving continues. This asynchronous write-back operation, based on a message queue mechanism, synchronizes the status of the edited file with the current approval node in the task sequence, thereby granting the second user client processing permissions for the current approval node. Specifically, when the task at the current approval node is completed, the system synchronously monitors the overall execution progress of the target approval process. If, after checking, it is found that all nodes have been completed, the target approval process is considered officially ended, and the entire approval process is complete. Conversely, if there are still unexecuted task nodes, the next approval node is determined according to the task sequence, and the approved file, along with its corresponding version number, is submitted to this new approval node.
[0031] As described above, this application embodiment obtains form information submitted by the user based on approval requirements. After parsing the form information to obtain the approval requirements, it creates a target approval process and generates a corresponding task sequence, including task nodes containing file upload nodes and each approval node. Then, according to the task sequence, it obtains the initial file uploaded by the user at the file upload node, uses a preset third-party plugin for the user to edit online to generate an edited file, and saves it. The edited file is then submitted to the current approval node. After the file is successfully saved, an asynchronous write-back operation is triggered. Based on a message queue mechanism, the status of the edited file and the current approval node in the task sequence is synchronized to grant the approver the processing permission for that approval node so that they can perform approval and online editing. Afterwards, the approval operation result of the approver is obtained at the current approval node, the node corresponding to the new approver is determined, and the above asynchronous write-back and permission granting steps are repeated until the target approval process is completed. In this way, the architecture of deeply embedding online editing into the approval node allows users to complete editing and submission without switching between multiple applications, thereby fundamentally solving the problems of cumbersome operation and fragmented process, bringing the advantages of significantly improved approval efficiency and a smoother user experience. Furthermore, by employing asynchronous callbacks supplemented by retry and alert mechanisms, this effectively ensures that the document status and approval status remain consistent in a distributed environment, thereby resolving the high risk of data inconsistency in existing technologies and forming the core advantages of high system reliability and high availability. Simultaneously, by introducing an automated version management model strongly correlated with approval nodes, the system can automatically and accurately record the evolution of each version. This directly overcomes the technical shortcomings of version chaos and difficulty in audit tracing, ultimately endowing it with superior version traceability and compliance auditing capabilities.
[0032] As can be seen from the previous embodiment, this application discloses a document approval method based on online editing, which enables real-time editing and submission of documents for approval. Next, taking a company's contract approval process as an example, regarding... Figure 2 The document approval method based on online editing is explained in detail.
[0033] Suppose the first user is a sales department employee who needs to initiate the approval of a sales contract. They first fill in relevant information on a fixed form provided by the document approval system, such as the contract type, amount, counterparty company name, and desired approval stages, such as department head review, legal review, and financial review. After parsing this form information, the system automatically creates a target approval process that meets the requirements of the sales contract and generates a corresponding task sequence, including a document upload node and multiple subsequent approval nodes.
[0034] Sales personnel upload the initial draft contract at the file upload node. The system then opens the file using a pre-defined third-party online editing plugin. Sales personnel can directly modify the contract content, add clauses, or adjust the format within the plugin. After completing the online editing, the file is saved, and the resulting edited file remains at the file upload node. Following the task sequence, the system submits this edited contract file to the first current approval node, i.e., the department head's pending tasks. Simultaneously with successful file saving, the system triggers an asynchronous write-back operation, using a message queue to synchronize the status of the edited file with the current approval node and granting the department head processing permissions.
[0035] After logging into the system, the department head can view the contract document at the current node and approve and further edit it online, such as adding annotations or modifying amounts. Once the head approves it ("Approved"), the system determines the new current approval node—the legal review node. An asynchronous write-back operation is then performed again, synchronizing the file's status with the legal node via a message queue and granting processing permissions to legal personnel. If legal personnel reject the application after review, the system will return the process to the file upload node, allowing the sales staff to re-edit and resubmit. If the legal review is approved, the process continues to the financial review node. After each node is completed, the system monitors for any unexecuted task nodes until all approval nodes are completed, at which point the entire contract approval process ends.
[0036] See Figure 3 As shown, this embodiment of the invention discloses a document approval device based on online editing, applied to a document approval system, comprising: The process determination module 11 is used to parse the form information sent by the first user terminal to obtain the corresponding approval requirements, create a target approval process according to the approval requirements, and generate a corresponding task sequence and corresponding task nodes based on the target approval process; the task nodes include file upload nodes and various approval nodes, and the first user terminal is the initiator of the creation of the file to be approved. The file editing module 12 is used to open the initial file uploaded by the first user terminal at the file upload node according to the task sequence, so that the first user terminal can edit the initial file online to generate an edited file and save it to the file upload node. Then, the edited file is submitted to the current approval node according to the task sequence. The file approval module 13 is used to trigger an asynchronous write-back operation after the file is successfully saved. The asynchronous write-back operation synchronizes the status of the current approval node to open the processing permission of the current approval node to the second user terminal, so that the second user terminal can perform approval and online editing operations on the edited file at the current approval node. The approval result acquisition module 14 is used to acquire the approval operation result of the second user terminal at the current approval node, determine a new current approval node based on the approval operation result, and re-execute the step of triggering asynchronous write-back operation after the file is successfully saved, until the target approval process is completed.
[0037] As described above, this application obtains form information submitted by users based on approval requirements, parses the form information to obtain the approval requirements, creates a target approval process, and generates a corresponding task sequence and task nodes including file upload nodes and each approval node. Then, based on the task sequence, it obtains the initial file uploaded by the user at the file upload node, uses a pre-set third-party plugin for online editing to generate and save the edited file, and submits the edited file to the current approval node. After successful file saving, an asynchronous write-back operation is triggered. Based on a message queue mechanism, the status of the edited file and the current approval node in the task sequence is synchronized to grant the approver processing permissions for that approval node, enabling them to approve and edit online. Then, the approval operation result of the approver is obtained at the current approval node, the node corresponding to the new approver is determined, and the above asynchronous write-back and permission granting steps are repeated until the target approval process is completed. In this way, online editing is deeply embedded in the approval node architecture, allowing users to complete editing and submission without switching between multiple applications. This fundamentally solves the problems of cumbersome operations and fragmented processes, bringing significant improvements in approval efficiency and a smoother user experience. Furthermore, by employing a reliable processing chain of "asynchronous callback - message queue - process-driven," supplemented by retry and alarm mechanisms, this effectively ensures that document status and approval status remain consistent in a distributed environment. This resolves the high risk of data inconsistency in existing technologies, forming the core advantages of high system reliability and high availability. Simultaneously, by introducing an automated version management model strongly correlated with approval nodes, the system can automatically and accurately record the evolution of each version. This directly overcomes the technical shortcomings of version chaos and difficulty in audit tracing, ultimately endowing the system with superior version traceability and compliance auditing capabilities.
[0038] In some specific implementations, the process determination module 11 includes: The process creation unit is used to create a target approval process based on the approval requirements using a preset workflow engine. The approval terminal selection unit is used to select the target approval terminal based on the target approval process and the preset business process template; The sequence and node creation unit is used to create task sequences and corresponding task nodes according to the preset business level of the target approval terminal.
[0039] In some specific embodiments, the online editing-based document approval device further includes: The information acquisition module is used to acquire the metadata information of the initial file uploaded by the first user terminal; The file verification module is used to perform a preset uniqueness verification operation on the initial file based on the document number and document name of the metadata information; The prompt generation module is used to generate a corresponding file duplicate prompt if the verification fails, and send it to the first user terminal.
[0040] In some specific embodiments, the online editing-based document approval device further includes: The link establishment module is used to establish a communication link between the preset third-party plugin and the document approval system. An interactive communication module is used to perform interactive communication using the communication link based on the process of the first user terminal performing online editing and saving operations on the initial file through the preset third-party plugin; The first link determination module is used to determine that the communication link is normal if the communication is successful. The second link determination module is used to determine that the communication link is abnormal if communication fails, and to generate a corresponding alarm message.
[0041] In some specific implementations, the approval result acquisition module 14 includes: A state setting unit is used to set the task node corresponding to the task sequence to a temporary transition state based on a message queue mechanism when an asynchronous write-back operation is triggered; wherein, the temporary transition state is a temporary locked state of the task, used to restrict operation permissions on the task node and the edited file; The callback information acquisition unit is used to acquire callback information during the asynchronous write-back operation in the temporary transition state. The message push unit is used to create a Kafka message based on the callback information and push it to a preset message processing queue; The message consumption unit is used to listen for and consume the Kafka messages and execute the corresponding document data synchronization business processing operations. The first business processing unit is used to clear the corresponding record in the preset message processing queue if the business processing is successful, and write back the status of the edited file to the current approval node corresponding to the task sequence, so as to adjust the status of the current approval node corresponding to the task sequence and open the processing permission of the current approval node. The second business processing unit is used to count the number of failures if the business processing fails, perform retry processing when the number of failures is less than a preset threshold, and generate a corresponding alarm prompt when the number of failures is greater than or equal to the preset threshold, and send the alarm prompt to the second user terminal.
[0042] In some specific embodiments, the online editing-based document approval device further includes: The resubmit module is used to return to the file upload node if the approval operation result indicates that the edited file is rejected, so that the first user terminal can re-edit and resubmit the file. The file submission module is used to determine the approved file and its corresponding version number based on the approval operation result if the approval operation result indicates that the edited file has passed, and to determine a new current approval node based on the task sequence, and submit the approved file and its corresponding version number to the new current approval node, while triggering the asynchronous write-back operation.
[0043] In some specific implementations, the approval result acquisition module 14 includes: A progress monitoring unit is used to monitor the execution progress of the target approval process; The task node determination unit is used to determine whether there are any unexecuted task nodes based on the execution progress of the target approval process; The first task node determination unit is used to determine that the target approval process has been completed if there are no unexecuted task nodes. The second task node determination unit is used to continue executing the step of triggering an asynchronous write-back operation after the file is successfully saved if there are unexecuted task nodes. The asynchronous write-back operation is based on a message queue mechanism to synchronize the status of the edited file with the current approval node in the task sequence, so as to open the processing permission of the current approval node to the second user terminal.
[0044] Furthermore, embodiments of this application also disclose an electronic device, Figure 4 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the online editing-based document approval method disclosed in any of the foregoing embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0045] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0046] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0047] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the online editing-based document approval method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs capable of performing other specific tasks.
[0048] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned online editing-based document approval method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0049] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0050] Those skilled in the art will further 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 implementation should not be considered beyond the scope of this application.
[0051] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0052] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0053] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A document approval method based on online editing, characterized in that, Applied to document approval systems, including: The form information sent by the first user terminal is parsed to obtain the corresponding approval requirements. A target approval process is created based on the approval requirements. A corresponding task sequence and corresponding task nodes are generated based on the target approval process. The task nodes include file upload nodes and various approval nodes. The first user terminal is the initiator of the creation of the file to be approved. According to the task sequence, the initial file uploaded by the first user client is opened at the file upload node so that the first user client can edit the initial file online to generate an edited file and save it to the file upload node. Then, according to the task sequence, the edited file is submitted to the current approval node. After the file is saved successfully, an asynchronous write-back operation is triggered. The status of the current approval node is synchronized through the asynchronous write-back operation to open the processing permission of the current approval node to the second user terminal, so that the second user terminal can perform approval and online editing operations on the edited file at the current approval node. The approval operation result of the second user terminal is obtained at the current approval node. A new current approval node is determined based on the approval operation result, and the step of triggering asynchronous write-back operation after successful file saving is re-executed until the target approval process is completed.
2. The document approval method based on online editing according to claim 1, characterized in that, The step of creating a target approval process based on the approval requirements, and generating a corresponding task sequence and corresponding task nodes based on the target approval process, includes: Create the target approval process based on the approval requirements using a preset workflow engine; Select the target approval terminal based on the target approval process and the preset business process template; Create a task sequence and corresponding task nodes based on the preset business level of the target approval terminal.
3. The document approval method based on online editing according to claim 1, characterized in that, Before opening the initial file uploaded by the first user client on the file upload node according to the task sequence, the method further includes: Obtain the metadata information of the initial file uploaded by the first user client; A preset uniqueness check operation is performed on the initial file based on the document number and document name in the metadata information; If the verification fails, a corresponding duplicate file notification will be generated and sent to the first user terminal.
4. The document approval method based on online editing according to claim 1, characterized in that, The process of opening the initial file uploaded by the first user client at the file upload node according to the task sequence further includes: Establish a communication link between the preset third-party plugin and the document approval system; Based on the process of the first user terminal performing online editing and saving operations on the initial file through the preset third-party plugin, interactive communication is carried out using the communication link; If communication is successful, the communication link is considered to be normal. If communication fails, the communication link is determined to be abnormal, and a corresponding alarm message is generated.
5. The document approval method based on online editing according to claim 1, characterized in that, The step of synchronizing the status of the current approval node through the asynchronous write-back operation to grant processing permissions of the current approval node to the second user terminal includes: When an asynchronous write-back operation is triggered, the task node corresponding to the task sequence is set to a temporary transition state based on the message queue mechanism; wherein, the temporary transition state is a temporary locked state of the task, used to restrict operation permissions on the task node and the edited file; During the temporary transition state, obtain the callback information during the asynchronous write-back operation; A Kafka message is created based on the callback information and pushed to a preset message processing queue; Listen for and consume the Kafka messages, and execute the corresponding document data synchronization business processing operations; If the business process is successful, the corresponding record in the preset message processing queue is cleared, and the status of the edited file is written back to the current approval node corresponding to the task sequence to adjust the status of the current approval node corresponding to the task sequence and grant the processing permission of the current approval node. If the business processing fails, the number of failures is counted. When the number of failures is less than a preset threshold, a retry is performed. When the number of failures is greater than or equal to the preset threshold, a corresponding alarm is generated and sent to the second user terminal.
6. The document approval method based on online editing according to claim 1, characterized in that, After obtaining the approval operation result from the second user terminal at the current approval node, the process further includes: If the approval process results in a rejection of the edited file, the process returns to the file upload node so that the first user can re-edit and resubmit the file. If the approval operation result indicates that the edited file has passed, then the approved file and its corresponding version number are determined according to the approval operation result, and a new current approval node is determined according to the task sequence. The approved file and its corresponding version number are submitted to the new current approval node, and the asynchronous write-back operation is triggered at the same time.
7. The document approval method based on online editing according to claim 5, characterized in that, The process until the target approval process is completed includes: Monitor the execution progress of the target approval process; Based on the execution progress of the target approval process, determine whether there are any unexecuted task nodes; If there are no unexecuted task nodes, the target approval process is deemed to have been completed. If there are unexecuted task nodes, the asynchronous write-back operation triggered after the file is successfully saved will continue to be executed. The asynchronous write-back operation is based on a message queue mechanism to synchronize the status of the edited file with the current approval node in the task sequence, so as to open the processing permission of the current approval node to the second user terminal.
8. A document approval device based on online editing, characterized in that, Applied to document approval systems, including: The process determination module is used to parse the form information sent by the first user terminal to obtain the corresponding approval requirements, create a target approval process based on the approval requirements, and generate a corresponding task sequence and corresponding task nodes based on the target approval process; the task nodes include file upload nodes and various approval nodes, and the first user terminal is the initiator of the creation of the file to be approved; The file editing module is used to open the initial file uploaded by the first user terminal at the file upload node according to the task sequence, so that the first user terminal can edit the initial file online to generate an edited file and save it to the file upload node. Then, the edited file is submitted to the current approval node according to the task sequence. The file approval module is used to trigger an asynchronous write-back operation after the file is successfully saved. The asynchronous write-back operation synchronizes the status of the current approval node to open the processing permissions of the current approval node to the second user terminal, so that the second user terminal can approve and edit the edited file online at the current approval node. The approval result acquisition module is used to acquire the approval operation result of the second user terminal at the current approval node, determine a new current approval node based on the approval operation result, and re-execute the step of triggering asynchronous write-back operation after the file is successfully saved, until the target approval process is completed.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the online editing-based document approval method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, Used to store computer programs; wherein, when the computer programs are executed by a processor, they implement the online editing-based document approval method as described in any one of claims 1 to 7.
