A message system, message processing method, device and equipment

By designing a message system of the message processing module and the message routing module, the problem of inability to modify the message content in the prior art is solved, and the efficiency and flexibility of message processing are improved.

CN115514814BActive Publication Date: 2025-06-13JIALIAN PAYMENTS CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110693117.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-22
Publication Date
2025-06-13
Estimated Expiration
2041-06-22

AI Technical Summary

Technical Problem

Existing transaction-based message middleware cannot modify the business message content during message delivery, resulting in reduced efficiency and maintainability.

Method used

A message system is designed, including a message processing module and a message routing module. The service messages are initialized, submitted and canceled through the message processing module, and the basic information of the service messages is stored through the message routing module to support these operations.

Benefits of technology

It improves the efficiency and flexibility of message processing, enables the service message content to be modified during message delivery, and enhances the maintainability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115514814B_ABST
    Figure CN115514814B_ABST
Patent Text Reader

Abstract

The present application discloses a message system, a message processing method, apparatus and device, including: a message processing module and a message routing module. The message processing module is used to perform initialization operations, submission operations or cancellation operations on business messages corresponding to the business services of the business system. Among them, the business service is a service corresponding to the access request of the business system, and the access request is a request for the business system to request access to the message system. The message routing module is used to store the basic information of the business message, so that the message processing module can perform corresponding initialization operations, submission operations or cancellation operations on the business message according to the basic information. Through the interaction between the message processing module and the message routing module of the message system and the business system, the present application realizes the initialization operation, submission operation or cancellation operation of the business message, improving the message processing efficiency and flexibility.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technologies, and particularly to a message system, a message processing method, a device, and a device. Background Art

[0002] Message middleware is a common component in software systems and is mostly used in communication scenarios between multiple services in a microservices architecture. It usually has the capabilities of message accumulation and persistence. Using message middleware can alleviate communication loss, timeouts, and other problems caused by fluctuations or inconsistencies in processing capabilities between services.

[0003] For message middleware that uses the "initialize → commit / cancel" mode to send messages for transaction-based messages, the producer needs to initialize the message, execute the business logic, and then commit or cancel to determine whether the message is pushed to the consumer. The native API of such message middleware limits that the content of the business message must be provided in the initialization stage and cannot be modified during the message delivery process, reducing the efficiency and maintainability of message delivery. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a message system, a message processing method, a device, and a device. In addition, the present invention also provides a corresponding storage medium, which can improve the efficiency and flexibility of message processing. The specific solutions are as follows:

[0005] The first aspect of the present application provides a message system, including: a message processing module and a message routing module, where:

[0006] The message processing module is used to perform an initialization operation, a submission operation, or a cancellation operation on a business message corresponding to a business service of a business system; wherein, the business service is a service corresponding to an access request of the business system, and the access request is a request for the business system to access the message system;

[0007] The message routing module is used to store the basic information of the business message, so that the message processing module performs corresponding initialization operations, submission operations, or cancellation operations on the business message according to the basic information.

[0008] Optionally, the message processing module includes a message initialization unit, a message submission unit, and a message cancellation unit, where:

[0009] The message initialization unit is used to perform an initialization operation according to the message to be initialized corresponding to the initialization service of the business system;

[0010] The message submission unit is used to perform a submission operation according to the message to be submitted corresponding to the message submission service of the business system;

[0011] The message cancellation unit is configured to perform a cancellation operation according to the message to be cancelled corresponding to the message cancellation service of the service system.

[0012] Optionally, the message initialization unit is configured to configure the basic information of the message to be initialized, and store the configured basic information of the message to be initialized in the message routing module by means of a remote dictionary service.

[0013] Optionally, the configured message to be initialized is further set with a corresponding expiration time.

[0014] Optionally, the message submission unit is configured to obtain the delivery address of the message to be submitted from the basic information of the message routing module, and send the message to be submitted and the corresponding delivery address to the message middleware, so that the message middleware delivers the message to be submitted according to the delivery address.

[0015] Optionally, the message processing module further includes:

[0016] The first status update unit is configured to update the status corresponding to the service message to the initialization status after initializing the service message;

[0017] The second status update unit is configured to update the status corresponding to the service message to the submitted status after submitting the service message;

[0018] The third status update unit is configured to update the status corresponding to the service message to the cancelled status after cancelling the service message.

