Methods, apparatus, electronic devices and storage media for generating electronic seals

By introducing an asynchronous processing mechanism into the electronic seal system, a seal application task queue is generated and the results are fed back independently, which solves the congestion problem of the seal application system when dealing with large files or insufficient network bandwidth, and improves the stability and success rate of the system.

CN114117550BActive Publication Date: 2026-03-13CHINA CONSTRUCTION BANK
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-25
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

In existing technologies, electronic seal systems are prone to congestion when dealing with large files or insufficient network bandwidth, which affects the success rate of seal application and system stability.

Method used

An asynchronous processing mechanism is adopted, in which the first service generates a stamping task queue and executes the stamping tasks asynchronously, while the second service independently provides feedback on the stamping results, thus avoiding system congestion caused by synchronous connections.

Benefits of technology

It improved the stability and success rate of the printing system, reduced system lag, and enhanced the system's response efficiency and flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114117550B_ABST
    Figure CN114117550B_ABST
Patent Text Reader

Abstract

This application provides an electronic seal generation method, apparatus, electronic device, and storage medium, applied in the field of resource scheduling technology. Based on a first service, in response to a seal-using request sent by a terminal device, a corresponding seal-using task is generated and placed into a seal-using task queue. The seal-using task is used to generate an electronic seal file. Based on the first service, the seal-using tasks in the seal-using task queue are executed asynchronously to generate the corresponding electronic seal file. Based on a second service, seal-using result information is sent to the terminal device, enabling the terminal device to obtain the electronic seal file corresponding to the seal-using request. Because an independent first service is set up to respond to seal-using requests, seal-using tasks and a seal-using task queue are generated, and the seal-using tasks in the queue are executed asynchronously, asynchronous generation of the electronic seal file is achieved, avoiding system congestion caused by synchronous seal-using mode and improving the stability of the seal-using system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of resource scheduling technology, and in particular to a method, apparatus, electronic device and storage medium for generating electronic seals. Background Technology

[0002] As traditional office models gradually shift to information-based office models, the circulation of paper documents is also changing towards electronic documents. To adapt to the needs of information-based office models, existing technologies have proposed electronic seals as a technical solution. Electronic seals can ensure the validity of electronic documents while giving them the same credible visual appeal as traditional paper documents.

[0003] In the existing technology, when using a system that generates electronic seals, the "synchronous sealing" mode is usually adopted. That is, when using the services provided by the sealing server, a connection is always maintained with the sealing server until the sealing server returns the sealing document.

[0004] However, in practical applications, when the document to be stamped is large or the network bandwidth is insufficient, system congestion can easily occur, leading to a decrease in the success rate of electronic seal stamping and affecting the stability of the stamping system. Summary of the Invention

[0005] This application provides an electronic seal generation method, apparatus, electronic device, and storage medium to solve the problem that the synchronous seal application mode in the prior art is prone to system congestion, resulting in a decrease in the success rate of electronic seal application.

[0006] Firstly, this application provides a method for generating an electronic seal, including:

[0007] Based on the first service, in response to the seal request sent by the terminal device, a corresponding seal task is generated and placed into the seal task queue. The seal task is used to generate an electronic seal file. Based on the first service, the seal task in the seal task queue is executed asynchronously to generate the electronic seal file corresponding to the seal task. Based on the second service, seal result information is sent to the terminal device. The seal result information is used to enable the terminal device to obtain the electronic seal file corresponding to the seal request.

[0008] In one possible implementation, the step of generating a corresponding stamping task in response to a stamping request sent by a terminal device and placing the stamping task into a stamping task queue includes: obtaining the stamping request sent by the terminal device and generating a corresponding task number based on the request level of the stamping request; determining priority information according to the task number, wherein the priority information is used to characterize the execution priority of the stamping task queue; and adding the stamping task corresponding to the stamping request to the task queue corresponding to the priority information.

[0009] In one possible implementation, the asynchronous execution of the stamping tasks in the stamping task queue and the generation of the electronic seal file corresponding to the stamping task includes: based on the priority information of each task queue, sequentially and asynchronously executing the stamping tasks in each task queue and generating the electronic seal file corresponding to the stamping task.

[0010] In one possible implementation, the method further includes: based on the first service, obtaining a seal application request sent by a terminal device, the seal application request including an original file, the original file being used to generate an electronic seal file; based on the first service, verifying the original file and generating a verification result; the step of generating a corresponding seal application task in response to the seal application request sent by the terminal device includes: if the verification result is qualified, generating a corresponding seal application task.

[0011] In one possible implementation, the method further includes: detecting the current idle computing resources of the first service; asynchronously executing the stamping task in the stamping task queue and generating the electronic seal file corresponding to the stamping task includes: if the idle computing resources are greater than the computing resource threshold, then executing the stamping task in the stamping task queue and generating the electronic seal file corresponding to the stamping task.

