A batch online signature method, device, equipment and storage medium

CN121116936BActive Publication Date: 2026-10-13BEIJING ANZHENGTONG INFORMATION TECH HLDG CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511290442.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-10
Publication Date
2026-10-13
Estimated Expiration
2045-09-10

AI Technical Summary

Technical Problem

[0002]现有多人批量在线签章流程中,多个用户同时触发“保存”时,签署服务会收到多条保存请求,后完成的请求会覆盖先完成的签章文件(例如B的签章文件覆盖A的,N的覆盖B的),最终无法得到包含所有用户签章的文档;为避免覆盖,需强制按业务流程指定签章顺序,前一用户完成签章后,需通知下一用户,下一用户才能打开文件签章(即“串行签章”)

Benefits of technology

本申请实施例提供的批量在线签章方法,支持多人打开同一份目标文件进行签章,无需用户等待业务签章顺序,有效节省签章时间;且用户仅需关注自身所需的盖章位置,无需关心其他用户是否已签章,整体优化了多人在线签章体验。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121116936B_ABST
    Figure CN121116936B_ABST
Patent Text Reader

Abstract

The present application relates to the field of data processing, and discloses a batch online signing method, device, equipment and storage medium.The method comprises the following steps: receiving online signing requests initiated by multiple users for a target file, wherein the online signing request comprises electronic seal data, signing position information and request timestamp; each online signing request competes for a distributed lock bound with the target file, and the online signing request that competes for the distributed lock is taken as a target signing request; the latest version of the target file is obtained, and the latest version of the target file is taken as a file to be signed; the file to be signed is processed according to the electronic seal data and the signing position information in the target signing request, and a temporary file and a digital signature are generated; the digital signature is added to the temporary file to generate a signed file, the signed file is fed back to the corresponding target user, and the distributed lock is released.The present application saves the signing time of the user and improves the signing experience of the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing, and in particular to a method, apparatus, device, and storage medium for batch online signing. Background Technology

[0002] In the existing multi-user batch online signing process, when multiple users trigger "save" simultaneously, the signing service receives multiple save requests. The later completed request will overwrite the earlier signed file (for example, B's signed file overwrites A's, and N's overwrites B's), ultimately failing to obtain a document containing all users' signatures. To avoid overwriting, it is necessary to force the signing order to be specified according to the business process. After the previous user completes the signing, the next user must be notified before the next user can open the file for signing (i.e., "serial signing").

[0003] However, the above solution has certain drawbacks, namely, long waiting time and low efficiency when retaining signatures from multiple users. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to overcome the shortcomings of the prior art and provide a batch online signing method, apparatus, device and storage medium.

[0005] This invention provides the following technical solution: In a first aspect, the present invention provides a method for batch online signing, the method comprising: S1: Receive multiple online signature requests initiated by users for the target document. The online signature request includes electronic seal data, signature location information and request timestamp. S2: Each of the online signing requests competes for the distributed lock bound to the target file, and the online signing request that wins the competition for the distributed lock is taken as the target signing request; S3: Obtain the latest version of the target file, use the latest version of the target file as the file to be signed, process the file to be signed according to the electronic seal data and signature position information in the target signature request, and generate a temporary file and a digital signature; S4: Add the digital signature to the temporary file, generate a signed file, send the signed file back to the corresponding target user, and release the distributed lock.

[0006] In an optional implementation, each of the online signing requests competes for a distributed lock bound to the target file, and the online signing request that wins the distributed lock is taken as the target signing request, including: Each of the online signing requests is saved to a signing file queue associated with the unique code of the target file, and the online signing requests in the signing file queue are sorted according to the request timestamp; Each online signing request in the signing document queue competes for the distributed lock bound to the unique code. The online signing request that wins the competition for the distributed lock is taken as the target signing request, the state of the distributed lock is determined to be locked, and the online signing requests that do not win the competition for the distributed lock are taken as signing requests to be executed.

[0007] In an optional implementation, the step of processing the document to be signed based on the electronic seal data and signature location information in the target signature request to generate a temporary document and a digital signature includes: The electronic seal data in the target signature request is added to the file to be signed according to the signature position information in the target signature request, thereby generating the temporary file; A digest operation is performed on the temporary file to obtain digest data. Using the target user's private key, a signature operation is performed on the digest data, the electronic seal data of the target signature request, the signature location information, and the request timestamp to generate the digital signature.