[0019] The second aspect of the present application provides a message processing method, based on the foregoing message system, including:

[0020] Obtaining an access request of a service system and an application interface of a service provided by the message system corresponding to the access request; wherein, the access request is a request for the service system to request access to the message system;

[0021] Establishing a connection relationship between the service system and the message system through the application interface, and using the message system to perform an initialization operation, a submission operation or a cancellation operation on a service message corresponding to the service to respond to the service.

[0022] Optionally, the application interface is constructed based on the Hypertext Transfer Protocol.

[0023] The third aspect of the present application provides a message processing device, based on the foregoing message system, including:

[0024] An acquisition module, configured to acquire an access request of a service system and an application interface of a service provided by the message system corresponding to the access request; wherein, the access request is a request for the service system to request access to the message system;

[0025] A service response module, configured to establish a connection relationship between the service system and the message system through the application interface, and use the message system to process a service message corresponding to the service to respond to the service.

[0026] A fourth aspect of the present application provides an electronic device, which includes a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the foregoing message processing method.

[0027] A fifth aspect of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are loaded and executed by a processor, the foregoing message processing method is implemented.

[0028] In the present application, the message system includes a message processing module and a message routing module. Among them, the message processing module is configured to perform an initialization operation, a submission operation, or a cancellation operation on a service message corresponding to the service of the service system; wherein, the service is a service corresponding to the access request of the service system, and the access request is a request for the service system to request access to the message system; the message routing module is configured to store basic information of the service message, so that the message processing module performs corresponding initialization operations, submission operations, or cancellation operations on the service message according to the basic information. The present application interacts with the service system through the message processing module and the message routing module of the message system to implement the initialization operation, submission operation, or cancellation operation of the service message, improving message processing efficiency and flexibility. Description of the Drawings

[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.

[0030] Figure 1 It is a structure diagram of a message system provided by the present application;

[0031] Figure 2 It is a specific message system interaction structure diagram provided by the present application;

[0032] Figure 3 A specific implementation logic diagram of the message system provided for this application;

[0033] Figure 4 A message initialization flowchart provided for this application;

[0034] Figure 5 A message submission flowchart provided for this application;

[0035] Figure 6 A message cancellation flowchart provided for this application;

[0036] Figure 7 A message processing method flowchart provided for this application;

[0037] Figure 8 A schematic structural diagram of a message processing device provided for this application;

[0038] Figure 9 A structural diagram of a message processing electronic device provided for this application. Detailed implementation manners

[0039] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0040] Existing message middleware for sending messages based on transactions adopts an "initialization → submission / cancellation" mode. The producer needs to initialize the message, execute the business logic, and then submit or cancel to determine whether the message is pushed to the consumer. The native API of such message middleware limits that the content of the business message must be provided in the initialization stage and cannot be modified during the message delivery process, reducing the efficiency and maintainability of message delivery. To address the above technical deficiencies, this application provides a message system and a message processing solution. Through the message processing module and the message routing module of the message system, an interaction is performed with the business system to implement the initialization operation, submission operation, or cancellation operation of the business message, improving the message processing efficiency and flexibility.

[0041] Figure 1 A message system structure diagram provided for this application. Refer to Figure 1 As shown, the message system 01 includes a message processing module 011 and a message routing module 012, where:

[0042] The message processing module 011 is used to perform initialization operations, submission operations, or cancellation operations on business messages corresponding to the business services of the business system; wherein, the business service is a service corresponding to the access request of the business system, and the access request is a request for the business system to access the message system. The message routing module 012 is used to store the basic information of the business message, so that the message processing module can perform corresponding initialization operations, submission operations, or cancellation operations on the business message according to the basic information. That is, the message routing module 012 stores different message types, corresponding topics, and delivery methods, and provides data to the message processing module 011. The business service can be initializing business messages, submitting business messages, canceling business messages, etc. In this embodiment, the message processing module 011 and the message routing module correspond to different programs, and in the architecture of containerized microservices, they can be virtualized servers.

[0043] Further, Figure 2 As a specific message system interaction structure diagram provided by this application, as Figure 2 shown, data interaction occurs between the message system 01, the business system 02, and the message middleware 03 to respond to business messages corresponding to the business services of the business system 02. In this embodiment, the message system 01 provides an interface of the Hypertext Transfer Protocol (HTTP protocol) for the business service, without introducing additional dependencies, and only using common HTTP clients / servers can complete the access. The business system 02 directly sends an HTTP request to this service to complete operations such as initialization, submission, and cancellation of messages. Of course, in addition to the HTTP protocol, the message system 01 retains the extensibility to access other protocols, such as the Thrift protocol, etc., and this application embodiment does not limit this.