[0012] In one possible implementation, after executing the stamping tasks in the stamping task queue, the method further includes: based on the first service, counting the number of times the currently executed stamping tasks are executed; if the number of times the currently executed stamping tasks are executed is greater than a threshold, then the currently executed stamping tasks are marked as abnormal tasks, and a failure notification is sent to the terminal device based on the second service, the failure notification indicating that the abnormal task has failed to execute.

[0013] In one possible implementation, the method further includes: obtaining the abnormal task queue, the abnormal task queue including at least one abnormal task; when the load information of the first service is less than the load threshold, executing the abnormal task in the abnormal task queue based on a first preset period, wherein the load information represents the number of stamping tasks in the stamping task queue corresponding to the first service, or the number of available threads corresponding to the first service.

[0014] In one possible implementation, after generating the electronic seal file, the method further includes: caching the electronic seal file in a preset storage location; the step of sending the seal usage result information to the terminal device based on the second service includes: detecting the storage location at a second preset period based on the second service, and after detecting the electronic seal file, obtaining the identification code of the electronic seal file and sending the seal usage result information to the terminal device indicated by the identification code.

[0015] In one possible implementation, the seal application result information includes notification information or the electronic seal file, wherein the notification information is used to invite the terminal device to download the electronic seal file from the storage location.

[0016] In one possible implementation, the method further includes: receiving a stamping request sent by the terminal device based on a third service; detecting load information of each first service, the load information representing the number of stamping tasks in the stamping task queue corresponding to the first service, or the number of available threads corresponding to the first service; determining a target first service based on the load information of each first service, and sending the stamping request to the target first service.

[0017] Secondly, this application provides an electronic seal generation device, comprising:

[0018] The seal application module is used to generate a corresponding seal application task in response to a seal application request sent by a terminal device based on the first service, and to place the seal application task into the seal application task queue. The seal application task is used to generate an electronic seal file.

[0019] The seal application module is further configured to: asynchronously execute seal application tasks in the seal application task queue based on the first service, and generate electronic seal files corresponding to the seal application tasks;

[0020] The result sending module is used to send seal application result information to the terminal device based on the second service. The seal application result information is used to enable the terminal device to obtain the electronic seal file corresponding to the seal application request.

[0021] In one possible implementation, when the stamping module generates a corresponding stamping task in response to a stamping request sent by a terminal device and places the stamping task into a stamping task queue, it is specifically configured to: obtain the stamping request sent by the terminal device and generate a corresponding task number based on the request level of the stamping request; determine priority information according to the task number, wherein the priority information is used to characterize the execution priority of the stamping task queue; and add the stamping task corresponding to the stamping request to the task queue corresponding to the priority information.

[0022] In one possible implementation, when the stamping module asynchronously executes the stamping tasks in the stamping task queue and generates the electronic seal file corresponding to the stamping task, it is specifically used to: based on the priority information of each task queue, sequentially and asynchronously execute the stamping tasks in each task queue and generate the electronic seal file corresponding to the stamping task.

[0023] In one possible implementation, the stamping module is further configured to: obtain a stamping request sent by a terminal device based on the first service, the stamping request including an original file used to generate an electronic seal file; verify the original file based on the first service and generate a verification result; when the stamping module generates a corresponding stamping task in response to a stamping request sent by a terminal device, it is specifically configured to: generate a corresponding stamping task if the verification result is qualified.

[0024] In one possible implementation, the stamping module is further configured to: detect the current idle computing resources of the first service; when the stamping module asynchronously executes the stamping tasks in the stamping task queue and generates the electronic seal file corresponding to the stamping task, it is specifically configured to: if the idle computing resources are greater than the computing resource threshold, execute the stamping tasks in the stamping task queue and generate the electronic seal file corresponding to the stamping task.

[0025] In one possible implementation, after executing the stamping tasks in the stamping task queue, the stamping module is further configured to: count the number of times the currently executed stamping task is executed based on the first service; if the number of times the currently executed stamping task is executed is greater than a threshold, then the currently executed stamping task is marked as an abnormal task; the result sending module is further configured to: send a failure notification to the terminal device based on the second service, the failure notification indicating that the abnormal task has failed to execute.

[0026] In one possible implementation, the stamping module is further configured to: acquire the abnormal task queue, the abnormal task queue including at least one abnormal task; and execute the abnormal task in the abnormal task queue based on a first preset period when the load information of the first service is less than the load threshold, wherein the load information represents the number of stamping tasks in the stamping task queue corresponding to the first service, or the number of available threads corresponding to the first service.

[0027] In one possible implementation, after generating the electronic seal file, the seal application module is further configured to: cache the electronic seal file in a preset storage location; the result sending module is specifically configured to: detect the storage location at a second preset period based on the second service, and after detecting the electronic seal file, obtain the identification code of the electronic seal file and send the seal application result information to the terminal device indicated by the identification code.

[0028] In one possible implementation, the seal application result information includes notification information or the electronic seal file, wherein the notification information is used to invite the terminal device to download the electronic seal file from the storage location.