[0008] In an optional implementation, after generating the signed document, the process further includes: Obtain the version number of the signed document, and add a preset value to the current value of the version number of the signed document to obtain the latest version of the signed document.

[0009] In an optional implementation, after releasing the distributed lock, the method further includes: S5: When the state of the distributed lock changes from locked to released, the remaining online signing requests in the signing document queue compete for the distributed lock again, and S2~S4 are repeated until there are no remaining online signing requests in the signing document queue.

[0010] In an optional implementation, the method further includes: Detect whether the request timestamp of the online signing request in the signed document queue exceeds the preset valid duration; When there is an expired signing request in the signing document queue whose request timestamp exceeds the preset valid duration, the expired signing request is removed from the signing document queue, an expiration message is generated, and the expiration message is sent back to the corresponding user.

[0011] In an optional implementation, the method further includes: When an abnormal signing request exists in the signing document queue, the abnormal signing request is removed from the signing document queue, an abnormal message is generated, and the abnormal message is sent back to the corresponding user.

[0012] Secondly, the present invention provides a batch online signing device, the device comprising: The receiving module is used to receive multiple online signing requests initiated by users for a target file. The online signing requests include electronic seal data, signing location information and request timestamp. The competition module is used for each of the online signing requests to compete for the distributed lock bound to the target file, and the online signing request that wins the competition for the distributed lock is used as the target signing request; The processing module is used to obtain the latest version of the target file, use the latest version of the target file as the file to be signed, process the file to be signed according to the electronic seal data and signature position information in the target signature request, and generate a temporary file and a digital signature. The generation module is used to add the digital signature to the temporary file, generate a signed file, send the signed file back to the corresponding target user, and release the distributed lock.

[0013] Thirdly, this disclosure provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the batch online signing method described in the first aspect.

[0014] Fourthly, this disclosure provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the batch online signing method described in the first aspect.

[0015] The beneficial effects of this application are: The batch online signing method provided in this application embodiment supports multiple people to open the same target document for signing, without requiring users to wait for the business signing order, effectively saving signing time; and users only need to focus on the stamping position they need, without needing to care whether other users have already signed, thus optimizing the overall experience of multi-person online signing.

[0016] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort. In the various drawings, similar components are numbered similarly.

[0018] Figure 1 A flowchart of a batch online signing method provided in an embodiment of this application is shown; Figure 2 This illustration shows a schematic diagram of a batch online signature device provided in an embodiment of this application; Figure 3 A schematic diagram of the structure of a computer device provided in an embodiment of this application is shown. Detailed Implementation

[0019] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0020] It should be noted that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the template description is for the purpose of describing particular embodiments only and is not intended to limit the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0022] Example 1 In existing technology, the process for implementing multi-user online signing of electronic documents is as follows: User A, User B, and User N simultaneously initiate online electronic signing requests for an electronic document with the same document number. After all three users' requests are successfully sent, the electronic document is opened in a browser. The three users add their electronic seals to the electronic document and then save it. When all three users' file saving operations are triggered simultaneously, the signing service receives three save requests. The completion of any one of these three save requests will overwrite the previously saved signed document, thus preventing the creation of a document bearing the electronic seals of users A, B, and N. To prevent the signed document from being overwritten or lost, the stamping order must be set when multiple users sign the same document. Each user participating in the signing process performs the electronic signing according to the workflow sequence. After one user completes their signing, the next user is notified, and only then can the next user open the document to sign.

[0023] To help users sign documents more quickly and conveniently, the system has been updated to expedite the signing process in situations involving multiple signatures, expert review and multi-signature meetings, and multiple signatures during bidding and evaluation. Users only need to focus on their own signing process, eliminating the need to wait in order and saving them significant time. Figure 1 As shown in the figure, this application proposes a batch online signing method, which specifically includes the following steps: Step S1: Receive multiple online signature requests from users for the target document. The online signature requests include electronic seal data, signature location information, and request timestamp.

[0024] Understandably, within a preset time period (e.g., 5 minutes), multiple users, such as User A and User B, submit signing requests to the system for a target document with the same unique code. After saving the signing requests, the backend system returns a document signing link address. Once the user receives the document signing link address, they access it in their browser. Opening the document signing link address displays a list of documents to be signed and a list of electronic seals.

