Message processing method, message middleware, electronic equipment and storage medium
By introducing a filtering mechanism in the message middleware, and filtering and forwarding message messages based on the target filtering rules, the problem of excessive consumption of message processing resources and low efficiency in the prior art is solved, and the effect of improving message processing efficiency is achieved.
Patent Information
- Application Number
- CN202411906515.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-03-28
AI Technical Summary
In the prior art, the information processing consumes too much resources and is inefficient in low efficiency, especially in civil aviation airport operations, the number of message information for passenger luggage status tracking and real-time flight scheduling has increased exponentially, resulting in the receiving end having to process a large number of irrelevant messages, occupying too much computing resources, and affecting the message processing efficiency.
By introducing a filtering mechanism in the message middleware, it is stored in the target queue in response to receiving the first message message from the sending end, and obtains the target filtering rules corresponding to the target queue. Based on these rules, the message messages stored in the target queue are filtered, and the second message message matching the filtering rules is obtained, and sent to the receiving end.
By dynamically filtering messages, the receiving side avoids processing irrelevant messages, thereby reducing message redundancy, saving resources, and improving message processing efficiency, solving the problems of excessive resource consumption and low efficiency in the prior art.
Smart Images

Figure CN119728627A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of aviation and message processing, and in particular to a message processing method, message middleware, electronic equipment and storage medium. Background Art
[0002] In modern civil aviation airport operations, the complexity of business is increasing day by day, and each business relies on accurate and timely message delivery. In particular, the number of message information for services such as passenger baggage status tracking and real-time flight scheduling is growing exponentially. In this scenario, efficient message processing becomes very important.
[0003] In the prior art, message processing is often implemented through a broadcast subscription mode. In this mode, all receiving ends that subscribe to the message queue can receive the message, regardless of whether the receiving end's business needs are related to the message queue. This will cause the receiving end to receive useless messages in the message queue, thereby increasing the burden on the receiving end, occupying too many computing resources, and affecting the efficiency of message processing.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide a message processing method, message middleware, electronic device and storage medium, so as to at least solve the technical problems of excessive resource consumption and low efficiency in message processing in the prior art.
[0006] According to one aspect of an embodiment of the present invention, a message processing method is provided, which is applied to a message middleware, and includes: in response to receiving a first message sent by a sending end, storing the first message in a target queue; obtaining a target filtering rule corresponding to the target queue; filtering at least one message stored in the target queue based on the target filtering rule to obtain a second message matching the target filtering rule; and sending the second message to the receiving end.
[0007] Optionally, storing the first message in a target queue includes: determining a target receiving end corresponding to the first message; and storing the first message in a target queue corresponding to the target receiving end.
[0008] Optionally, storing the first message in the target queue includes: copying the first message into multiple parts to obtain multiple message messages; storing the multiple message messages in multiple queues respectively, wherein different queues are used to store message messages sent to different receiving ends.
[0009] Optionally, obtaining a target filtering rule corresponding to the target queue includes: determining a target receiving end corresponding to the target queue; obtaining an initial filtering rule constructed for the target receiving end, wherein the initial filtering rule is pre-constructed based on a business scenario; and performing grammatical parsing on the initial filtering rule according to preset grammatical semantic rules to obtain the target filtering rule.
[0010] Optionally, at least one message stored in the target queue is filtered based on a target filtering rule to obtain a second message matching the target filtering rule, including: determining a target message filtering controller matching the target filtering rule based on the filtering type of the target filtering rule, wherein different filtering types are used for different format fields in the message; and matching at least one message with the target filtering rule through the target message filtering controller to determine the second message.
[0011] Optionally, obtaining a target filtering rule corresponding to the target queue includes: determining whether a filtering state corresponding to the target queue is an on state; and obtaining the target filtering rule when the filtering state is an on state.
[0012] Optionally, when the filtering state is not on, a first message is sent to the receiving end.
[0013] According to another aspect of an embodiment of the present invention, a message middleware is also provided, including: at least one queue, different queues are used to store message messages sent by a sender to be forwarded to different receiving ends; at least one message filtering controller is connected to at least one queue in a one-to-one correspondence, different message filtering controllers are used to filter the message messages stored in different queues according to the filtering rules corresponding to different queues, obtain the target message messages matching the filtering rules, and send the target message messages to the receiving ends corresponding to different queues.
[0014] Optionally, the message middleware also includes: a filtering rule controller, used to obtain initial filtering rules constructed for different receiving ends; a filtering syntax parser, used to perform syntax parsing on the initial filtering rules according to preset syntax and semantic rules to obtain at least one filtering rule, and determine at least one message filtering controller based on the filtering types of different filtering rules, wherein different filtering types are used for different format fields in the message.
[0015] According to another aspect of an embodiment of the present invention, there is further provided an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein the method in each embodiment of the present invention is executed when the program is running.
[0016] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in various embodiments of the present invention.
[0017] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.
[0018] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.
[0019] According to another aspect of the embodiments of the present invention, a computer program is further provided. When the computer program is executed by a processor, the methods in the embodiments of the present invention are implemented.
[0020] In an embodiment of the present invention, in response to receiving a first message sent by a sending end, the first message is stored in a target queue; a target filtering rule corresponding to the target queue is obtained; at least one message stored in the target queue is filtered based on the target filtering rule to obtain a second message matching the target filtering rule; and the second message is sent to the receiving end. It is easy to notice that by adopting a filtering method, the filtering mechanism is integrated in the message middleware, and after filtering the message by the target filtering rule, the matching second message is sent to the receiving end, which can avoid the receiving end from processing irrelevant messages, thereby reducing the message redundancy of the receiving end and saving resources, achieving the purpose of dynamically filtering messages, thereby achieving the technical effect of improving the efficiency of message processing, and thus solving the technical problem of excessive resource consumption and low efficiency in message processing in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0022] Figure 1 is a flow chart of a message processing method according to an embodiment of the present invention;
[0023] Figure 2 is a schematic diagram of an optional message processing method according to an embodiment of the present invention;
[0024] Figure 3 is a schematic diagram of a message middleware according to an embodiment of the present invention;
[0025] Figure 4 is a schematic diagram of a message processing system according to an embodiment of the present invention;
[0026] Figure 5 It is a schematic diagram of a message processing device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] According to an embodiment of the present invention, an embodiment of a message processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0030] Figure 1 is a flow chart of a message processing method according to an embodiment of the present invention. Figure 1 As shown, the method is applied to message middleware and includes the following steps:
[0031] Step S102: in response to receiving a first message sent by a sending end, storing the first message in a target queue.
[0032] The above-mentioned sender can be a user client used to send messages. In the civil aviation business system, the sender can be the source system or service that generates business messages such as passenger baggage. The sender sends messages through the message middleware, which is responsible for the transmission and persistence of messages. The message middleware can process messages according to preset filtering rules to ensure that the messages sent by the sender can be correctly and efficiently delivered to the interested receiver, while avoiding irrelevant messages causing waste of resources and processing burden on the receiver.
[0033] The above-mentioned message middleware can be used to realize message interaction between the sender and the receiver. The message middleware can pre-process the first message of the sender to send the service-related message to the corresponding receiver, reduce the resource burden of the receiver, and thus improve the processing speed of the receiver.
[0034] The above-mentioned first message may be a message instance sent to the target queue through the message middleware in the broadcast subscription mode. The first message may be a message related to passenger baggage and other services. With the increase in the complexity of civil aviation airport services, the transmission volume of the first message of civil aviation airports has become more and more. In order to improve the efficiency of message processing, the response messages are usually processed by different receiving ends, so there is no need to pass the first message to each receiving end. Therefore, it is necessary to filter the first message to improve the efficiency of message transmission and the efficiency of message processing. The first message may include but is not limited to: message attributes, message markers, and message content, etc. The content of the first message is not limited here and can be determined as needed. Among them, the message attributes can be composed of key-value pairs, so that the message attributes are used to transmit additional attributes of the first message. The message marker can be a string type, so that the type of the first message is marked with a message marker.
[0035] The above-mentioned target queue can be a message communication queue for message transmission and message persistence. The target queue is located between the sending end and the receiving end, and is responsible for receiving the first message sent by the sending end and storing these messages for the receiving end to pull. Through the target queue, the first message will be persisted to the disk to ensure that the first message will not be lost even in the event of a system failure or restart. The target queue can also be used as a buffer to store these messages. In addition, the target queue can be connected to a message filtering controller to filter the first message and pass the messages that meet the rules to the receiving end, thereby reducing the processing burden of the receiving end and improving the message processing efficiency. Through the target queue, efficient and accurate message processing requirements in civil aviation business scenarios can be supported.
[0036] In an optional embodiment, after receiving the first message, the first message is parsed to extract the message attributes, message flags, and message content for classified storage. Then, the first message can be stored to a disk according to the message flags to ensure the reliability and durability of the first message. After the storage is completed, a confirmation can be sent to the sender, indicating that the first message has been successfully stored in the target queue.
[0037] In another optional embodiment, a distributed storage system may be used to store copies of the first message on different nodes to reduce the risk of single point failure. In addition, the health status of the target queue is checked regularly. If the target queue is found to be unavailable, the backup queue is automatically switched to store and deliver the message. The storage status of the first message is fed back, and the storage status may include whether the storage is successful and the storage location.
[0038] In another optional embodiment, the received first message can be temporarily stored in an asynchronous queue. The first message can be marked using a dynamic marking mechanism. The first message can be read from the asynchronous queue according to the mark and asynchronously written into the target queue. After the storage is completed, the sender sends a storage confirmation, thereby realizing the storage of the first message.
[0039] Step S104, obtaining a target filtering rule corresponding to the target queue.
[0040] The above-mentioned target filtering rules can be used to screen the first message to improve the message processing efficiency and realize resource allocation. The target filtering rules can be used to filter according to the key value of the message attribute, or can be used to filter by keywords, or can be used to filter according to the tag bit. Through the target filtering rules, accurate filtering can be achieved, so that the receiving end can choose to receive specific messages according to business needs, avoid processing irrelevant messages, save resources and improve processing speed. By dynamically setting the target filtering rules, it is possible to quickly adapt to changes in business scenarios and support different business needs. Message filtering by the target filtering rules in the message middleware can also simplify the design and development of the business system and reduce development costs. The target filtering rules can be published by the rule publisher of the message middleware so that the target filtering rules can be stored and updated to ensure real-time and effectiveness.
[0041] In an optional embodiment, the target filtering rules can be obtained through a configuration file. The target filtering rules can be set by loading the configuration file so that the target filtering rules in the configuration file can be directly obtained during filtering. Alternatively, the target filtering rules can be configured and selected through the management interface. The target filtering rules can be set in the management interface, for example, the source, target, content, attribute and other conditions of the message can be set so that the message middleware can filter and route the message according to these conditions. Alternatively, the target filtering rules can also be obtained by calling an application programming interface (API).
[0042] Step S106: filter at least one message stored in the target queue based on the target filtering rule to obtain a second message matching the target filtering rule.
[0043] The above filtering can be the process of screening messages to ensure that specific messages are delivered to the receiving end. This filtering process is completed by the message middleware, and the receiving end does not need to develop additional filtering logic. Through filtering, message processing can be optimized, the burden on the receiving end can be reduced, and a large number of irrelevant messages can be avoided, thereby improving the efficiency and speed of message processing. Through filtering, the computing and storage resource consumption of the receiving end can also be reduced, and resource utilization can be improved. In addition, the filtering mechanism can be adjusted quickly according to the changes in business scenarios to support more diverse and complex business needs. Through accurate filtering, the receiving end can receive the messages that need to be processed more quickly, improve the business response speed, and thus improve the quality of message interaction services.
[0044] The second message message mentioned above can be a message instance sent to the receiving end through the message middleware in the broadcast subscription mode. The second message message can be a message that meets the target filtering rules set by the receiving end after being filtered by the message middleware. The second message message can include but is not limited to: message attributes, message mark bits and message content body, etc. The content of the second message message is not limited here and can be determined as needed. Among them, the message attribute can be composed of a key-value pair, so that the message attribute is used to transmit the additional attributes of the second message message. The message mark bit can be a string type, so that the type of the second message message is marked by the message mark bit. Through the second message message, it can be ensured that the message received by the receiving end is directly related to its business needs, reducing the need to process irrelevant or redundant information, and improving the efficiency and accuracy of business processing. In addition, the second message message can make the receiving end not need to filter out the required information from a large number of messages, and can directly process the second message message, which reduces the time of data processing, improves the overall speed of message processing, and can also reduce the consumption of computing resources and storage resources of the receiving end.
[0045] In an optional embodiment, the target filtering rule is parsed and converted into a filtering script, and the filtering script is used to automatically filter the message in the target queue to obtain the second message. Alternatively, the message in the target queue can be automatically filtered according to the target filtering rule by a filtering controller to obtain the second message. Alternatively, the rule field and the corresponding field value can be obtained by parsing the target filtering rule. For example, the rule field is a message flag bit, and the field value is "CA". By identifying whether the value of the field in the message is the same as the field value of the rule field obtained by the target filtering rule, the message is screened, and the message with the same field value is regarded as the second message.
[0046] Step S108: Send a second message to the receiving end.
[0047] The above-mentioned receiving end can be used to receive messages from the target queue. In the civil aviation business system, the receiving end can be an associated system or service that receives and processes business messages. The receiving end receives messages according to custom filtering rules by subscribing to the message queue. The receiving end receives messages from the sending end through the message middleware to ensure the availability of received messages and avoid processing useless messages, thereby saving resources.
[0048] In an optional embodiment, the second message can be sent in a point-to-point mode. Alternatively, the second message can be sent in a publish and subscribe mode. Different receiving ends can subscribe to the same topic, and the topic can correspond to at least one target queue, so that the message related to the topic is sent to the receiving end. Alternatively, the second message can be sent to the receiving end through a delayed message sending and retry mechanism. The message middleware can be configured to delay the sending of the message for a preset time so that the receiving end has more resources to process the message after the busy period. After the receiving end does not return a successful response, the message middleware will resend the second message according to the preset retry strategy.
[0049] In an embodiment of the present invention, in response to receiving a first message sent by a sending end, the first message is stored in a target queue; a target filtering rule corresponding to the target queue is obtained; at least one message stored in the target queue is filtered based on the target filtering rule to obtain a second message matching the target filtering rule; and the second message is sent to the receiving end. It is easy to notice that by adopting a filtering method, the filtering mechanism is integrated in the message middleware, and after filtering the message by the target filtering rule, the matching second message is sent to the receiving end, which can avoid the receiving end from processing irrelevant messages, thereby reducing the message redundancy of the receiving end and saving resources, achieving the purpose of dynamically filtering messages, thereby achieving the technical effect of improving the efficiency of message processing, and thus solving the technical problem of excessive resource consumption and low efficiency in message processing in the prior art.
[0050] Optionally, storing the first message in a target queue includes: determining a target receiving end corresponding to the first message; and storing the first message in a target queue corresponding to the target receiving end.
[0051] In an optional embodiment, the target receiving end corresponding to the first message can be determined by allocating queues of the subscription relationship, so that the first message is stored in the target queue corresponding to the target receiving end. Alternatively, the target queue can be dynamically selected by a routing key, so that the first message is stored in the target queue allocated to the target receiving end. Alternatively, after selecting the target client based on load balancing, the first message can be stored in the target queue corresponding to the target receiving end.
[0052] This strategy ensures the directional storage of the first message, reduces the complexity of message processing, and can significantly improve the efficiency and accuracy of message processing, especially in a high-concurrency environment.
[0053] Optionally, storing the first message in the target queue includes: copying the first message into multiple parts to obtain multiple message messages; storing the multiple message messages in multiple queues respectively, wherein different queues are used to store message messages sent to different receiving ends.
[0054] In an optional embodiment, the replication and storage of the first message can be determined based on the load to avoid queue overload. Alternatively, the first message can be replicated into multiple partitions according to business needs, and then the multiple messages can be stored in multiple queues according to preset storage rules. Alternatively, multiple messages can be assigned to different partitions through a hash strategy, and a queue mapping table can be constructed to associate the stored partitions with the queues, and the message information can be stored in multiple queues through partition identifiers.
[0055] Through message replication and multi-queue storage, it can support multi-channel distribution of the first message, meet the different processing requirements of different receiving ends for the same message, and enhance the flexibility and scalability of the message middleware. In a distributed system, this mechanism can ensure that messages are correctly distributed to multiple service nodes, which can improve the system's fault tolerance and the parallelism of data processing.
[0056] Optionally, obtaining a target filtering rule corresponding to the target queue includes: determining a target receiving end corresponding to the target queue; obtaining an initial filtering rule constructed for the target receiving end, wherein the initial filtering rule is pre-constructed based on a business scenario; and performing grammatical parsing on the initial filtering rule according to preset grammatical semantic rules to obtain the target filtering rule.
[0057] In an optional embodiment, the target filtering rule can be obtained by parsing the filtering rule of the subscription configuration. The initial filtering rule is obtained from the subscription configuration, and then the initial filtering rule is parsed by the preset grammatical semantic rules to ensure the correctness and executability of the rule, and the parsed rule is regarded as the target filtering rule. Alternatively, the initial filtering rule can be obtained by calling the application program interface, and the initial filtering rule is parsed by the preset grammatical semantic rules to obtain the target filtering rule.
[0058] Optionally, at least one message stored in the target queue is filtered based on a target filtering rule to obtain a second message matching the target filtering rule, including: determining a target message filtering controller matching the target filtering rule based on the filtering type of the target filtering rule, wherein different filtering types are used for different format fields in the message; and matching at least one message with the target filtering rule through the target message filtering controller to determine the second message.
[0059] This selection of target message filter controller based on the filter type makes the message filtering process more efficient and reduces unnecessary consumption of computing resources. In the case of airline passenger check-in, this mechanism can select a matching target message filter controller based on the passenger check-in service type, thus improving the efficiency and accuracy of message processing.
[0060] In an optional embodiment, a matching target message filter controller can be determined for different filter types based on a preset matching table, and then the second message can be obtained by matching the target message filter controller. Alternatively, a matching target message filter controller can be manually selected based on the filter type, and then the second message can be obtained by matching the target message filter controller. The target message filter controller can be a tag bit filter controller, an attribute key filter controller, or a regular expression filter controller, etc. The target message filter controller is not limited here and can be determined as needed.
[0061] Optionally, obtaining a target filtering rule corresponding to the target queue includes: determining whether a filtering state corresponding to the target queue is an on state; and obtaining the target filtering rule when the filtering state is an on state.
[0062] This state control mechanism can dynamically turn on or off the filtering function according to actual needs, improving the flexibility and resource utilization of filtering, and can set whether to turn on the filtering state according to needs.
[0063] In an optional embodiment, the filter status corresponding to the target queue can be determined through the filter status field in the configuration file. Alternatively, the filter status corresponding to the target queue can be queried in real time through an API interface. Alternatively, the filter status corresponding to the target queue can be determined by monitoring the filter status change event. When the filter status is in the on state, the target filter rule is obtained.
[0064] Optionally, when the filtering state is not on, a first message is sent to the receiving end.
[0065] When the filtering state is not on, the first message is sent to the receiving end. In this way, in a scenario where filtering is not required, the first message can be quickly sent to the receiving end, which reduces unnecessary processing steps and improves the efficiency of message transmission. Thus, the instant delivery of the message can be ensured.
[0066] Figure 2 is a schematic diagram of an optional message processing method according to an embodiment of the present invention, such as Figure 2 As shown, the method includes:
[0067] The sender sends a message. After receiving the message, the middleware stores it in the queue.
[0068] After the middleware obtains the filtering rules, it parses the filtering rules and matches the processor based on the filtering rules to further determine whether to enable the filtering status.
[0069] In the case of non-filtering state, the middleware directly sends the message to the receiving end, and the receiving end completes the message processing when receiving the message. In the case of filtering state, the middleware obtains the filtering rules and determines whether it matches the filtering rules. If the message matches the filtering rules, the message is sent to the receiving end, and the receiving end completes the message processing when receiving the message. If the message does not match the filtering rules, the unmatched message is filtered.
[0070] According to another aspect of the present invention, a message middleware is provided, which is used to execute the message processing method in the above embodiment, and the specific application scenario and preferred embodiment are the same as the above embodiment, which will not be described in detail here.
[0071] Figure 3 is a schematic diagram of a message middleware according to an embodiment of the present invention, such as Figure 3 As shown, in Figure 3 Only one queue 30 and one message filtering controller 32, a sending end 34 and a receiving end 36 are shown in the figure. The message middleware includes:
[0072] At least one queue, different queues are used to store message messages sent by the sender to be forwarded to different receiving ends; at least one message filtering controller is connected to at least one queue in a one-to-one correspondence, and different message filtering controllers are used to filter the message messages stored in different queues according to the filtering rules corresponding to different queues, obtain the target message messages matching the filtering rules, and send the target message messages to the receiving ends corresponding to different queues.
[0073] Through this design, the message middleware can achieve efficient filtering and targeted distribution of messages, improve the overall performance and response speed of the system, and enhance the flexibility and scalability of the system, so that it can better adapt to the complex and changing business environment. In the scenario of airline passenger check-in, this message middleware design can significantly improve the efficiency of data processing, reduce resource waste, and improve the stability and security of the system.
[0074] Optionally, the message middleware also includes: a filtering rule controller, used to obtain initial filtering rules constructed for different receiving ends; a filtering syntax parser, used to perform syntax parsing on the initial filtering rules according to preset syntax and semantic rules to obtain at least one filtering rule, and determine at least one message filtering controller based on the filtering types of different filtering rules, wherein different filtering types are used for different format fields in the message.
[0075] This enables the message middleware to dynamically adjust filtering rules and filter controllers according to different business requirements and receiving end characteristics, improving the accuracy and efficiency of message processing. In the airline passenger check-in scenario, this can ensure accurate filtering and rapid distribution of messages, improving message processing capabilities and user experience.
[0076] Figure 4 is a schematic diagram of a message processing system according to an embodiment of the present invention. Figure 4 As shown, the system includes: a sending end, a receiving end 1, a receiving end 2, a message middleware and a rule publishing end.
[0077] The sender is used to send messages to the message middleware.
[0078] The message middleware is used to receive the filtering rules sent by the rule publishing end, and is also used to receive messages, and send the messages to the receiving end 1 or the receiving end 2 after filtering the messages.
[0079] Both receiving end 1 and receiving end 2 are used to receive messages sent by the message middleware.
[0080] The rule publishing end is used to send the construction rules of the filtering rules to the message middleware.
[0081] The message middleware includes queue 1, queue 2, message filter controller 1, message filter controller 2, filter syntax parser and filter rule controller.
[0082] Both queue 1 and queue 2 are used to receive messages and send the messages to the corresponding message filtering controller 1 and message filtering controller 2 respectively.
[0083] The filter rule controller is used to receive the construction rules, and send the constructed filter rules to the filter syntax parser.
[0084] The filter syntax parser is used to parse the filter rules and send them to the matching message filter controller.
[0085] The message filtering controller 1 is used to filter the first message based on the first message sent by the queue 1 and the matching filtering rule, and send the filtered first message to the receiving end 1.
[0086] The message filtering controller 2 is used to filter the second message based on the second message sent by the queue 2 and the matching filtering rule, and send the filtered second message to the receiving end 2.
[0087] According to an embodiment of the present invention, an embodiment of a message processing device is provided, which is used to execute the message processing method in the above embodiment. The specific application scenarios and preferred embodiments are the same as the above embodiment and will not be described in detail here.
[0088] Figure 5 is a schematic diagram of a message processing device according to an embodiment of the present invention. Figure 5 As shown, the device includes: a storage module 50, which is used to store the first message message in a target queue in response to receiving a first message message sent by a sending end; an acquisition module 52, which is used to obtain a target filtering rule corresponding to the target queue; a filtering module 54, which is used to filter at least one message message stored in the target queue based on the target filtering rule to obtain a second message message matching the target filtering rule; and a sending module 56, which is used to send the second message message to the receiving end.
[0089] Optionally, the storage module is further used to determine a target receiving end corresponding to the first message; and store the first message in a target queue corresponding to the target receiving end.
[0090] Optionally, the storage module is further used to copy the first message into multiple parts to obtain multiple message messages; store the multiple message messages in multiple queues respectively, wherein different queues are used to store message messages sent to different receiving ends.
[0091] Optionally, the acquisition module is also used to determine the target receiving end corresponding to the target queue; obtain the initial filtering rules constructed for the target receiving end, wherein the initial filtering rules are pre-constructed based on the business scenario; perform grammatical parsing on the initial filtering rules according to preset grammatical semantic rules to obtain the target filtering rules.
[0092] Optionally, the filtering module is also used to determine a target message filtering controller that matches the target filtering rule based on the filtering type of the target filtering rule, wherein different filtering types are used for different format fields in the message; at least one message is matched with the target filtering rule through the target message filtering controller to determine a second message.
[0093] Optionally, the acquisition module is further used to determine whether the filtering state corresponding to the target queue is in an on state; when the filtering state is in an on state, the target filtering rule is acquired.
[0094] Optionally, the sending module is further used to send the first message to the receiving end when the filtering state is not on.
[0095] An embodiment of the present application further provides an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods in various embodiments of the present invention when running.
[0096] An embodiment of the present application further provides a computer-readable storage medium, which includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in various embodiments of the present invention.
[0097] An embodiment of the present application further provides a computer program product, including a computer program, which implements the methods in various embodiments of the present invention when executed by a processor.
[0098] An embodiment of the present application further provides a computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.
[0099] The embodiments of the present application further provide a computer program, which implements the methods in the above-mentioned embodiments of the present invention when executed by a processor.
[0100] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0101] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0102] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0103] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0104] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0105] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A message processing method, characterized in that: Applied to message middleware, the method includes: In response to receiving a first message sent by a sending end, storing the first message in a target queue; Obtaining a target filtering rule corresponding to the target queue; Filtering at least one message stored in the target queue based on the target filtering rule to obtain a second message matching the target filtering rule; Send the second message to the receiving end.
2. The method according to claim 1, characterized in that Storing the first message in a target queue includes: Determine a target receiving end corresponding to the first message; The first message is stored in the target queue corresponding to the target receiving end.
3. The method according to claim 1, characterized in that Storing the first message in a target queue includes: Copying the first message into multiple parts to obtain multiple message messages; The multiple message messages are stored in multiple queues respectively, wherein different queues are used to store message messages sent to different receiving ends.
4. The method according to claim 1, characterized in that Obtaining a target filtering rule corresponding to the target queue includes: Determine a target receiving end corresponding to the target queue; Acquire an initial filtering rule constructed for the target receiving end, wherein the initial filtering rule is pre-constructed based on a business scenario; According to preset grammatical semantic rules, the initial filtering rules are parsed to obtain the target filtering rules.
5. The method according to claim 1, characterized in that Filtering at least one message stored in the target queue based on the target filtering rule to obtain a second message matching the target filtering rule includes: Based on the filtering type of the target filtering rule, determining a target message filtering controller that matches the target filtering rule, wherein different filtering types are used for different format fields in the message; The target message filtering controller matches the at least one message with the target filtering rule to determine the second message.
6. The method according to any one of claims 1 to 5, characterized in that Obtaining a target filtering rule corresponding to the target queue includes: Determine whether the filtering state corresponding to the target queue is enabled; When the filtering state is in the on state, the target filtering rule is obtained.
7. The method according to claim 6, characterized in that When the filtering state is not enabled, the first message is sent to the receiving end.
8. A message middleware, characterized in that: include: At least one queue, where different queues are used to store messages sent by a sender to be forwarded to different receivers; At least one message filtering controller is connected to the at least one queue in a one-to-one correspondence. Different message filtering controllers are used to filter the message messages stored in different queues according to the filtering rules corresponding to different queues, obtain the target message messages matching the filtering rules, and send the target message messages to the receiving ends corresponding to the different queues.
9. The message middleware according to claim 8, characterized in that: The message middleware also includes: A filtering rule controller, used to obtain initial filtering rules constructed for different receiving ends; A filtering syntax parser is used to perform syntax parsing on the initial filtering rules according to preset syntax semantic rules to obtain at least one filtering rule, and determine at least one message filtering controller based on the filtering types of different filtering rules, wherein different filtering types are used for different format fields in the message.
10. An electronic device, characterized in that: include: A memory storing an executable program; A processor, configured to run the program, wherein the program executes the method according to any one of claims 1 to 7 when running.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is run, the device where the storage medium is located is controlled to execute the method according to any one of claims 1 to 7.
12. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Business processing method and device, storage medium and electronic equipment
CN113918357A
Message processing method and device, equipment and storage medium
CN116390792A
Message routing method and system and electronic equipment
CN116431359A
User behavior processing method and device, equipment, storage medium and program product
CN117435367A
Message forwarding method and device in pre-release environment
CN117749755A