[0029] In one possible implementation, the apparatus further includes a load balancing module, configured to: receive a stamping request sent by the terminal device based on a third service; detect load information of each first service, the load information representing the number of stamping tasks in the stamping task queue corresponding to the first service, or the number of available threads corresponding to the first service; determine a target first service based on the load information of each first service, and send the stamping request to the target first service.

[0030] Thirdly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;

[0031] The memory stores computer-executed instructions;

[0032] The processor executes computer execution instructions stored in the memory to implement the electronic seal generation method as described in any of the first aspects of the embodiments of this application.

[0033] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the electronic seal generation method as described in any of the first aspects of the embodiments of this application.

[0034] According to a fifth aspect of the embodiments of this application, this application provides a computer program product, including a computer program that, when executed by a processor, implements the electronic seal generation method as described in any of the first aspects above.

[0035] The electronic seal generation method, apparatus, electronic device, and storage medium provided in this application, based on a first service, respond to a seal request sent by a terminal device, generate a corresponding seal task, and place the seal task into a seal task queue. The seal task is used to generate an electronic seal file. Based on the first service, the seal tasks in the seal task queue are executed asynchronously to generate the electronic seal file corresponding to the seal task. Based on a second service, seal result information is sent to the terminal device, which enables the terminal device to obtain the electronic seal file corresponding to the seal request. Because an independent first service is set up to respond to the seal request, a seal task and a seal task queue are generated, and the seal tasks in the seal task queue are executed asynchronously, the electronic seal file is generated asynchronously. Simultaneously, by setting up an independent second service to feed back the generation result to the terminal, the terminal can disconnect from the server after sending a seal request, and subsequently obtain the electronic seal file through the seal result information sent by the second service. This avoids the system congestion and low seal success rate caused by synchronous seal use mode, thus improving the stability of the seal use system. Attached Figure Description

[0036] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0037] Figure 1 An application scenario diagram for generating electronic seals provided in the embodiments of this application;

[0038] Figure 2 A flowchart illustrating an embodiment of the electronic seal generation method provided in this application;

[0039] Figure 3 A schematic diagram illustrating the asynchronous execution of stamping tasks in the stamping task queue, provided as an embodiment of this application;

[0040] Figure 4 This is a schematic diagram illustrating the sending of seal application result information to the terminal device, as provided in an embodiment of this application.

[0041] Figure 5 A flowchart of an electronic seal generation method provided in another embodiment of this application;

[0042] Figure 6 A schematic diagram of a seal server provided in an embodiment of this application;

[0043] Figure 7 A schematic diagram of the structure of an electronic seal generation device provided in one embodiment of this application;

[0044] Figure 8 This is a schematic diagram of an electronic device provided in one embodiment of this application.

[0045] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0046] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0047] The application scenarios of the embodiments of this application are explained below:

[0048] Figure 1 This is an application scenario diagram illustrating the electronic seal generation method provided in this application embodiment. The electronic seal generation method provided in this application embodiment can be applied to the application scenario of a distributed electronic seal usage system. For example, as shown... Figure 1 As shown, the execution entity of the method provided in this application embodiment can be a seal-using server. The seal-using server is communicatively connected to the terminal device, used to receive seal-using requests sent by the terminal device, and respond by returning electronic seal files to the terminal device. More specifically, the seal-using server is implemented based on a distributed system, and multiple scalable seal-using services run within the seal-using server. Each seal-using service can run locally on the seal-using server or within other distributed servers.

[0049] Existing electronic seal systems typically employ a "synchronous sealing" model. This means that after the document to be sealed is sent to the sealing server via an online service, the connection remains occupied until the server returns the document, at which point the connection is closed. In practical applications, when the document is large or network bandwidth is insufficient, the terminal sending the sealing request may remain connected to the sealing server for an extended period, while other terminals' sealing requests may not receive a response. This leads to congestion and reduced stability in the sealing system.

[0050] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0051] Figure 2 A flowchart of an electronic seal generation method provided in one embodiment of this application is shown below. Figure 2 As shown, the execution entity of the electronic seal generation method provided in this embodiment can be a seal-using server, which deploys a first service and a second service. The electronic seal generation method provided in this embodiment includes the following steps:

[0052] Step S101: Based on the first service, in response to the seal request sent by the terminal device, a corresponding seal task is generated and placed into the seal task queue. The seal task is used to generate an electronic seal file.

[0053] For example, the first service is a program used to respond to a stamping request and generate an electronic seal file, which is the stamping service in the above application scenario example. More specifically, the first service is a software unit, corresponding to a program process or program thread. The first service is implemented based on a distributed system, that is, the first service can run locally on a server or in other electronic devices, and its function can be implemented by remote invocation by the stamping server.