[0025] Next, the user selects a target file from the list of documents to be signed and an electronic seal from the list of electronic seals. The user then drags and drops the electronic seal to the designated signing location within the target file. This embodiment allows users to drag and drop multiple electronic seals and multiple signing locations. After the operation is complete, the user clicks the "Save Signature" button, generating an online signing request that includes electronic seal data, signing location information, and a request timestamp. This request is then sent to the backend system, which subsequently receives multiple online signing requests from users for the target documents.

[0026] The above steps provide complete data support for sorting the signed document queue by timestamp and accurately adding seals, laying the foundation for orderly signing in the future.

[0027] In step S2, each of the online signing requests competes for the distributed lock bound to the target file, and the online signing request that wins the distributed lock is taken as the target signing request.

[0028] Specifically, online signing requests for the same target document are saved in a signing document queue associated with a unique code for that target document. The signing document queue sorts the online signing requests in ascending order based on the request timestamp, which is unique and time-sensitive (e.g., 90 seconds).

[0029] Furthermore, each online signing request in the document signing queue competes for a distributed lock bound to a unique code. The online signing request that wins the distributed lock becomes the target signing request, and the distributed lock becomes locked. The online signing requests that fail to win the distributed lock become pending signing requests and enter a waiting state.

[0030] It should be noted that this embodiment uses a Redisson distributed lock, the principle of which is as follows: (1) Data storage based on Redis: Redisson uses Redis as a shared database to store lock-related information. When an online signature request attempts to acquire a distributed lock, a key-value pair is created in Redis, where the key represents the name of the distributed lock and the value can be the identifier of the locking node or related information; (2) Lua scripts guarantee atomic operations: To ensure the atomicity of lock operations when multiple users concurrently request online signatures (i.e., all requests either all succeed or none succeed), Redisson uses Lua scripts for the locking and unlocking process. This is because Redis's support for Lua scripts allows a series of commands to be executed atomically, thus avoiding race conditions; (3) Automatic lock extension mechanism: Considering that online signature requests holding distributed locks may fail to complete the signing task within the validity period (e.g., due to GC pauses), Redisson provides a watchdog mechanism, which automatically extends the validity period of distributed locks. Once an online signature request acquires a distributed lock, Redisson will start a monitoring thread to periodically check the validity period of the distributed lock and extend it if necessary, unless the distributed lock is released; (4) Reentrancy: Redisson's distributed lock supports reentrancy, which means that the same online signature request can be acquired multiple times without releasing the distributed lock, without causing a deadlock. Each successful acquisition of the distributed lock increments an internal counter, and each release of the distributed lock decrements the counter. The distributed lock is only truly released when the counter reaches zero. (5) Lock fairness options: Redisson also provides a fair lock implementation, which ensures that the online signature request with the longest waiting time (i.e. the earliest request timestamp) gets the distributed lock first. This helps to avoid some online signature requests not being able to get the lock for a long time. (6) RedLock Algorithm Support: To meet high availability requirements, Redisson implements the RedLock algorithm. It does not rely on a single Redis instance but instead uses multiple independent Redis master nodes to enhance the security and reliability of the distributed lock. Acquiring a distributed lock requires successful setting on a majority of nodes; similarly, releasing the distributed lock also requires unlocking on all these nodes.

[0031] Through the above mechanism, Redisson is able to provide efficient and reliable distributed lock services in a distributed environment.

[0032] The above steps replace the existing technology's "forced user stamping order" by grouping online signing requests for the same target document into a signing document queue associated with the document's unique code and sorting them by request timestamp from smallest to largest. This allows users to operate without waiting for the previous user to complete their signing and receive notification, significantly saving waiting time.

[0033] Step S3: Obtain the latest version of the target file, use the latest version of the target file as the file to be signed, process the file to be signed according to the electronic seal data and signature position information in the target signature request, and generate a temporary file and a digital signature.

[0034] Understandably, the target signature request that wins the competition for the distributed lock first obtains the latest version of the target file based on the version number (i.e., the version number with the largest value), and uses the latest version of the target file as the file to be signed.

[0035] Preferably, in this embodiment, the file version generation scheme is as follows: the initial file version number is an initial value (e.g., 0). After a file is signed and a new file is generated, the file version number is increased by a preset value (e.g., 1). This process continues; every time a file is signed and a new file is generated, a new version number is generated. Users must use the latest version of the file as the file to be signed, so that the latest version of the file will retain the previous signing information.