[0044] In this embodiment, the business system 02 can be various programs that need to send communication messages. Here, it can be a payment transaction system, and the transaction system sends transaction-related data messages to the accounting system through the message system 01. The business message refers to the message sent by the business system 02 to the message middleware 03 through the message system 01. The message middleware 03 in this embodiment is RocketMQ, where RocketMQ is a widely used message middleware, and its message persistence and accumulation capabilities, transaction-based messages, retry push, etc. are widely used in software systems in the payment transaction-related industries. By the message system 01 performing transfer processing on the business messages of the business system 02, it is possible to change the content of the business messages during the message initialization and message submission stages, improving the maintainability and flexibility of the message system 01. For the specific implementation logic, refer to Figure 3 the implementation logic shown.

[0045] Correspondingly, the message processing module 011 includes a message initialization unit, a message submission unit, and a message cancellation unit, where: the message initialization unit is used to perform an initialization operation according to the to-be-initialized message corresponding to the initialization service of the service system 02; the message submission unit is used to perform a submission operation according to the to-be-submitted message corresponding to the message submission service of the service system 02; the message cancellation unit is used to perform a cancellation operation according to the to-be-cancelled message corresponding to the message cancellation service of the service system 02.

[0046] Specifically, the message initialization unit is used to configure the basic information of the to-be-initialized message, and store the configured basic information of the to-be-initialized message in the message routing module 012 through the remote dictionary service. An initialization message will create a message record inside the message system 01, and this record stores information such as the id, content, and delivery status of the service message. Among them, the id of the service message is generally a unique id assigned by the service system 02 to each service message, usually a string such as a transaction order number. In the message system 01, different message types correspond to the topic to which the service message will be delivered and the interface address for message status query. The delivery status of the service message in the message system 01 can be divided into an initialization state, a submitted state, a cancelled state, etc., and the delivery status is mainly used in the context of message status query.

[0047] As Figure 4 shown, when an initialization operation is initiated, the message routing module 012 first obtains the basic information of the message configuration, then initializes and performs corresponding configuration on the basic information, and stores the configured basic information of the to-be-initialized message in the message routing module 012 through the remote dictionary service. Of course, in order to improve the response efficiency, the configured basic information of the to-be-initialized message can also be directly stored on the message processing module 01 through the remote dictionary service. The remote dictionary service (Redis) is a remote in-memory database, which has characteristics such as high availability, high concurrency, and high scalability. In addition, in order to improve the timeliness of the message, the configured to-be-initialized message can also be set with a corresponding expiration time. The information about the service message stored in Redis includes message type, message id, message delivery status, service message content, etc.

[0048] The message submission unit is used to obtain the delivery address of the message to be submitted from the basic information of the message routing module 012, and send the message to be submitted and the corresponding delivery address to the message middleware 03, so that the message middleware 03 delivers the message to be submitted according to the delivery address. As Figure 5 shown, when initiating a message submission operation, the business message to be submitted is determined by querying Redis, and then the basic configuration of the business message is queried through the message routing module 012, and then the business message is sent to RocketMQ, and the delivery status of the message record in the system is modified to the submitted status. In this process, the content of the business message can be updated. In this embodiment, the status of the message to be submitted is the initialization status, that is, when submitting the message, the message content with the initialization status is sent to the corresponding topic in RocketMQ. Among them, the topic is a concept in RocketMQ, which is equivalent to the destination of the message. Each topic can have one or more subscribers, that is, the consumer 04. Whenever a new message is sent to the topic, the consumer 04 can obtain this message.

[0049] As Figure 6 shown, when initiating a message cancellation operation, the business message to be cancelled is determined by querying Redis, and then its delivery status is modified to the cancelled status, and subsequent submission or status backcheck cannot be initiated for it. In this embodiment, generally, the status of the business message with the delivery status of the initialization status is modified to obtain the business message with the cancelled status.