[0054] After the terminal device sends a seal request to the seal server, the seal server responds to the request based on the first service, generating a seal task corresponding to the request and inserting the seal task at the end of the seal task queue. The seal task queue is a container for holding seal tasks. The first service executes the tasks in the seal task queue sequentially, thereby responding to the seal request. More specifically, for example, if the seal request includes an original document, after the seal task corresponding to the request is executed, the first service affixes an electronic seal to the original document, generating an original document with an electronic seal, i.e., an electronic seal file.

[0055] Step S102: Based on the first service, asynchronously execute the seal-using tasks in the seal-using task queue and generate the electronic seal file corresponding to the seal-using task.

[0056] For example, after responding to a stamping request sent by a terminal device, generating a corresponding stamping task, and placing the stamping task into a stamping task queue, the first service asynchronously executes the stamping tasks in the stamping task queue through other program threads to generate the electronic seal file corresponding to the stamping task. In one possible implementation, the first service includes a queue module and a stamping module, which are implemented through different program threads. The queue module is used to generate stamping tasks and place them into the stamping task queue; the stamping module is used to asynchronously execute the stamping tasks in the stamping task queue and generate the electronic seal file corresponding to the stamping task. Figure 3 This application provides a schematic diagram illustrating the asynchronous execution of stamping tasks in a stamping task queue, as shown in the embodiments of the present application. Figure 3 As shown, based on the stamping task queue generated by the queue module, the stamping module sequentially retrieves the stamping tasks and processes them. More specifically, it affixes an electronic seal to the original document corresponding to the stamping task, generating a corresponding electronic seal file. Optionally, the stamping module then caches the electronic seal file in a preset storage location, enabling the second service to generate stamping result information based on this storage location in subsequent steps.

[0057] Step S103: Based on the second service, send the seal application result information to the terminal device. The seal application result information is used to enable the terminal device to obtain the electronic seal file corresponding to the seal application request.

[0058] For example, similar to the first service, the second service is also a software unit, corresponding to a program process or program thread. The second service can also be implemented based on a distributed system, running locally on the seal server or implemented through remote invocation. The second service is independent of the first service. For example, based on a second preset period, the second service periodically checks the results of the electronic seal file generated by the first service and sends the seal application result information to the terminal device. For instance, the first service saves the generated electronic seal file in a preset storage location, and the second service periodically checks this storage location. Upon detecting the electronic seal file, it obtains the identification code of the electronic seal file, which uniquely identifies the seal application request and the terminal device that sent the request. Then, the second service sends the seal application result information to the terminal device indicated by the identification code. This process can also be implemented using a queue, where the second service sequentially sends the seal application result information to the corresponding terminal device through a sending queue containing multiple sending tasks. After sending the seal application result information to the terminal device, the second service deletes the sent task from the sending queue.

[0059] Figure 4 This is a schematic diagram illustrating the sending of stamping result information to a terminal device, as provided in an embodiment of this application. Figure 4As shown, based on the queue module and the stamping module in the first service, after generating an electronic seal file in a preset storage location, the second service detects the generated electronic seal file from the preset storage location and sequentially sends the stamping result information to the corresponding terminal device. From the above process, it can be seen that since the first and second services are independent of each other, asynchronous processing of the generation (implemented by the first service) and transmission (implemented by the second service) of the electronic seal file can be achieved. This avoids system lag and unresponsiveness when the generated electronic seal file is large, thus improving system stability.

[0060] For example, the stamping result information includes notification information or an electronic seal file. The notification information invites the terminal device to download the electronic seal file from its storage location. Specifically, in one possible implementation, the stamping result information includes an electronic seal file, i.e., the original document after the electronic seal is affixed, which is actively pushed to the terminal device by the stamping server. After receiving the stamping result information, the terminal device can directly obtain the electronic seal file from the stamping result information. In another possible implementation, the stamping result information includes notification information, such as a storage address link. After receiving the notification information, the terminal device can click the link in the notification information to download the electronic seal file corresponding to the stamping request from a preset storage address where the electronic seal file is stored.

[0061] In this embodiment, since the second service and the first service are independent of each other, the frequency of sending the stamping result information to the terminal device can be dynamically adjusted by the stamping server side according to its own program operation and load, thereby ensuring the stability of the stamping server itself. At the same time, the terminal device does not need to maintain a long-term connection with the stamping server, reducing the occupancy rate of the stamping server.

[0062] In this embodiment, based on a first service, in response to a seal request sent by a terminal device, a corresponding seal task is generated and placed into a seal task queue. The seal task is used to generate an electronic seal file. Based on the first service, the seal tasks in the seal task queue are executed asynchronously to generate the corresponding electronic seal file. Based on a second service, seal result information is sent to the terminal device, enabling the terminal device to obtain the electronic seal file corresponding to the seal request. Because an independent first service is set up to respond to seal requests, generate seal tasks and a seal task queue, and asynchronously execute the seal tasks in the queue, asynchronous generation of the electronic seal file is achieved. Simultaneously, by setting up an independent second service to feed back the generation result to the terminal, the terminal can disconnect from the server after sending a seal request, and subsequently obtain the electronic seal file through the seal result information sent by the second service. This avoids the system congestion and low seal success rate caused by synchronous seal use, thus improving the stability of the seal use system.