[0036] After obtaining the document to be signed, the electronic seal data from the target signing request is added to the document according to the signature position information in the target signing request, generating a temporary file. Then, a digest operation is performed on the temporary file to obtain the digest data.

[0037] It's important to note that the core principle of digest operations (also known as hash algorithms or hash functions) in digital signatures is to transform (compress) a message of arbitrary length (input data) into a fixed-length (usually much shorter than the original message length), unique, and irreversible output. This output is called a digest, hash value, or fingerprint. By compressing arbitrary data into a unique, fixed-length fingerprint (digest) and ensuring that this fingerprint possesses key security properties such as one-wayness, collision resistance (strong / weak), and avalanche effect, it provides an efficient and secure input foundation for subsequent private key encryption / signature operations.

[0038] After generating the digest data, the next step is to perform digital signature calculation. Using the private key of the target user corresponding to the target signature request, the digest data, the electronic seal data in the target signature request, the signature location information, and the request timestamp are all signed together to generate a digital signature.

[0039] The above steps ensure that the latest version of the target file is obtained as the file to be signed, thus preventing the loss of previous signature information due to the use of older versions of the file. A hash algorithm is used to perform digest calculation on the generated temporary file, which can convert temporary files of any length into fixed-length, unique and irreversible digest data, ensuring that the temporary file is not tampered with during processing. The user's private key is used for signing, which can strongly bind the signature to the user's identity, preventing the forgery of signatures or impersonation of others' signatures, and ensuring the security and reliability of the signature.

[0040] Step S4: Add the digital signature to the temporary file to generate a signed file, send the signed file back to the corresponding target user, and release the distributed lock.

[0041] Intuitively, a digital signature is added to a temporary file, generating a signed file, which is then saved to a file server. Simultaneously, the version number of the signed file is modified by incrementing a preset value (e.g., 1) from the current version number. Subsequent signing tasks will use this version as the latest version. The signed file is then sent to the target user, and the signing page is refreshed, displaying the latest version. Finally, the distributed lock is released, changing its state from locked to released.

[0042] The above steps enable orderly management of document versions, facilitating subsequent version tracing of signed documents; sending signed documents back to the corresponding target users and refreshing the signing page allows users to view the latest version of the document containing their own and other users' signatures in real time without having to manually download or re-acquire the document, reducing user operation costs and improving user experience; and releasing the distributed lock allows the remaining online signing requests in the signing document queue to compete for the lock again, preventing the subsequent signing process from being interrupted due to long-term lock occupation and ensuring the continuous progress of the multi-person signing process.

[0043] In an optional implementation, step S4 is followed by: S5: When the state of the distributed lock changes from locked to released, the remaining online signing requests in the signing document queue compete for the distributed lock again, and S2~S4 are repeated until there are no remaining online signing requests in the signing document queue.

[0044] Understandably, when the state of the distributed lock changes from the locked state to the released state, the remaining online signing requests in the signing document queue will compete for the distributed lock again, repeating steps S2 to S4, and so on, until there are no remaining online signing requests in the signing document queue.

[0045] The above steps ensure that all pending signature requests in the queue are processed in an orderly manner, avoiding the omission of some requests; at the same time, by repeatedly executing the signature process until there are no remaining requests in the queue, the process of signing multiple people is automated, further reducing the time users spend waiting for the preceding process to be manually triggered, and improving the overall signing efficiency.

[0046] In one optional implementation, the system continuously monitors whether the request timestamps of online signing requests in the document signing queue exceed a preset valid duration (e.g., 90 seconds). If an expired signing request with a timestamp exceeding the preset valid duration exists in the signing queue, the expired signing request is removed from the queue, a timeout message is generated, and the timeout message is sent back to the user corresponding to the expired signing request. The user can then resubmit the online signing request, and the new online signing request re-enters the document signing queue.

[0047] The above steps can prevent invalid requests that have timed out from accumulating in the queue for a long time and occupying system resources, thus ensuring queue processing efficiency.

[0048] In one optional implementation, if an abnormal signing request (e.g., a program error) exists in the signing document queue, the abnormal signing request is removed from the signing document queue, an exception message is generated, and the exception message is sent back to the user corresponding to the abnormal signing request. The user can then resubmit the online signing request, and the new online signing request re-enters the signing document queue.