[0050] Therefore, it is not difficult to understand that the message processing module 011 further includes: a first status update unit, which is used to update the status corresponding to the business message to the initialization status after initializing the business message; a second status update unit, which is used to update the status corresponding to the business message to the submitted status after submitting the business message; a third status update unit, which is used to update the status corresponding to the business message to the cancelled status after cancelling the business message.

[0051] It can be seen that the message system in the embodiment of the present application includes a message processing module and a message routing module. Among them, the message processing module is used to perform initialization operations, submission operations, or cancellation operations on business messages corresponding to the business services of the business system. Among them, the business service is a service corresponding to the access request of the business system, and the access request is a request for the business system to request access to the message system. The message routing module is used to store the basic information of the business message, so that the message processing module can perform corresponding initialization operations, submission operations, or cancellation operations on the business message according to the basic information. Through the message processing module and the message routing module of the message system in the embodiment of the present application, the message system interacts with the business system to implement the initialization operation, submission operation, or cancellation operation of the business message, improving the message processing efficiency and flexibility.

[0052] Figure 7 It is a flowchart of a message processing method provided by an embodiment of the present application. Refer to Figure 7 As shown, this message processing method is based on the message system described in the foregoing embodiment and includes:

[0053] S11: Obtain an access request of the business system and an application interface of the business service corresponding to the access request provided by the message system; wherein, the access request is a request for the business system to request access to the message system.

[0054] In this embodiment, first obtain an access request of the business system and an application interface of the business service corresponding to the access request provided by the message system. The access request is a request for the business system to request access to the message system, and the business service may be initializing a business message, submitting a business message, canceling a business message, etc.

[0055] S12: Establish a connection relationship between the business system and the message system through the application interface, and use the message system to perform initialization operations, submission operations, or cancellation operations on business messages corresponding to the business service to respond to the business service.

[0056] In this embodiment, after obtaining the access request of the service system and the application interface of the service provided by the message system corresponding to the access request, the service system is further connected to the message system through the application interface, and the message system is used to perform initialization operations, submission operations, or cancellation operations on the service messages corresponding to the service to respond to the service. The message system fully takes over the interaction with the message middleware. The service system only needs to code for the interfaces provided by the message system to be accessed and used, saving learning costs and dependency management costs, and improving development efficiency and maintainability. In addition, the application interface in this embodiment can be built based on the Hypertext Transfer Protocol. Of course, the extensibility of accessing other protocols, such as the Thrift protocol, can also be retained.

[0057] It can be seen that in the embodiment of the present application, the access request of the service system and the application interface of the service provided by the message system corresponding to the access request are first obtained, and then the service system is connected to the message system through the application interface, and the message system is used to perform initialization operations, submission operations, or cancellation operations on the service messages corresponding to the service to respond to the service. In this embodiment, the message system provides application interfaces of different access service types, and the service system indirectly performs initialization operations, submission operations, or cancellation operations on the service messages by docking the message system through this application interface, avoiding the limitations brought by directly processing the service messages through the native application interface of the message middleware.

[0058] See Figure 8 As shown, the embodiment of the present application also correspondingly discloses a message processing device. This message processing device is based on the message system in the foregoing embodiment and includes:

[0059] An obtaining module 11, configured to obtain the access request of the service system and the application interface of the service provided by the message system corresponding to the access request; wherein, the access request is a request for the service system to access the message system;

[0060] A service response module 12, configured to connect the service system to the message system through the application interface, and use the message system to process the service messages corresponding to the service to respond to the service.

[0061] It can be seen that in the embodiment of the present application, the access request of the service system and the application interface of the service provided by the message system corresponding to the access request are first obtained, and then the service system is connected to the message system through the application interface, and the message system is used to perform initialization operations, submission operations, or cancellation operations on the service messages corresponding to the service to respond to the service. In this embodiment, the message system provides application interfaces of different access service types, and the service system indirectly performs initialization operations, submission operations, or cancellation operations on the service messages by docking the message system through this application interface, avoiding the limitations brought by directly processing the service messages through the native application interface of the message middleware.

[0062] Furthermore, the embodiment of the present application also provides an electronic device. Figure 9 It is a structural diagram of an electronic device 20 shown according to an exemplary embodiment, and the content in the figure should not be considered as any limitation to the scope of use of the present application.

[0063] Figure 9 It is a schematic structural diagram of an electronic device 20 provided by the embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the message processing method disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in this embodiment may specifically be a server.