[0063] Figure 5 A flowchart of an electronic seal generation method provided in another embodiment of this application is shown below. Figure 5 As shown, the electronic seal generation method provided in this embodiment is... Figure 2 Based on the electronic seal generation method provided in the illustrated embodiment, steps S101-S103 are further refined. Therefore, the electronic seal generation method provided in this embodiment includes the following steps:

[0064] Step S201: Based on the third service, receive the seal request sent by the terminal device.

[0065] Step S202: Detect the load information of each first service. The load information represents the number of stamping tasks in the stamping task queue corresponding to the first service, or the number of available threads corresponding to the first service.

[0066] Step S203: Based on the load information of each first service, determine the target first service and send the seal request to the target first service.

[0067] For example, the third service is a load balancing program running within the print server. Since the multiple first services implemented within the print server are based on a distributed system, the computing resources and workload of each first service differ during actual operation of the print server, which may lead to load imbalance.

[0068] Figure 6 This is a schematic diagram of a seal server provided in an embodiment of this application, as shown below. Figure 6As shown, the seal-using server deploys a second service, a third service, and multiple first services. Each first service includes a queue module and a seal-using module (not shown in the figure). These modules are implemented through different program threads. The queue module generates seal-using tasks and places them into a seal-using task queue. The seal-using module asynchronously executes the seal-using tasks in the queue and generates the corresponding electronic seal files. After receiving a seal-using request from a terminal device, the third service checks the load information of each connected first service. For example, the load information represents the number of seal-using tasks in the seal-using task queue corresponding to the first service, or the number of available threads corresponding to the first service. Based on the load information of each first service, the first service with the lowest load is selected as the target first service, and the received seal-using request is sent to the target first service, thus completing the task allocation process. Subsequently, the first service generates a stamping task and executes it asynchronously, generating an electronic seal file, which is then sent to the second service. The second service then sends the stamping result information to the terminal device so that the terminal device can obtain the electronic seal file. For details of the implementation process, please refer to the description of the corresponding steps in the embodiment.

[0069] Step S204: Based on the first service, obtain the seal application request sent by the terminal device. The seal application request includes the original file, which is used to generate the electronic seal file.

[0070] Step S205: Based on the first service, verify the original file and generate a verification result.

[0071] Step S206: If the verification result is qualified, the corresponding stamping task is generated.

[0072] For example, the first service is also used to verify the original document in the received stamping request. This function can be implemented by the file verification module in the first service. Specifically, after receiving the stamping request sent by the third service, the file verification module verifies the original document in the stamping request, such as verifying the file code of the original document. Only when the file code of the original document is authorized will the subsequent operation of affixing an electronic seal to the original document be performed. That is, when the verification result is qualified, the stamping request is forwarded to the queue module of the first service, and the corresponding stamping task is generated through the queue module.

[0073] Step S207: Based on the request level of the stamping request, generate the corresponding task number, and determine the priority information according to the task number. The priority information is used to characterize the execution priority of the stamping task queue.

[0074] Step S208: Based on the priority information of each task queue, execute the stamping tasks in each task queue asynchronously in sequence to generate the electronic seal file corresponding to the stamping task.

[0075] Step S209: Add the stamping task corresponding to the stamping request to the task queue corresponding to the priority information.

[0076] For example, the seal application request includes request level information, which can be used to determine the request level of the seal application request. More specifically, for example, a specific bit in the request identifier of the seal application request represents the request level information, which is determined by the user identifier or terminal device identifier of the terminal device that sent the seal application request. For example, if the seal application request sent by terminal device A contains request level information of 01, it indicates that the request level of the seal application request is level 1; if the seal application request sent by terminal device B contains request level information of 02, it indicates that the request level of the seal application request is level 2. Different request levels represent different processing priorities. For example, a level 1 seal application request will be responded to first, generating the corresponding electronic seal file; a level 2 seal application request will be responded to (relative to a level 1 seal application request) with a delayed response, generating the corresponding electronic seal file.

[0077] Furthermore, based on the request level, a corresponding task number is generated to determine priority information, which is used to characterize the execution priority of the stamping task queue. Specifically, the stamping task queue includes stamping task queue A and stamping task queue B. Stamping task queue A carries stamping tasks corresponding to level 1 stamping requests; stamping task queue B carries stamping tasks corresponding to level 2 stamping requests. That is, stamping task queue A has a higher priority than stamping task queue B. When executing stamping tasks in the stamping task queues based on the first service, the first service will prioritize executing stamping tasks in the higher-priority queues, and then execute stamping tasks in the lower-priority queues. In the example above, after determining the priority information based on the task number, the stamping task is added to the task queue corresponding to the priority information, thereby achieving priority classification of stamping tasks. When executing stamping tasks subsequently, the first service will first execute each stamping task in stamping task queue A. After all stamping tasks in stamping task queue A have been executed, the stamping tasks in stamping task queue B will then be executed.

