Business document transfer method and device, equipment and storage medium
Through message queues, the document transfer interface is uniformly managed in the microservice architecture, which solves the problems of increased response time and system complexity caused by the decentralized interface, improves system performance and reliability, and achieves efficient processing and data consistency of document transfer.
Patent Information
- Application Number
- CN202411379885.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-07
AI Technical Summary
In the microservice architecture, the decentralized document transfer interface lacks unified management, resulting in front-end applications frequently calling multiple interfaces, increasing response time and system maintenance complexity.
The document transfer message is distributed to the microservices responsible for processing through the message queue, and the associated document status is updated based on the feedback update message, simplifying the calling logic of front-end applications, introducing message queue decoupling microservices, ensuring data consistency and efficient processing.
It improves the overall performance and reliability of the system, simplifies system maintenance, realizes unified management of the decentralized document transfer interface, and enhances the easy maintenance and expansion capabilities of the system.
Smart Images

Figure CN119271434A_ABST
Abstract
Description
Background Art
[0002] In recent years, with the continuous development of microservice architecture, business systems with microservice architecture have been increasingly widely used in finance, logistics, e-commerce and other fields. According to the business needs of users, the corresponding microservices in the system are called to provide services and generate corresponding business documents.
[0003] like Figure 1 As shown, in the current system architecture, there are multiple independent document transfer interfaces, each of which interacts directly with the front-end application. When transferring business documents of different document types in batches, the front-end application will call the corresponding document transfer interface according to the document type, and send the business documents of the corresponding type to the microservice responsible for processing the document of this type. The microservice will process these documents and complete the document transfer operation.
[0004] These document transfer interfaces scattered across different microservices lack unified management. Frequent calls to multiple interfaces by front-end applications may increase response time and affect overall performance. The need to maintain multiple different interface call logics also increases the complexity of system maintenance. Summary of the invention
[0005] The embodiments of the present application provide a business document transfer method, apparatus, device and storage medium to solve the problems caused by the decentralized deployment of document transfer interfaces.
[0006] In a first aspect, an embodiment of the present application provides a business document transfer method, which is applied to a first microservice and includes:
[0007] Get multiple documents to be transferred of different document types, and create document transfer messages for each document to be transferred;
[0008] Through the message queue, the corresponding document transfer message is sent to the second microservice for document transfer;
[0009] The document update message fed back by the second microservice is obtained through the message queue, and based on the document update message, the status of the associated document to be transferred is updated.
[0010] Optionally, after creating the document transfer messages for the documents to be transferred respectively, the method further includes:
[0011] Obtain the corresponding document transfer message through the message queue;
[0012] The document transfer is performed for the corresponding document transfer message, and based on the corresponding document transfer result, the status of the associated documents to be transferred is updated.
[0013] Optionally, the performing document transfer on the corresponding document transfer message includes:
[0014] Parsing the corresponding document transfer message to obtain the document to be transferred and document transfer information, wherein the document transfer information includes at least one of transfer information of a responsible person to whom the document belongs and transfer information of an institution to which the document belongs;
[0015] According to the document transfer information, the document management information of the document to be transferred is changed.
[0016] Optionally, before obtaining a plurality of to-be-transferred documents of different document types, the method further includes:
[0017] Get multiple document query requests of different document types;
[0018] Performing a document query for a document query request of a corresponding document type, and sending the document query request of the corresponding document type to the second microservice for document query;
[0019] The candidate business documents queried locally and the candidate business documents queried by the second microservice are sent to the client.
[0020] Optionally, performing a document query on a document query request of a corresponding document type includes:
[0021] Match the document type and document management information of each original business document with the document type and document transfer information of the corresponding document query request;
[0022] The successfully matched original business document is used as a candidate business document.
[0023] Optionally, after obtaining multiple document query requests of different document types, the method further includes:
[0024] The document type of each document query request is matched with the ignored type list respectively, the matched document query requests are discarded, and the unmatched document query requests are continued to be processed.
[0025] Optionally, the method further includes:
[0026] Get document transfer query request;
[0027] A transfer record query is performed in response to the document transfer query request to obtain the document transfer record of the corresponding document to be transferred.
[0028] In a second aspect, an embodiment of the present application further provides a business document transfer device, which is applied to a first microservice and includes:
[0029] An acquisition unit, used for acquiring a plurality of to-be-transferred documents of different document types, and respectively creating a document transfer message for each to-be-transferred document;
[0030] A transfer unit, used to send a corresponding document transfer message to the second microservice through a message queue to transfer the document;
[0031] The updating unit is used to obtain the document update message fed back by the second microservice through the message queue, and update the status of the associated document to be transferred based on the document update message.
[0032] Optionally, after creating the document transfer messages for the documents to be transferred respectively, the business document transfer device is further used to:
[0033] Obtain the corresponding document transfer message through the message queue;
[0034] The document transfer is performed for the corresponding document transfer message, and based on the corresponding document transfer result, the status of the associated documents to be transferred is updated.
[0035] Optionally, the transfer unit is used for:
[0036] Parsing the corresponding document transfer message to obtain the document to be transferred and document transfer information, wherein the document transfer information includes at least one of transfer information of a responsible person to whom the document belongs and transfer information of an institution to which the document belongs;
[0037] According to the document transfer information, the document management information of the document to be transferred is changed.
[0038] Optionally, before acquiring a plurality of documents to be transferred of different document types, the business document transfer device is further used to:
[0039] Get multiple document query requests of different document types;
[0040] Performing a document query for a document query request of a corresponding document type, and sending the document query request of the corresponding document type to the second microservice for document query;
[0041] The candidate business documents queried locally and the candidate business documents queried by the second microservice are sent to the client.
[0042] Optionally, the transfer unit is used for:
[0043] Match the document type and document management information of each original business document with the document type and document transfer information of the corresponding document query request;
[0044] The successfully matched original business document is used as a candidate business document.
[0045] Optionally, after obtaining multiple document query requests of different document types, the business document transfer device further includes a verification unit, and the verification unit is used to:
[0046] The document type of each document query request is matched with the ignored type list respectively, the matched document query requests are discarded, and the unmatched document query requests are continued to be processed.
[0047] Optionally, the business document transfer device is further used for:
[0048] Get document transfer query request;
[0049] A transfer record query is performed in response to the document transfer query request to obtain the document transfer record of the corresponding document to be transferred.
[0050] In a third aspect, an embodiment of the present application further provides a computer device, comprising a processor and a memory, wherein the memory stores program code, and when the program code is executed by the processor, the processor executes the steps of any one of the above-mentioned business document transfer methods.
[0051] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which includes a program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of any one of the above-mentioned business document transfer methods.
[0052] The beneficial effects of this application are as follows:
[0053] The embodiments of the present application provide a business document transfer method, apparatus, device and storage medium. The method applies a first microservice, including: obtaining multiple documents to be transferred of different document types, and creating a document transfer message for each document to be transferred; sending the corresponding document transfer message to a second microservice through a message queue for document transfer, and then obtaining a document update message fed back by the second microservice through the message queue, and updating the status of the associated documents to be transferred based on the document update message.
[0054] In order to improve the management and performance of the business system, this application will unify the management of the document transfer interfaces scattered in different microservices. A first microservice, which is an external document transfer entry, interacts with the front-end application to obtain multiple documents of different document types to be transferred, and creates document transfer messages for each document to be transferred. Through the message queue, the corresponding document transfer message is distributed to the second microservice responsible for processing the document of this type for document transfer, and the status of the associated documents to be transferred is updated according to the document update message fed back by the second microservice. In this way, the calling logic of the front-end application is simplified, the overall performance and reliability of the system are improved, and the introduction of the message queue can also effectively decouple different microservices, ensure data consistency and efficient processing, make the system easier to maintain and expand, and better cope with future changes in demand.
[0055] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0057] Figure 1 A logical diagram for document transfer for the business system of related technologies;
[0058] Figure 2 A unified modeling language class diagram for encapsulating the document transfer function provided in an embodiment of the present application;
[0059] Figure 3A A schematic diagram of the process of transferring a business document of a first microservice provided in an embodiment of the present application;
[0060] Figure 3B A logical diagram of a first microservice transfer business document provided in an embodiment of the present application;
[0061] Figure 3C A schematic diagram of a document transfer creation page provided in an embodiment of the present application;
[0062] Figure 3D A logical diagram of document query for each microservice provided in an embodiment of the present application;
[0063] Figure 3E A logical diagram of document transfer for each microservice provided in an embodiment of the present application;
[0064] Figure 4 A schematic diagram of the structure of a business document transfer device provided in an embodiment of the present application;
[0065] Figure 5 A schematic diagram of the structure of a computer device provided in an embodiment of the present application;
[0066] Figure 6 Schematic diagram of the structure of a computing device in an embodiment of the present application. DETAILED DESCRIPTION
[0067] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the technical solution of the present application, rather than all of the embodiments. Based on the embodiments recorded in the application documents, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the technical solution of the present application.
[0068] Some of the terms used in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.
[0069] 1. Document transfer: In the business process, the process of transferring a business document generated by a certain business or transaction from one entity (such as an individual, department or system) to another entity.
[0070] 2. Message Queue (MQ): It is a technology used for asynchronous communication. Its core principle is to store the messages generated by the sender in the queue, and the receiver obtains the messages from the queue for processing. This mechanism is widely used to solve problems such as application decoupling, asynchronous message processing, and traffic peak shaving to achieve high performance, high availability, scalability, and eventual consistency architecture.
[0071] 3. Spring Boot Starter: It is a core concept in Spring Boot. It greatly simplifies the dependency management and configuration of the project, and provides developers with a way to quickly start and integrate common functions.
[0072] 4. Unified Modeling Language (UML) class diagram: It is a static structure diagram used to describe the classes, interfaces and relationships in a system. The class diagram is one of the most commonly used diagrams in UML. It helps developers and designers visualize the structure of the system and understand the various classes and their interactions.
[0073] UML class diagram mainly includes: Class, Interface, Relationships. Common relationships include: Association, Aggregation, Composition, Inheritance, Dependency and Realization.
[0074] The following is a brief introduction to the design concept of the embodiment of the present application:
[0075] In recent years, with the continuous development of microservice architecture, business systems with microservice architecture have been increasingly widely used in finance, logistics, e-commerce and other fields. According to the business needs of users, the corresponding microservices in the system are called to provide services and generate corresponding business documents.
[0076] like Figure 1 As shown, in the current system architecture, there are multiple independent document transfer interfaces, each of which interacts directly with the front-end application. When transferring business documents of different document types in batches, the front-end application will call the corresponding document transfer interface according to the document type, and send the business documents of the corresponding type to the microservice responsible for processing the document of this type. The microservice will process these documents and complete the document transfer operation.
[0077] These document transfer interfaces scattered across different microservices lack unified management. Frequent calls to multiple interfaces by front-end applications may increase response time and affect overall performance. The need to maintain multiple different interface call logics also increases the complexity of system maintenance.
[0078] In view of this, the embodiments of the present application provide a business document transfer method, device, equipment and storage medium. The method is applied to a first microservice, including: obtaining multiple documents to be transferred of different document types, and creating document transfer messages for each document to be transferred; sending the corresponding document transfer message to the second microservice through a message queue for document transfer, and then obtaining the document update message fed back by the second microservice through the message queue, and updating the status of the associated documents to be transferred based on the document update message.
[0079] In order to improve the management and performance of the business system, this application will unify the management of the document transfer interfaces scattered in different microservices. A first microservice, which is an external document transfer entry, interacts with the front-end application to obtain multiple documents of different document types to be transferred, and creates document transfer messages for each document to be transferred. Through the message queue, the corresponding document transfer message is distributed to the second microservice responsible for processing the document of this type for document transfer, and the status of the associated documents to be transferred is updated according to the document update message fed back by the second microservice. In this way, the calling logic of the front-end application is simplified, the overall performance and reliability of the system are improved, and the introduction of the message queue can also effectively decouple different microservices, ensure data consistency and efficient processing, make the system easier to maintain and expand, and better cope with future changes in demand.
[0080] The preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. In addition, the embodiments and features in the embodiments of the present application may be combined with each other if there is no conflict.
[0081] In order to achieve unified management of decentralized document transfer interfaces, this application configures various configuration items for the document transfer interface of each microservice, declares whether each microservice has the ability to transfer and update status, and abstracts and standardizes the document transfer function by defining interfaces and classes related to the document transfer function. The document transfer function is abstracted into a document transfer software development kit (SDK), and then the document transfer SDK is registered in the Spring Boot container to obtain Spring Boot Starter, and the document transfer interface of each microservice is registered in the SpringBoot container. Each microservice relies on Spring Boo Starter through the document transfer interface, calls the methods in each interface and class in the document transfer SDK, performs corresponding operations, and provides users with a variety of document transfer related services such as document query, document transfer record query, and status update.
[0082] Take a document transfer interface as an example, and configure the configuration items in Table 1 for the document transfer interface. When the configuration values of the configuration items application.bizTransfer.enabled and application.bizTransfer.updateTaskProgress are true, the document transfer interface serves as an external document transfer entry, and the microservice corresponding to the document transfer interface serves as the first microservice, providing users with a variety of document transfer related services such as document query, document transfer record query, and status update. When the configuration value of the configuration item application.bizTransfer.enabled is true, but the configuration value of the configuration item application.bizTransfer.updateTaskProgress is false, the document transfer interface cannot interact directly with the front-end application, and its corresponding microservice serves as the second microservice, transfers the corresponding type of business documents, and feeds back the document update message to the first microservice, so that the first microservice updates the status of the associated documents to be transferred based on the document update message.
[0083] When there are multiple document transfer interfaces in the business system, only one of them can be selected as the external document transfer entry. The better way is to fixedly select the document transfer interface of a certain microservice as the external document transfer entry. At the same time, the operation of updating the status of the document to be transferred is also placed in the first microservice to avoid unnecessary troubles in operation and maintenance, problem troubleshooting, etc. due to the front-end application calling multiple document transfer interfaces at the same time.
[0084] Table 1
[0085]
[0086] This application abstracts and standardizes the document transfer function by defining the following interfaces and classes related to the document transfer function, and abstracts the document transfer function into an SDK.
[0087] (1) Define the document transfer interface class BizTransferController.
[0088] This class is the entry for external document transfers and requires the following core interfaces to be configured: getBiztransferTypes(), used to obtain the document type of the business document;
[0089] queryTodoSummary(BizTransferRequestrequest), used to query documents;
[0090] queryTodoDetail(BizTransferRequestrequest), used to query document details in pages;
[0091] excute(BizTransgerQueryRequestrequest), submit document transfer message;
[0092] queryList(BizTransferQueryRequestrequest) is used to query the documents to be transferred in pages; queryDetailList(BizTransferDetailQueryRequestrequest) is used to query the details of the documents to be transferred in pages (including the created document transfer message, processing progress, transfer status, and transfer results).
[0093] (2) Define the business processing class BizTransferService related to the document transfer function.
[0094] This class is used to unify the functions related to document transfer, such as querying documents to be transferred, processing documents to be transferred, updating the status of documents to be transferred, connecting to queues, etc. This class includes the following interfaces: getBiztransferTypes(), used to obtain the document type of the business document;
[0095] queryTodoSummary(BizTransferRequestrequest), used to query documents;
[0096] queryTodoDetail(BizTransferRequestrequest), used to query document details in pages;
[0097] excute(BizTransgerQueryRequestrequest), submit document transfer message;
[0098] queryList(BizTransferQueryRequestrequest) is used to query the documents to be transferred in pages; queryDetailList(BizTransferDetailQueryRequestrequest) is used to query the details of the documents to be transferred in pages (including the created document transfer message, processing progress, transfer status, and transfer results).
[0099] (3) Define the functional database operation class BizTransferMapper.
[0100] This class is used to implement interaction with the database, such as saving document transfer messages, querying document transfer records, updating the status of documents to be transferred, calling interfaces, etc. This class includes the following interfaces: insert(BizTransferEntityentity), used to insert business documents of the specified document type;
[0101] insertDetailList(List <biztransferdetailentity>list), used to insert the document detail list of a business document; updateDetail(BizTransferDetailEnity entity), used to update the document transfer process and results of a specific business document (such as the start time, end time, transfer result, and error messages during the transfer process, etc.); updateSelective(BizTransferEnity entity), used to update the processing progress, status, and results of the document to be transferred; selectList(BizTransferQueryRequestrequest), used to select the business document that meets the document transfer request;
[0102] selectDetailList(BizTransferDetailQueryRequestrequest) is used to select the document details that meet the document transfer request.
[0103] (4) Define the document transfer processing interface BizTransferHandler.
[0104] This class includes three core methods: BizTypeEnum getType(), which defines the document type of the business document; Page <biztransfertodo>queryTodoList(BizTransferTodoQuery query), used to query candidate business documents that meet the document query request; void execute(StringbizNo,BizOwner bizOwner), used to execute the document transfer operation, where bizNo represents the business document number, and bizOwner represents at least one of the transfer information of the person in charge of the document and the transfer information of the organization to which the document belongs.
[0105] (5) Define the document transfer message queue message processing class BizTransferMessageHandler.
[0106] This class is used to consume document transfer messages in the message queue. According to the document type, it calls the execute method of its document transfer processing interface implementation class to perform the document transfer operation. It records the processing process and results of the document transfer message, and also records the transfer process and results of the business document (such as the start time and end time of the document transfer, possible error information during the transfer process, etc.).
[0107] (6) Define the document transfer Bean object registration class BizTransferBeanRegistrar.
[0108] This class is used to automatically register the core objects related to document transfer into the SpringBoot container. The core objects mainly include: business processing classes related to the document transfer function, functional database operation classes, document transfer processing interfaces, etc.
[0109] (7) Define the document transfer enabling annotation class EnableBizTransfer.
[0110] This class contains multiple annotation tags. The @Import annotation tag automatically executes the document transfer Bean object registration class, reads the configuration items through the @ConditionalOnProperty annotation tag, and confirms whether the microservice has started the document transfer function.
[0111] The document transfer SDK has configured the dependencies between various interfaces and classes and their specific configuration information, such as Figure 2 As shown, the Spring Boot container can deploy the specific configuration information of each interface and class into the Spring Boot container based on the dependencies between the interfaces and classes.
[0112] exist Figure 2 In the UML class diagram shown, BizTransferMapper and BizTransferHandler both rely on BizTransferService and BizTransferMessageHandler to implement interaction with the database and perform document transfer operations. BizTransferService relies on BizTransferController to implement functions such as querying documents and paging querying the details of documents to be transferred. BizTransferBeanRegistrar relies on EnableBizTransfer, reads configuration items through the @ConditionalOnProperty annotation mark, and confirms whether the microservice has started the document transfer function. When the microservice starts the document transfer function, the document transfer Bean object registration class is automatically executed through the @Import annotation mark of this class, and the core objects related to document transfer such as BizTransferController, BizTransferService, and BizTransferMapper are registered in the Spring container, so that this Spring Boot Starter has the document transfer function. Each microservice only needs to rely on Spring Boo Starter through the document transfer interface to quickly have the document transfer capability.
[0113] In related technologies, when a new microservice adds a document transfer function, it is necessary to modify the code of the microservice and add code for performing document transfer related operations before it can access the backend. At the same time, it is necessary to inform the front-end application of the Uniform Resource Locator (URL) address of the document transfer interface so that the front-end application can call the document transfer interface and the corresponding microservice will provide the document transfer service.
[0114] However, this application decouples the microservice's ability to transfer documents from specific implementation operations. When adding the document transfer function to a new microservice, the configuration item of the document transfer interface of the new microservice is modified to declare that it has the document transfer function, and the document transfer interface is registered in the Spring Boot container, so that the new microservice depends on Spring Boot Starter, and the methods in each interface and class in the document transfer SDK are called to perform specific document transfer-related operations. The document types supported by the new microservice, the access address of the new microservice, and the URL address of its document transfer interface are written into the configuration item of the document transfer interface of the first microservice to implement communication with the first microservice, receive query requests forwarded by the first microservice, and feedback query results to the first microservice.
[0115] Compared with traditional operations, this application unifies the document transfer entry for connecting to the front-end application. When the new microservice is connected to the document transfer function, there is no need to adjust the front-end code, and only the back-end connection is required. When connecting to the back-end, by registering the document transfer interface with the Spring Boot container, the new microservice depends on Spring Boot Starter, calling the methods in each interface and class in the document transfer SDK, and performing specific document transfer related operations, there is no need to separately configure the code for the new microservice to perform document transfer operations, and document transfer related operations can be implemented. The changes to the back-end are also relatively small, which is convenient for adding new microservices with document transfer functions to the business system, improving the scalability of the system, and also convenient for applying the business system architecture to other fields with document transfer requirements, improving the reusability of the system.
[0116] However, for microservices that need to transfer documents, you need to manually add the @EnableBizTransfer annotation tag to the Spring Boot project startup class to truly enable the document transfer function support of the microservice.
[0117] Combination Figure 3A-3B The schematic diagram shown introduces the specific implementation process of the first microservice transferring the business document using the method provided by the present application.
[0118] S301: Acquire multiple documents to be transferred of different document types, and create a document transfer message for each document to be transferred.
[0119] The document transfer interface of the first microservice interacts with the front-end client as an external document transfer entry. Before executing step 301, the first microservice obtains multiple document query requests of different document types, performs document query for the document query requests of the corresponding document types, and sends the document query requests of the corresponding document types to the second microservice for document query through the calling technology between microservices; then the candidate business documents queried locally and the candidate business documents queried by the second microservice are sent to the client.
[0120] Each microservice performs the same steps for document query operations. Taking the first microservice as an example, the process of performing document query for a document query request of the corresponding document type is as follows: the document type and document management information of each original business document are matched with the document type and document transfer information of the corresponding document query request, and the original business document that has been successfully matched is used as a candidate business document.
[0121] Generally speaking, the business system controls the user's document permissions based on the organization to which the document belongs, the person responsible for the document, the organization to which the user belongs, and the user's job permissions, and determines which business documents each user can query and process. Therefore, the reasons for document transfer can be divided into two categories: changing the person responsible for the document and changing the organization to which the document belongs. Figure 3C In the document transfer creation page shown, the user fills in the reason for document transfer, document type, etc. The original responsible person and the new responsible person are the transfer information of the responsible person of the document, and the organization to which the original responsible person belongs and the organization to which the new responsible person belongs are the transfer information of the organization to which the document belongs. Both the transfer information of the responsible person of the document and the transfer information of the organization to which the document belongs can be used as the document transfer information of this application.
[0122] However, after obtaining multiple document query requests of different document types, before performing the document query, the first microservice first matches the document type of each document query request with the ignored type list, discards the matched document query requests, and continues to process the unmatched document query requests. The first microservice then performs information verification on each received document query request, such as verifying whether the responsible person before and after the transfer exists, verifying whether the document transfer reason and document type are filled in, and verifying whether the filled-in document transfer reason is reasonable. If the verification succeeds, continue to process each document query request; if the verification fails, refuse to process the corresponding request.
[0123] like Figure 3D As shown, the order management service receives the order query request and customer query request submitted by the client through the document transfer interface. The order management service calls the document transfer processing interface defined in Starter, implements the class method to process the order query request, and performs document query in the local database. The order management service calls the document transfer interface of the customer management service in the Hypertext Transfer Protocol (HTTP) mode, forwards the customer query request to the customer management service, and makes the customer management service call the document transfer processing interface defined in Starter, implements the class method to process the order query request, performs document query in its corresponding database, and calls the document transfer interface of the first microservice in HTTP mode, and returns the query result to the first microservice.
[0124] The first microservice sends the candidate business documents queried locally and the candidate business documents queried by the second microservice to the client, and the client then sends the to-be-transferred business selected by the user from multiple candidate business documents to the first microservice for processing.
[0125] The first microservice creates a document transfer message for each document to be transferred. A document transfer message includes: document type, document transfer information and the document to be transferred. The first microservice associates each document to be transferred with the corresponding document transfer message and stores it in a local database, and at the same time, adds each created document transfer message to the message queue.
[0126] S302: Send the corresponding document transfer message to the second microservice through the message queue to transfer the document.
[0127] Assume that the message queue broadcasts the document transfer message in the queue to all microservices. Each microservice will determine whether the document transfer message belongs to the processing scope of this service according to the document type. If so, the microservice calls the document transfer processing interface defined in Starter to implement the class method to process the message; otherwise, the message is discarded without any processing.
[0128] However, this may result in multiple microservices processing the same business document, causing confusion in document management. Therefore, in order to avoid this situation, this application puts the judgment authority into the message queue, and the message queue distributes the corresponding document transfer message to the microservice responsible for processing the document of that type for document transfer according to the document type.
[0129] When the first microservice can process the corresponding type of business document, it will obtain the corresponding document transfer message through the message queue, and the first microservice will transfer the document for the corresponding document transfer message. After the first microservice completes the document transfer operation, it will also update the status of the associated documents to be transferred based on the corresponding document transfer result.
[0130] Among them, the process of transferring a document to be transferred by the first microservice is as follows: parsing the corresponding document transfer message, obtaining the document to be transferred and the document transfer information, the document transfer information includes: at least one of the transfer information of the person responsible for the document and the transfer information of the institution to which the document belongs; then according to the document transfer information, the document management information of the document to be transferred is changed.
[0131] When the second microservice can process the corresponding type of business document, it will obtain the corresponding document transfer message through the message queue, and the second microservice will transfer the document for the corresponding document transfer message. The steps for the second microservice to perform the document transfer operation are the same as those of the first microservice, and will not be repeated here.
[0132] S303: Obtain the document update message fed back by the second microservice through the message queue, and update the status of the associated document to be transferred based on the document update message.
[0133] The first microservice supports status updates for documents to be transferred, but the second microservice does not support this function. Therefore, the first microservice needs to read the document update message fed back by the second microservice from the message queue, and based on the document update message, update the status of the associated documents to be transferred (including the processing progress, transfer status, and transfer results of the documents to be transferred).
[0134] This application introduces message queue technology to decouple the generation of document transfer messages from the processing of document transfer messages. The message queue distributes the corresponding document transfer message to the microservice responsible for processing this type of document for document transfer, and sends the document update message fed back by the second microservice to the first microservice for status update. By interacting with different microservices, asynchronous processing of each type of business document is achieved to ensure data consistency and efficient processing.
[0135] like Figure 3E As shown, the message queue sends the sales order transfer message to the order management service for processing, and sends the customer transfer message to the customer management service for processing. The order management service consumes the sales order transfer message, performs the sales application transfer on the relevant business document, and updates the processing progress, transfer status, and transfer result of the business document. The customer management service consumes the customer transfer message, performs the customer transfer on the relevant business document, and updates the transfer result of the business document. The customer management service publishes the transfer result as a document update message to the message queue, and the message queue forwards the message to the order management service. The order management service consumes the document update message and updates the processing progress and transfer status of the relevant business document.
[0136] The first microservice can also obtain a document transfer query request through the document transfer interface, query the transfer record for the document transfer query request, and obtain the document transfer record of the corresponding document to be transferred. The document transfer record includes: the business serial number of the document to be transferred, the document content, the processing progress, the transfer status and the transfer result.
[0137] Based on the same inventive concept as the above method embodiment, the present application embodiment also provides a business document transfer device applied to the first microservice. Figure 4 As shown, the business document transfer device 400 may include:
[0138] An acquisition unit 401 is used to acquire multiple documents to be transferred of different document types and to create a document transfer message for each document to be transferred;
[0139] The transfer unit 402 is used to send the corresponding document transfer message to the second microservice through the message queue to transfer the document;
[0140] The updating unit 403 is used to obtain the document update message fed back by the second microservice through the message queue, and update the status of the associated document to be transferred based on the document update message.
[0141] Optionally, after creating the document transfer messages for the documents to be transferred respectively, the business document transfer apparatus 400 is further used to:
[0142] Obtain the corresponding document transfer message through the message queue;
[0143] The document transfer is performed for the corresponding document transfer message, and based on the corresponding document transfer result, the status of the associated documents to be transferred is updated.
[0144] Optionally, the transfer unit 402 is used to:
[0145] Parsing the corresponding document transfer message to obtain the document to be transferred and document transfer information, wherein the document transfer information includes at least one of transfer information of a responsible person to whom the document belongs and transfer information of an institution to which the document belongs;
[0146] According to the document transfer information, the document management information of the document to be transferred is changed.
[0147] Optionally, before obtaining a plurality of documents to be transferred of different document types, the business document transfer apparatus 400 is further used to:
[0148] Get multiple document query requests of different document types;
[0149] Performing a document query for a document query request of a corresponding document type, and sending the document query request of the corresponding document type to the second microservice for document query;
[0150] The candidate business documents queried locally and the candidate business documents queried by the second microservice are sent to the client.
[0151] Optionally, the transfer unit 402 is used to:
[0152] Match the document type and document management information of each original business document with the document type and document transfer information of the corresponding document query request;
[0153] The successfully matched original business document is used as a candidate business document.
[0154] Optionally, after obtaining multiple document query requests of different document types, the business document transfer apparatus 400 further includes a verification unit 404, and the verification unit 404 is used to:
[0155] The document type of each document query request is matched with the ignored type list respectively, the matched document query requests are discarded, and the unmatched document query requests are continued to be processed.
[0156] Optionally, the business document transfer device 400 is further used for:
[0157] Get document transfer query request;
[0158] A transfer record query is performed in response to the document transfer query request to obtain the document transfer record of the corresponding document to be transferred.
[0159] For the convenience of description, the above parts are divided into modules (or units) according to their functions and described separately. Of course, when implementing this application, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.
[0160] After introducing the business document transfer method and apparatus according to an exemplary embodiment of the present application, next, a computer device according to another exemplary embodiment of the present application is introduced.
[0161] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "system".
[0162] Based on the same inventive concept as the above method embodiment, the present application embodiment also provides a computer device, see Figure 5 As shown, the computer device 500 may include at least a processor 501 and a memory 502. The memory 502 stores program codes, and when the program codes are executed by the processor 501, the processor 501 executes the steps of any one of the above-mentioned business document transfer methods.
[0163] In some possible implementations, the computing device according to the present application may include at least one processor and at least one memory. The memory stores program code, and when the program code is executed by the processor, the processor executes the steps of the business document transfer method according to various exemplary implementations of the present application described above in this specification. For example, the processor may execute the following steps: Figure 3A Follow the steps shown in .
[0164] Refer to the following Figure 6 hereinafter, a computing device 600 according to this embodiment of the present application is described. Figure 6 The computing device 600 is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0165] like Figure 6 As shown, the computing device 600 is in the form of a general computing device. The components of the computing device 600 may include but are not limited to: at least one processing unit 601, at least one storage unit 602, and a bus 603 connecting different system components (including the storage unit 602 and the processing unit 601).
[0166] Bus 603 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a processor, or a local bus using any of a variety of bus architectures.
[0167] The storage unit 602 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 6021 and / or a cache memory unit 6022 , and may further include a read-only memory (ROM) 6023 .
[0168] The storage unit 602 may also include a program / utility 6025 having a set (at least one) of program modules 6024, such program modules 6024 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0169] The computing device 600 may also communicate with one or more external devices 604 (e.g., keyboards, pointing devices, etc.), one or more devices that enable a user to interact with the computing device 600, and / or any device that enables the computing device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 605. In addition, the computing device 600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 606. As shown, the network adapter 606 communicates with other modules for the computing device 600 via a bus 603. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the computing device 600, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0170] Based on the same inventive concept as the above method embodiment, various aspects of the business document transfer method provided by the present application can also be implemented in the form of a program product, which includes program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of the business document transfer method according to various exemplary embodiments of the present application described above in this specification. For example, the computer device can execute the following steps: Figure 3A Follow the steps shown in .
[0171] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0172] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0173] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.< / biztransfertodo> < / biztransferdetailentity>
Claims
1. A business document transfer method, characterized in that: The method is applied to a first microservice, comprising: Get multiple documents to be transferred of different document types, and create document transfer messages for each document to be transferred; Through the message queue, the corresponding document transfer message is sent to the second microservice for document transfer; The document update message fed back by the second microservice is obtained through the message queue, and based on the document update message, the status of the associated document to be transferred is updated.
2. The method according to claim 1, characterized in that After creating the document transfer messages for the documents to be transferred respectively, the method further includes: Obtain the corresponding document transfer message through the message queue; The document transfer is performed for the corresponding document transfer message, and based on the corresponding document transfer result, the status of the associated documents to be transferred is updated.
3. The method according to claim 2, characterized in that The document transfer of the corresponding document transfer message includes: Parsing the corresponding document transfer message to obtain the document to be transferred and document transfer information, wherein the document transfer information includes at least one of transfer information of a responsible person to whom the document belongs and transfer information of an institution to which the document belongs; According to the document transfer information, the document management information of the document to be transferred is changed.
4. The method according to claim 1, characterized in that Before obtaining a plurality of to-be-transferred documents of different document types, the method further includes: Get multiple document query requests of different document types; Performing a document query for a document query request of a corresponding document type, and sending the document query request of the corresponding document type to the second microservice for document query; The candidate business documents queried locally and the candidate business documents queried by the second microservice are sent to the client.
5. The method according to claim 4, characterized in that The document query request for the corresponding document type includes: Match the document type and document management information of each original business document with the document type and document transfer information of the corresponding document query request; The successfully matched original business document is used as a candidate business document.
6. The method according to claim 4, characterized in that After obtaining multiple document query requests of different document types, the method further includes: The document type of each document query request is matched with the ignored type list, the matched document query requests are discarded, and the unmatched document query requests are continued to be processed.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Get document transfer query request; A transfer record query is performed in response to the document transfer query request to obtain the document transfer record of the corresponding document to be transferred.
8. A business document transfer device, characterized in that: The device is applied to a first microservice, including: An acquisition unit, used for acquiring a plurality of to-be-transferred documents of different document types, and respectively creating a document transfer message for each to-be-transferred document; A transfer unit, used to send a corresponding document transfer message to the second microservice through a message queue to transfer the document; The updating unit is used to obtain the document update message fed back by the second microservice through the message queue, and update the status of the associated document to be transferred based on the document update message.
9. A computer device, characterized in that: The method comprises a processor and a memory, wherein the memory stores program codes, and when the program codes are executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: It includes program code. When the program product is run on a computer device, the program code is used to make the computer device execute the steps of the method according to any one of claims 1 to 7.