[0049] The above steps effectively prevent the entire signing process from being blocked due to a single timeout or abnormal request occupying lock resources, ensuring system stability and further improving the user signing experience.

[0050] The batch online signing method provided in this application embodiment supports multiple people to open the same target document for signing, without requiring users to wait for the business signing order, effectively saving signing time; and users only need to focus on the stamping position they need, without needing to care whether other users have already signed, thus optimizing the overall experience of multi-person online signing.

[0051] Example 2 like Figure 2 The diagram shown is a structural schematic of a batch online signature device 200 according to an embodiment of this application. The device includes: The receiving module 210 is used to receive multiple online signing requests initiated by users for a target file. The online signing requests include electronic seal data, signing location information and request timestamp. Competition module 220 is used for each of the online signing requests to compete for the distributed lock bound to the target file, and the online signing request that wins the competition for the distributed lock is used as the target signing request; Processing module 230 is used to obtain the latest version of the target file, use the latest version of the target file as the file to be signed, process the file to be signed according to the electronic seal data and signature position information in the target signature request, and generate a temporary file and a digital signature. The generation module 240 is used to add the digital signature to the temporary file, generate a signed file, send the signed file back to the corresponding target user, and release the distributed lock.

[0052] The batch online signing device provided in this application embodiment can realize all processes of the batch online signing method corresponding to Embodiment 1, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0053] The batch online signing device provided in this application embodiment supports multiple people to open the same target document for signing, without requiring users to wait for the business signing order, effectively saving signing time; and users only need to focus on the stamping position they need, without needing to care whether other users have already signed, thus optimizing the overall multi-person online signing experience.

[0054] Example 3 This application also provides a computer device. Please refer to the following for details. Figure 3 , Figure 3 This is a basic structural block diagram of the computer device in this embodiment.

[0055] The computer device 3 includes a memory 31, a processor 32, and a network interface 33 that are interconnected via a system bus. It should be noted that only a computer device 3 with a memory 31, a processor 32, and a network interface 33 is shown in the figure; however, it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented alternatively. Those skilled in the art will understand that the computer device described here is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0056] The computer device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device can interact with the user via a keyboard, mouse, remote control, touchpad, or voice control.

[0057] The memory 31 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or D slot compatibility test memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 31 may be an internal storage unit of the computer device 3, such as the hard disk or memory of the computer device 3. In other embodiments, the memory 31 may also be an external storage device of the computer device 3, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc., equipped on the computer device 3. Of course, the memory 31 may also include both the internal storage unit and its external storage device of the computer device 3. In this embodiment, the memory 31 is typically used to store the operating system and various application software installed on the computer device 3, such as computer-readable instructions for slot compatibility testing methods. In addition, the memory 31 can also be used to temporarily store various types of data that have been output or will be output.

[0058] In some embodiments, the processor 32 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other batch online signature chip. The processor 32 is typically used to control the overall operation of the computer device 3. In this embodiment, the processor 32 is used to execute computer-readable instructions stored in the memory 31 or to process data, such as executing computer-readable instructions for the slot compatibility testing method.

[0059] The network interface 33 may include a wireless network interface or a wired network interface, which is typically used to establish communication connections between the computer device 3 and other electronic devices.

[0060] The computer device provided in this embodiment can execute the above-described batch online signing method. This batch online signing method can be any of the batch online signing methods described in the various embodiments above.

[0061] Example 4 This embodiment also provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the steps of the batch online signing method in this embodiment.

[0062] In this embodiment, the computer-readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the computer-readable storage medium can be an internal storage unit of a computer device, such as the hard disk or memory of the computer device. In other embodiments, the computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device. Of course, the computer-readable storage medium can also include both the internal storage unit and the external storage device of the computer device. In this embodiment, the computer-readable storage medium is typically used to store the operating system and various application software installed on the computer device. In addition, the computer-readable storage medium can also be used to temporarily store various types of data that have been output or will be output.

[0063] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that, as an alternative implementation, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0064] In addition, the functional modules or units in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0065] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a 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 smartphone, personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium can be a non-volatile storage medium or a volatile storage medium. For example, the storage medium can be a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, or any other medium capable of storing program code.