[0078] In this embodiment, a corresponding task number is generated based on the request level of the stamping request, and priority information is determined according to the task number. When the first service executes the stamping task, the high-priority use case task queue is executed first based on the priority information, thereby realizing priority differentiation processing, so that urgent and important stamping requests can be responded to first, and improving the flexibility of the stamping system.

[0079] Step S210: Detect the current idle computing resources of the first service.

[0080] Step S211: If the idle computing resources are greater than the computing resource threshold, then based on the priority information, execute the stamping task in the stamping task queue and generate the electronic seal file corresponding to the stamping task.

[0081] For example, the first service is also used to detect current computing resources. As described above, the method provided in this embodiment is based on a distributed system. Each first service is implemented by a program running locally on the seal server or other devices. Therefore, the current task processing status of different first services corresponds to different idle computing resources. In one possible implementation, idle computing resources can be determined by the difference between the total computing resources of the first service and the load information of the first service. For example, the load information represents the number of seal tasks in the seal task queue corresponding to the first service, or the number of available threads corresponding to the first service. If the idle computing resources are greater than the computing resource threshold, it means that the current idle computing resources of the first service are sufficient to support its response to new seal requests. At this time, the first service executes the seal tasks in the seal task queue based on priority information and generates the electronic seal file corresponding to the seal task. Conversely, if the idle computing resources are not greater than the computing resource threshold, it means that the current idle computing resources of the first service can no longer respond to seal requests. In this case, the first service returns an exception message to the third service, so that the third service reassigns the seal request to other first services.

[0082] Step S212: Based on the second service, send the seal application result information to the terminal device. The seal application result information is used to enable the terminal device to obtain the electronic seal file corresponding to the seal application request.

[0083] Step S213: Based on the first service, count the number of times the currently executed stamping task is executed.

[0084] Step S214: If the number of times the currently executed stamping task is executed exceeds the number threshold, the currently executed stamping task is marked as an abnormal task, and a failure notification is sent to the terminal device based on the second service. The failure notification indicates that the abnormal task has failed to execute.

[0085] For example, during the execution of a stamping task, failures may occur for various reasons. Therefore, during the execution of stamping tasks by the first service, the cumulative number of times each stamping task has been executed is recorded. When a stamping task in the queue fails to execute successfully, it is re-added to the queue for execution, thereby reducing the success rate of stamping requests. Simultaneously, after each execution, the total number of times the stamping task has been executed is counted. When this total number reaches the upper limit (threshold), the currently executed stamping task is marked as an abnormal task, and a failure notification is sent to the terminal device via the second service. The failure notification indicates that the abnormal task failed. This allows the user on the terminal device to receive notification of the stamping request failure and verify whether it was caused by an anomaly in the sent stamping request (original file).

[0086] Step S215: Obtain the abnormal task queue, which includes at least one abnormal task.

[0087] Step S216: When the load information of the first service is less than the load threshold, execute the abnormal tasks in the abnormal task queue based on the first preset period, wherein the load information represents the number of stamping tasks in the stamping task queue corresponding to the first service, or the number of available threads corresponding to the first service.

[0088] For example, while executing stamping tasks and generating electronic seal files based on the stamping task queue, the first service also collects failed abnormal tasks during the execution of stamping tasks into a separate queue, namely the abnormal task queue. Then, based on the stamping requests received by the first service, it prioritizes processing the stamping tasks corresponding to new stamping requests and generates the corresponding electronic seal files to meet the stamping needs in high-concurrency scenarios. When the load information of the first service is less than the load threshold, i.e., when the first service is in an idle state, the first service re-executes the abnormal tasks in the abnormal task queue based on a first preset period. This avoids the reduction in the execution efficiency of the first service caused by repeatedly executing abnormal tasks under high concurrency and high load, improves the success rate and timeliness of stamping request responses, and improves the overall operating efficiency of the stamping server.

[0089] In this embodiment, the implementation of step S212 is the same as that in this application. Figure 2 The implementation of step S103 in the illustrated embodiment is the same, and will not be described in detail here.

[0090] Figure 7 This is a schematic diagram of the structure of an electronic seal generation device provided in one embodiment of this application, as shown below. Figure 7 As shown, the electronic seal generation device 3 provided in this embodiment includes:

[0091] The stamping module 31 is used to generate a corresponding stamping task in response to a stamping request sent by a terminal device based on the first service, and to place the stamping task into the stamping task queue. The stamping task is used to generate an electronic seal file.

[0092] The seal application module 31 is also used to: asynchronously execute seal application tasks in the seal application task queue based on the first service, and generate electronic seal files corresponding to the seal application tasks;

[0093] The result sending module 32 is used to send the seal application result information to the terminal device based on the second service. The seal application result information is used to enable the terminal device to obtain the electronic seal file corresponding to the seal application request.