[0064] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows is any communication protocol applicable to the technical solution of the present application, and no specific limitation is imposed on it here; the input / output interface 25 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application needs, and no specific limitation is made here.

[0065] In addition, as a carrier for resource storage, the memory 22 may be a read-only memory, a random access memory, a disk, or an optical disc, etc., and the resources stored thereon may include an operating system 221, a computer program 222, and data 223, etc., and the storage method may be temporary storage or permanent storage.

[0066] Among them, the operating system 221 is used to manage and control each hardware device on the electronic device 20 and the computer program 222, so as to implement the operation and processing of the large amount of data 223 in the memory 22 by the processor 21. It can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the message processing method executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program that can be used to complete other specific tasks. The data 223 may include service messages collected by the electronic device 20.

[0067] Furthermore, an embodiment of the present application also discloses a storage medium in which a computer program is stored. When the computer program is loaded and executed by a processor, the steps of the message processing method disclosed in any of the foregoing embodiments are implemented.

[0068] In this specification, the various embodiments are described in a progressive manner. The focus of each embodiment is on the differences from other embodiments. The same or similar parts among the various embodiments can be referred to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.

[0069] Finally, it should also be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.

[0070] The above has introduced in detail the message system, message processing method, device, equipment and storage medium provided by the present invention. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A message system, characterized in that, it includes a message processing module and a message routing module, where: the message processing module is used to perform initialization operations, submission operations or cancellation operations on business messages corresponding to the business services of the business system; wherein, the business service is a service corresponding to the access request of the business system, and the access request is a request for the business system to request access to the message system; wherein, the message processing module includes a message initialization unit, a message submission unit and a message cancellation unit, where: the message initialization unit is used to perform an initialization operation according to the message to be initialized corresponding to the initialization service of the business system; the message submission unit is used to perform a submission operation according to the message to be submitted corresponding to the message submission service of the business system; the message cancellation unit is used to perform a cancellation operation according to the message to be cancelled corresponding to the message cancellation service of the business system; wherein, the content of the business message can be changed during the message initialization and message submission phases; the message submission unit is used to obtain the delivery address of the message to be submitted from the basic information of the message routing module, and send the message to be submitted and the corresponding delivery address to the message middleware, so that the message middleware delivers the message to be submitted according to the delivery address; wherein, during the delivery process, the status of the business message is modified according to the operation on the business message; the message routing module is used to store the basic information of the business message, so that the message processing module performs corresponding initialization operations, submission operations or cancellation operations on the business message according to the basic information.

2. The message system according to claim 1, characterized in that, the message initialization unit is used to configure the basic information of the message to be initialized, and store the configured basic information of the message to be initialized in the message routing module through the remote dictionary service.

3. The message system according to claim 2, characterized in that, the configured message to be initialized is also set with a corresponding expiration time.

4. The message system according to any one of claims 1 to 3, characterized in that, the message processing module further includes: a first status update unit, which is used to update the status corresponding to the business message to the initialization status after performing an initialization operation on the business message; a second status update unit, which is used to update the status corresponding to the business message to the submitted status after performing a submission operation on the business message; a third status update unit, which is used to update the status corresponding to the business message to the cancelled status after performing a cancellation operation on the business message.

5. A message processing method, characterized in that, based on the message system according to any one of claims 1 to 4, includes: obtaining an access request of the business system and an application interface of the business service corresponding to the access request provided by the message system; wherein, the access request is a request for the business system to request access to the message system; Establish a connection relationship between the business system and the message system through the application interface, and use the message system to perform initialization operations, submission operations, or cancellation operations on business messages corresponding to the business services to respond to the business services.

6. The message processing method according to claim 5, characterized in that, the application interface is constructed based on the Hypertext Transfer Protocol.

7. A message processing device, characterized in that, based on the message system according to any one of claims 1 to 4, comprising: an acquisition module, configured to acquire an access request of a business system and an application interface of a business service corresponding to the access request provided by the message system; wherein, the access request is a request for the business system to request access to the message system; a service response module, configured to establish a connection relationship between the business system and the message system through the application interface, and use the message system to process business messages corresponding to the business service to respond to the business service.

8. An electronic device, characterized in that, the electronic device includes a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the message processing method according to claim 5 or 6.

Citation Information

Patent Citations

  • Message middleware and a message transmission method

    CN109739654A