[0066] 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 changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for batch online signing, characterized in that, The method includes: S1: Receive multiple online signature requests initiated by users for the target document. The online signature request includes electronic seal data, signature location information and request timestamp. S2: Each of the online signing requests competes for the distributed lock bound to the target file, and the online signing request that wins the competition for the distributed lock is taken as the target signing request; S3: Obtain the latest version of the target file, use the latest version of the target file as the file to be signed, process the file to be signed according to the electronic seal data and signature position information in the target signature request, and generate a temporary file and a digital signature; S4: Add the digital signature to the temporary file, generate a signed file, send the signed file back to the corresponding target user, and release the distributed lock; Each of the online signing requests competes for a distributed lock bound to the target file, and the online signing request that wins the distributed lock is used as the target signing request, including: Each of the online signing requests is saved to a signing file queue associated with the unique code of the target file, and the online signing requests in the signing file queue are sorted according to the request timestamp; Each online signing request in the signing document queue competes for the distributed lock bound to the unique code. The online signing request that wins the competition for the distributed lock is taken as the target signing request. The state of the distributed lock is determined to be locked. The online signing requests that do not win the competition for the distributed lock are taken as signing requests to be executed. The step of processing the document to be signed based on the electronic seal data and signature location information in the target signature request to generate a temporary document and a digital signature includes: The electronic seal data in the target signature request is added to the file to be signed according to the signature position information in the target signature request, thereby generating the temporary file; A digest operation is performed on the temporary file to obtain digest data. Using the target user's private key, a signature operation is performed on the digest data, the electronic seal data of the target signature request, the signature location information, and the request timestamp to generate the digital signature.

2. The batch online signing method according to claim 1, characterized in that, After generating the signed document, the process also includes: Obtain the version number of the signed document, and add a preset value to the current value of the version number of the signed document to obtain the latest version of the signed document.

3. The batch online signing method according to claim 1, characterized in that, After releasing the distributed lock, the process also includes: S5: When the state of the distributed lock changes from locked to released, the remaining online signing requests in the signing document queue compete for the distributed lock again, and S2~S4 are repeated until there are no remaining online signing requests in the signing document queue.

4. The batch online signing method according to claim 1, characterized in that, The method further includes: Detect whether the request timestamp of the online signing request in the signed document queue exceeds the preset valid duration; When there is an expired signing request in the signing document queue whose request timestamp exceeds the preset valid duration, the expired signing request is removed from the signing document queue, an expiration message is generated, and the expiration message is sent back to the corresponding user.

5. The batch online signing method according to claim 1, characterized in that, The method further includes: When an abnormal signing request exists in the signing document queue, the abnormal signing request is removed from the signing document queue, an abnormal message is generated, and the abnormal message is sent back to the corresponding user.

6. A batch online signature device, characterized in that, The device includes: The receiving module is used to receive multiple online signing requests initiated by users for a target file. The online signing requests include electronic seal data, signing location information and request timestamp. The competition module is used for each of the online signing requests to compete for the distributed lock bound to the target file, and the online signing request that wins the competition for the distributed lock is used as the target signing request; The processing module is used to obtain the latest version of the target file, use the latest version of the target file as the file to be signed, process the file to be signed according to the electronic seal data and signature position information in the target signature request, and generate a temporary file and a digital signature. The generation module is used to add the digital signature to the temporary file, generate a signed file, send the signed file back to the corresponding target user, and release the distributed lock; Each of the online signing requests competes for a distributed lock bound to the target file, and the online signing request that wins the distributed lock is used as the target signing request, including: Each of the online signing requests is saved to a signing file queue associated with the unique code of the target file, and the online signing requests in the signing file queue are sorted according to the request timestamp; Each online signing request in the signing document queue competes for the distributed lock bound to the unique code. The online signing request that wins the competition for the distributed lock is taken as the target signing request. The state of the distributed lock is determined to be locked. The online signing requests that do not win the competition for the distributed lock are taken as signing requests to be executed. The step of processing the document to be signed based on the electronic seal data and signature location information in the target signature request to generate a temporary document and a digital signature includes: The electronic seal data in the target signature request is added to the file to be signed according to the signature position information in the target signature request, thereby generating the temporary file; A digest operation is performed on the temporary file to obtain digest data. Using the target user's private key, a signature operation is performed on the digest data, the electronic seal data of the target signature request, the signature location information, and the request timestamp to generate the digital signature.

7. A computer device, characterized in that, It includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the batch online signing method according to any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the batch online signing method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Batch signature method and device, computer equipment and readable storage medium

    CN120509847A

  • Generating electronic signatures

    US20210211299A1