[0094] In one possible implementation, when the stamping module 31 generates a corresponding stamping task in response to a stamping request sent by the terminal device and places the stamping task into the stamping task queue, it specifically performs the following steps: obtaining the stamping request sent by the terminal device and generating a corresponding task number based on the request level of the stamping request; determining priority information according to the task number, wherein the priority information is used to characterize the execution priority of the stamping task queue; and adding the stamping task corresponding to the stamping request to the task queue corresponding to the priority information.

[0095] In one possible implementation, when the stamping module 31 asynchronously executes the stamping tasks in the stamping task queue and generates the electronic seal file corresponding to the stamping task, it is specifically used to: based on the priority information of each task queue, sequentially and asynchronously execute the stamping tasks in each task queue and generate the electronic seal file corresponding to the stamping task.

[0096] In one possible implementation, the stamping module 31 is further configured to: obtain a stamping request sent by the terminal device based on the first service, wherein the stamping request includes an original file used to generate an electronic seal file; verify the original file based on the first service and generate a verification result; when the stamping module 31 generates a corresponding stamping task in response to the stamping request sent by the terminal device, it is specifically configured to: generate a corresponding stamping task if the verification result is qualified.

[0097] In one possible implementation, the stamping module 31 is further configured to: detect the current idle computing resources of the first service; when the stamping module 31 asynchronously executes the stamping tasks in the stamping task queue and generates the electronic seal file corresponding to the stamping task, it is specifically configured to: if the idle computing resources are greater than the computing resource threshold, execute the stamping tasks in the stamping task queue and generate the electronic seal file corresponding to the stamping task.

[0098] In one possible implementation, after executing the stamping tasks in the stamping task queue, the stamping module 31 is further configured to: count the number of times the currently executed stamping task is executed based on the first service; if the number of times the currently executed stamping task is executed is greater than the number threshold, then the currently executed stamping task is marked as an abnormal task. The result sending module 32 is further configured to: send a failure notification to the terminal device based on the second service, wherein the failure notification indicates that the abnormal task has failed to execute.

[0099] In one possible implementation, the stamping module 31 is further configured to: obtain an abnormal task queue, the abnormal task queue including at least one abnormal task; and execute the abnormal task in the abnormal task queue based on a first preset period when the load information of the first service is less than the load threshold, wherein the load information represents the number of stamping tasks in the stamping task queue corresponding to the first service, or the number of available threads corresponding to the first service.

[0100] In one possible implementation, after generating the electronic seal file, the seal application module 31 is further configured to: cache the electronic seal file in a preset storage location; the result sending module 32 is specifically configured to: detect the storage location at a second preset period based on the second service, and after detecting the electronic seal file, obtain the identification code of the electronic seal file and send the seal application result information to the terminal device indicated by the identification code.

[0101] In one possible implementation, the stamping result information includes a notification message or an electronic stamp file, with the notification message inviting the terminal device to download the electronic stamp file from its storage location.

[0102] In one possible implementation, the apparatus further includes a load balancing module 33, configured to: receive a stamping request sent by a terminal device based on a third service; detect the load information of each first service, wherein the load information represents the number of stamping tasks in the stamping task queue corresponding to the first service, or the number of available threads corresponding to the first service; determine a target first service based on the load information of each first service, and send the stamping request to the target first service.

[0103] The load balancing module 33, the stamping module 31, and the result sending module 32 are connected sequentially. The electronic seal generation device provided in this embodiment can perform the following... Figures 2-6 The technical solutions of any of the method embodiments shown are similar in implementation principle and technical effect, and will not be described again here.

[0104] Figure 8 A schematic diagram of an electronic device provided in one embodiment of this application, as shown below. Figure 8 As shown, the electronic device 4 provided in this embodiment includes: a processor 41, and a memory 42 communicatively connected to the processor 41.

[0105] Among them, memory 42 stores computer-executed instructions;

[0106] The processor 41 executes computer execution instructions stored in the memory 42 to implement this application. Figures 2-6 The electronic seal generation method provided in any of the corresponding embodiments.

[0107] The processor 41 and the memory 42 are connected via a bus 43.

[0108] For relevant instructions, please refer to the corresponding text. Figures 2-6 The relevant descriptions and effects of the steps in the corresponding embodiments are understood, and will not be elaborated on here.

[0109] One embodiment of this application provides a computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement this application. Figures 2-6 The electronic seal generation method provided in any of the corresponding embodiments.

[0110] The computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0111] One embodiment of this application provides a computer program product, including a computer program that, when executed by a processor, implements this application. Figures 2-6 The electronic seal generation method provided in any of the corresponding embodiments.

[0112] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.

[0113] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0114] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A method for generating an electronic seal, characterized in that, include; Based on the first service, in response to a seal request sent by a terminal device, a corresponding seal task is generated and placed into a seal task queue. The seal task is used to generate an electronic seal file. The first service is implemented based on a distributed system. Based on the first service, the seal-using tasks in the seal-using task queue are executed asynchronously to generate electronic seal files corresponding to the seal-using tasks; The electronic seal file is cached in a preset storage location; Based on the second service, the storage location is detected at a second preset period. After the electronic seal file is detected, the identification code of the electronic seal file is obtained, and the seal application result information is sent to the terminal device indicated by the identification code. The seal application result information is used to enable the terminal device to obtain the electronic seal file corresponding to the seal application request. The second service is independent of the first service; The method further includes: Based on the third service, the system receives the seal application request sent by the terminal device. Detect the load information of each of the first services, wherein the load information represents the number of stamping tasks in the stamping task queue corresponding to the first service, or the number of available threads corresponding to the first service; Based on the load information of each of the first services, a target first service is determined, and the seal request is sent to the target first service; Based on the first service, count the number of times the currently executed seal-related tasks are performed; If the number of times the currently executed stamping task is executed exceeds the threshold, the currently executed stamping task is marked as an abnormal task, and a failure notification is sent to the terminal device based on the second service. The failure notification indicates that the abnormal task has failed to execute. Obtain the abnormal task queue, the abnormal task queue including at least one of the abnormal tasks; When the load information of the first service is less than the load threshold, the abnormal tasks in the abnormal task queue are executed based on the first preset period.

2. The method according to claim 1, characterized in that, The step of responding to a stamping request sent by a terminal device, generating a corresponding stamping task, and placing the stamping task into a stamping task queue includes: Obtain the seal request sent by the terminal device, and generate a corresponding task number based on the request level of the seal request; Based on the task number, priority information is determined, wherein the priority information is used to characterize the execution priority of the stamping task queue; Add the stamping task corresponding to the stamping request to the task queue corresponding to the priority information.

3. The method according to claim 2, characterized in that, The asynchronous execution of the seal-using tasks in the seal-using task queue, generating the electronic seal file corresponding to the seal-using task, includes: Based on the priority information of each task queue, the stamping tasks in each task queue are executed asynchronously in sequence to generate electronic seal files corresponding to the stamping tasks.

4. The method according to claim 1, characterized in that, The method also includes: Based on the first service, a seal application request sent by the terminal device is obtained, wherein the seal application request includes an original file, and the original file is used to generate an electronic seal file; Based on the first service, the original file is verified, and a verification result is generated; The step of generating a corresponding stamping task in response to a stamping request sent by a terminal device includes: If the verification result is satisfactory, a corresponding stamping task will be generated.

5. The method according to claim 1, characterized in that, The method further includes: Detect the current idle computing resources of the first service; The asynchronous execution of the seal-using tasks in the seal-using task queue, generating the electronic seal file corresponding to the seal-using task, includes: If the idle computing resources are greater than the computing resource threshold, then the seal-using task in the seal-using task queue is executed, and the electronic seal file corresponding to the seal-using task is generated.

6. The method according to claim 1, characterized in that, The seal usage result information includes a notification message or the electronic seal file. The notification message is used to invite the terminal device to download the electronic seal file from the storage location.

7. An electronic seal generating device, characterized in that, The device includes: The seal application module is used to respond to a seal application request sent by a terminal device based on a first service, generate a corresponding seal application task, and place the seal application task into a seal application task queue. The seal application task is used to generate an electronic seal file. The first service is implemented based on a distributed system. The seal application module is also used to asynchronously execute seal application tasks in the seal application task queue based on the first service, and generate electronic seal files corresponding to the seal application tasks; The stamping module is also used to cache the electronic stamp file in a preset storage location; The result sending module is used to detect the storage location at a second preset period based on the second service. After detecting the electronic seal file, it obtains the identification code of the electronic seal file and sends the seal usage result information to the terminal device indicated by the identification code. The seal usage result information is used to enable the terminal device to obtain the electronic seal file corresponding to the seal usage request. The second service is independent of the first service. The load balancing module is used to receive a stamping request sent by the terminal device based on a third service; detect the load information of each first service, wherein the load information represents the number of stamping tasks in the stamping task queue corresponding to the first service, or the number of available threads corresponding to the first service; determine the target first service based on the load information of each first service, and send the stamping request to the target first service; The stamping module is also used to count the number of times the currently executed stamping task is executed based on the first service; if the number of times the currently executed stamping task is executed is greater than the number threshold, the currently executed stamping task is marked as an abnormal task. The result sending module is further configured to send a failure notification to the terminal device based on the second service, wherein the failure notification indicates that the abnormal task has failed to execute. The stamping module is also used to obtain an abnormal task queue, the abnormal task queue including at least one of the abnormal tasks; when the load information of the first service is less than the load threshold, the abnormal task in the abnormal task queue is executed based on a first preset period.

8. An electronic device, comprising: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the electronic seal generation method as described in any one of claims 1-6.

10. A computer program product comprising a computer program that, when executed by a processor, implements the electronic seal generation method according to any one of claims 1-6.

Citation Information

Patent Citations

  • File signature method and device based on asynchronous processing and computer equipment

    CN112306977A