Message processing method and device, electronic device and storage medium

By using rule real-time monitors in the intermediate processing layer to perform unified parsing, filtering and format conversion of messages, the problem of mandatory transformation of producers in the prior art is solved, and flexible filtering and forwarding of messages is realized, which is suitable for scenarios with multi-message topics.

CN120523822APending Publication Date: 2025-08-22TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410194329.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-02-21
Publication Date
2025-08-22

AI Technical Summary

Technical Problem

The existing message filtering scheme is highly invasive and inflexible to the producer side, and needs to be modified on the producer side to set label or attribute filtering rules.

Method used

By implementing message filtering and forwarding in the intermediate processing layer, using the rule real-time monitor to obtain parsing rule configuration information and filtering rules from the offline file of the rule, perform unified parsing, filtering and format conversion of messages, realizing general and flexible filtering and forwarding of messages.

Benefits of technology

Without intruding into the generator and consumer logic, unified filtering and forwarding of messages is realized, suitable for flexible processing of multi-message topics, supports forwarding across message queues, and has the ability to identify rules.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120523822A_ABST
    Figure CN120523822A_ABST
Patent Text Reader

Abstract

The invention relates to a message processing method and device, an electronic device and a storage medium. The method comprises the following steps: in response to a to-be-processed source message, acquiring analysis rule configuration information corresponding to the source message through a rule real-time monitor so as to analyze and convert the source message into a first intermediate message of a memory object structure; obtaining a message filtering rule corresponding to each message theme from the rule offline file through a rule real-time monitor so as to filter the first intermediate message to obtain a second intermediate message matched with each message theme; obtaining generation rule configuration information configured under each message theme and a target theme subscribed by a target receiving end; and performing message format conversion processing on the second intermediate message matched with the corresponding message theme by using the generation rule configuration information to obtain a target message, and forwarding the target message matched with the target theme to a target receiving end. On the premise of not invading logic of a generator end and a consumer end, messages can be filtered and forwarded universally and flexibly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data transmission, and in particular to a message processing method, device, electronic device and storage medium. Background Art

[0002] Currently, there are two main message filtering solutions for message processing: tag filtering and SQL (Structured Query Language) attribute filtering. Both solutions require modifications to the producer side to implement message filtering. Either tags or different attributes must be set when producing messages, and then message filtering is performed using tag filtering rules or SQL filtering rules. Existing message filtering solutions are highly invasive and inflexible to the producer side. Summary of the Invention

[0003] This application provides a message processing method, device, electronic device, and storage medium that can universally and flexibly filter and forward messages without intruding on the logic of the producer and consumer sides. The technical solution of this application is as follows:

[0004] According to a first aspect of an embodiment of the present application, a message processing method is provided, including:

[0005] In response to a source message to be processed, obtaining parsing rule configuration information corresponding to the source message from a rule offline file through a rule real-time monitor;

[0006] Parsing the source message into a message of a memory object structure using the parsing rule configuration information to obtain a first intermediate message after parsing and conversion;

[0007] Obtaining, by the real-time rule monitor, message filtering rules corresponding to the plurality of message topics from the offline rule file, and filtering the first intermediate message based on the message filtering rules to obtain second intermediate messages matching the plurality of message topics; the second intermediate message being a portion of the first intermediate message;

[0008] The rule real-time monitor obtains, from the rule offline file, generation rule configuration information configured under each message topic and a target topic subscribed to by a target receiving end; the target topic is a message topic subscribed to by the target receiving end among the multiple message topics; the target receiving end is any message consumer end that subscribes to a message topic;

[0009] Use the generation rule configuration information configured under each message topic to perform message format conversion processing on the second intermediate message matching each message topic, obtain the target message matching each message topic, and forward the target message matching the target topic to the target receiving end.

[0010] According to a second aspect of an embodiment of the present application, a message processing device is provided, including:

[0011] A parsing rule acquisition module, configured to respond to a source message to be processed and obtain parsing rule configuration information corresponding to the source message from a rule offline file through a rule real-time monitor;

[0012] A message format conversion module, configured to parse the source message and convert it into a message of a memory object structure using the parsing rule configuration information, to obtain a first intermediate message after parsing and conversion;

[0013] a message filtering module configured to obtain, from the rule offline file, message filtering rules corresponding to each of the plurality of message topics via the real-time rule monitor, and filter the first intermediate message based on the message filtering rules to obtain second intermediate messages matching each of the plurality of message topics; the second intermediate message being a portion of the first intermediate message;

[0014] A generation rule acquisition module is configured to acquire, from the rule offline file, through the rule real-time monitor, generation rule configuration information configured under each message topic and a target topic subscribed to by a target receiving end; the target topic is a message topic subscribed to by the target receiving end among the multiple message topics; the target receiving end is any message consumer that subscribes to a message topic;

[0015] The format conversion and forwarding module is used to use the generation rule configuration information configured under each message topic to perform message format conversion processing on the second intermediate message matching each message topic, obtain the target message matching each message topic, and forward the target message matching the target topic to the target receiving end.

[0016] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement a method as described in any one of the first aspects above.

[0017] According to the fourth aspect of the embodiments of the present application, a computer-readable storage medium is provided. When the instructions in the computer-readable storage medium are executed by the processor of an electronic device, the electronic device can execute any method described in the first aspect of the embodiments of the present application.

[0018] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, comprising computer instructions, which, when executed by a processor, enable a computer to execute any one of the methods according to the first aspect of the embodiment of the present application.

[0019] The technical solutions provided by the embodiments of this application bring at least the following beneficial effects:

[0020] By setting the parsing rule configuration information, message filtering rules, and generation rule configuration information configured under each message topic corresponding to the source message, a unified parsing of the source message is achieved to obtain a message of a unified memory object structure adapted to the message filtering rules; thus, the first intermediate message of the unified structure after parsing and conversion can be filtered and screened based on the message filtering rules configured under each message topic, to achieve the aggregation of messages under each message topic, that is, the source message is filtered and divided into different message topics, and the generation rule configuration information configured under each message topic can be used to perform message format conversion processing on the second intermediate message matching each message topic, to obtain the target message matching each message topic. Based on this, the target message under the target topic subscribed by the target receiving end can be forwarded to the target receiving end, to achieve universal and unified filtering and forwarding of messages, and to achieve the recognition, filtering and forwarding of messages without invading the logic of the generator and consumer ends, so as to achieve the effect of universal and flexible filtering and forwarding of messages.

[0021] Moreover, this message processing method can be applied to message middleware, realizing a method of completing message processing by setting up an intermediate processing layer, which can be applicable to message filtering and forwarding scenarios of all message middleware; based on this, only simple rules need to be configured to achieve the target requirements, and there is no need to write complex filtering rule scripts, and the message processing process is short, and it can achieve message forwarding across message queues and multiple message topics, and message filtering and forwarding are more flexible.

[0022] As well as the parsing rule configuration information, message filtering rules and generation rule configuration information configured under each message topic in the rule offline file, they can be obtained based on the real-time rule monitor and applied to message processing, realizing the thermal recognition capability of the rules, adaptive rules, and making new rules effective without interrupting service, providing a basis for the message filtering and forwarding of this application.

[0023] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application, and do not constitute an improper limitation on the present application.

[0025] Figure 1 It is a schematic diagram showing an application environment according to an exemplary embodiment.

[0026] Figure 2The figure is a flowchart of a message processing method according to an exemplary embodiment.

[0027] Figure 3 The figure is a flowchart showing a rule update process under a target topic according to an exemplary embodiment.

[0028] Figure 4 The figure is a block diagram of a message processing device according to an exemplary embodiment.

[0029] Figure 5 The present invention is a block diagram of an electronic device for message processing according to an exemplary embodiment.

[0030] Figure 6 The present invention is a block diagram of an electronic device for message processing based on an exemplary embodiment. DETAILED DESCRIPTION

[0031] Various exemplary embodiments, features, and aspects of the present application will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise indicated.

[0032] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0033] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0034] In addition, numerous specific details are provided in the detailed description below to better illustrate the present application. Those skilled in the art will appreciate that the present application can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art are not described in detail in order to highlight the main purpose of the present application.

[0035] See also Figure 1 , Figure 1A schematic diagram of an application system provided according to an embodiment of the present application is shown. The application system can be used in the message processing method of the present application. The technical concept of the present application is to add an intermediate processing layer, use the business information carried by the source message itself to identify the message that needs subsequent processing, and then forward it to the message consumer (message consumption end) for processing, wherein the business information can refer to the attribute value used in the following filtering. For example, the overall architecture can be as follows Figure 1 As shown, the application system may at least include a message producer 01, a message consumer 02, and an intermediate processing layer 03 between the message producer and the message consumer. As an example, the intermediate processing layer 03 may be applied to a message middleware. For example, the intermediate processing layer 03 may be set in the message middleware to implement the message parsing, filtering and forwarding functions of the present application. Exemplarily, the intermediate processing layer 03 may include functional modules for unified message parsing, filtering rule parsing and filtering, and message format conversion and forwarding. Accordingly, a rule offline file 04 and a rule real-time monitor 05 may be set to assist these functional modules, or corresponding parsers, generators, and syntax checkers, message attribute acquirers, and various parsers required for filtering rule continuation and filtering may also be included, such as Figure 1 shown.

[0036] In an embodiment of the present application, the message producer 01 can be used to generate messages, such as generating messages of a source topic (topic). The source topic message can be understood as a message collection regardless of business type. For example, an order message will be generated after placing an order in an e-commerce company. The order message may include the order time, the price of the ordered goods, the inventory of the ordered goods, the information to notify the user of the order, the order transportation type, etc., which may be a collection of information about the order. The order message can subsequently be screened and filtered by different systems such as the inventory system and the logistics and transportation system to filter out sub-messages (partial messages) matched by different systems from the order message. For example, the inventory system filters out the inventory of the ordered goods from the order message, and the logistics and transportation system filters out messages that match the transportation type from the order message. Among them, the number of source messages can be one or more, and this application does not limit this.

[0037] Message consumer 02 can subscribe to messages from at least one target topic (target topic) within the source topic. This allows the message consumer to consume messages from the target topic when the message set is overloaded. For example, the inventory system described above can be considered a message consumer. This system can subscribe to messages from the inventory topic, filtering out inventory messages from order messages and consuming messages from the inventory topic.

[0038] The intermediate processing layer 03 can be used to obtain target messages in a format that matches the message consumer 03 using common filtering and format conversion methods. For example, the unified message parsing module can be used in the message standardization process. Input message formats vary, including key-value (kv) structured messages, JSON structured messages, serialized object transfer (also referred to as serialized) messages, and complex structured messages. Parsing these different message types into messages with a standard memory object structure allows for the configuration of unified filtering rules.

[0039] The filtering rule parsing and filtering function module can be used to pre-parse the filtering rules and then check whether the message attributes comply with the filtering rules to achieve filtering and screening of messages by message subject.

[0040] The message format conversion and forwarding function module can be used to output the source message into the message format expected by consumers (such as message consumer 1 and message consumer 2). It is a format conversion process, that is, converting the format of the message subscribed by the consumer to conform to the format set by the consumer.

[0041] The rule offline file 04 can be used to store the parsing rule configuration information corresponding to the source message offline (for example Figure 1 Source message rules in ), message topics subscribed by each message consumer, and message filtering rules and generation rule configuration information configured under each message topic (for example Figure 1 Target message rules in .

[0042] The rule real-time monitor 05 can be used to obtain the current parsing rule configuration information, the message filtering rules configured under each message topic, and the generation rule configuration information from the rule offline file 04 in real time to serve the three functional modules of unified message parsing, filtering rule parsing and filtering, and message format conversion and forwarding.

[0043] It should be noted that in the specific implementation of this application, user-related data is involved. When the following embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0044] Before introducing the method embodiments provided in the present application, a brief introduction is first given to the application scenarios, relevant terms or nouns that may be involved in the method embodiments of the present application to facilitate understanding by technical personnel in the field of the present application.

[0045] Message middleware: A supporting software system that provides synchronous or asynchronous, reliable message transmission for application systems in a network environment based on queue and message passing technologies.

[0046] Message topic: This can refer to the topic in the message middleware. Message consumers can consume messages corresponding to the subscribed topic by subscribing to the topic.

[0047] Figure 2 This is a flow chart of a message processing method according to an exemplary embodiment, which can be applied to message middleware. Figure 2 As shown, the following steps may be included.

[0048] Step S201 : In response to a source message to be processed, the rule real-time monitor obtains parsing rule configuration information corresponding to the source message from a rule offline file.

[0049] In the embodiment of this specification, the source message to be processed may refer to a message set generated by a message generator, such as Figure 1 The msg1 to msg6 shown in the figure can be in kv, json or serialized format, which is not limited in this application. The parsing rule configuration information can be used to indicate the parsing rule of the source message, which can be in text format or code format, which is not limited in this application.

[0050] In practical applications, when an active message is generated and transmitted to the intermediate processing layer, the intermediate processing layer can, in response to the source message to be processed, obtain the parsing rule configuration information corresponding to the source message from the rule offline file through the rule real-time monitor, that is, obtain the latest parsing rule configuration information corresponding to the source message. As an example, the parsing rule configuration information can be as follows and can be carried in the srcInfo field.

[0051]

[0052] The JSON structure of srcInfo defines the parsing rule configuration information for the source message. serviceUrl records the address of the mq; listenerThreads defines how many threads are started to process the source message in parallel; topic records the name of the source topic; and parser records the information to be processed for unified message parsing, as follows:

[0053] parserName: Specifies the name of the parser. Parsers include the kv parser, json parser, serialization parser, and custom parser. The kv parser parses source messages in kv format; the json parser parses source messages in json format; the serialization parser converts serialized objects into Java memory objects. The custom parser parses source messages using a custom parsing method.

[0054] delimiter: It is the delimiter used with the parser. For example, when the kv parser is selected, you can use & to split the Key-Value structure, and then use = to split the Key field and the specific Value value.

[0055] fieldName: Records the name of the message field to be processed. The fieldName field is ineffective when applying a parser to the entire source message. It only takes effect when applying a parser to specific fields within the message. For example, if the message is: name=XXX&age=12&hobby=["computer","history","math"], and the entire message is a key-value structure, the kv parser can be applied to the entire message. The fieldName configuration value is meaningless, and the parser is applied to the entire message. However, the hobby field within the message is a list structured as JSON. In this case, you need to specify fieldName as hobby and parserName as the JSON parser.

[0056] preprocessor: This is a preprocessor for field values. For example, some fields may be URL-encoded, so you can specify urlDecode to decode them; some fields may need to be desensitized, so you can specify dataMasking to process them.

[0057] preprocesseTimes: Specifies how many times the preprocessor method should be applied to the field. For example, if a field has been url-encoded multiple times, you can specify the number of times to apply urlDecode accordingly.

[0058] destType: Specifies the data type to convert the field into, such as int, string, list, map, etc.

[0059] subFields: The field will contain subfields. Use this field to recursively include the parser structure and parse all fields.

[0060] It should be noted that the message formats of the same message subject are generally the same, and the main formats used are mostly kv format, json format, and serialized objects. When facing such messages, simple parsing rules can be configured. When facing complex message structures, for example, the kv structure contains a json structure, and the fields are encoded, etc., it is necessary to configure complex parsing rules. Accordingly, for the case where the above configuration has preprocessing, the preprocessing step can be included in the unified parsing of the message, and this application does not limit this. Optionally, the parser name may not be configured in the above parsing rule configuration information, but the message parsing method may be configured, and this application does not limit this. In the case of configuring the parser name, the message parsing method can be determined according to the parser name; or in the case of configuring the message parsing method, the message parser corresponding to the message parsing method can be called.

[0061] Step S203: Use the parsing rule configuration information to parse and convert the source message into a message of a memory object structure, and obtain a first intermediate message after parsing and conversion.

[0062] In the embodiment of this specification, the parsing rule configuration information can be used to parse the source message into a message of a memory object structure to obtain a first intermediate message after parsing and conversion, so that the first intermediate message can be a message of a unified standard memory object structure.

[0063] Optionally, it can be determined whether a message parsing method is configured in the parsing rule configuration information, for example, it can be determined whether a parser name is configured in the above srcInfo. If yes, the corresponding parser can be called according to the parser name to parse the source message. For example, if a preset message parsing method corresponding to the source message is configured in the parsing rule configuration information, the source message can be parsed using the preset message parser corresponding to the preset message parsing method to obtain the first intermediate message of the memory object structure. The preset message parser may include: Figure 1 The kv parser, json parser, and deserialization parser shown.

[0064] Alternatively, if a custom parsing method is configured in the parsing rule configuration information, a custom message parser is loaded to parse the source message to obtain the first intermediate message of the memory object structure. Figure 1 The custom resolver shown.

[0065] Alternatively, if not, that is, if no message parsing method is configured in the parsing rule configuration information, the message format of the source message can be automatically identified, and a preset message parser corresponding to the message format can be invoked to parse the source message to obtain the first intermediate message of the memory object structure. For example, if the message format of the source message is automatically identified as KV format, the KV parser can be invoked to parse the source message to obtain the first intermediate message of the memory object structure.

[0066] In the embodiments of this specification, parsing may be performed based on the manner indicated by each field in the parsing rule configuration information, and this application does not limit the specific process of the parsing.

[0067] In a possible implementation, before the step of using the parsing rule configuration information to parse the source message into a message of a memory object structure and obtaining the first intermediate message after the parsing conversion, the message processing method may further include: verifying the legality and connectivity of the parsing rule configuration information to obtain a verification result. Accordingly, the step of using the parsing rule configuration information to parse the source message into a message of a memory object structure and obtaining the first intermediate message after the parsing conversion may include: when the verification result indicates that the parsing rule configuration information is legal and connected, using the parsing rule configuration information to parse the source message into a message of a memory object structure and obtain the first intermediate message after the parsing conversion; the parsing rule configuration information being connected can indicate that the source message can be forwarded. Optionally, if the verification result indicates that the parsing rule configuration information is illegal or not connected, the source message may not be parsed.

[0068] Step S205 , obtaining message filtering rules corresponding to the various message topics from the rule offline file through the rule real-time monitor, and filtering the first intermediate message based on the message filtering rules to obtain second intermediate messages matching the various message topics.

[0069] In the embodiments of this specification, the above-mentioned second intermediate message may be a partial message in the first intermediate message. The message filtering rules corresponding to each message topic are used to filter messages that match each message topic. Based on this, the message filtering rules corresponding to a variety of message topics can be obtained from the rule offline file through the rule real-time monitor, so that the messages that match each message topic can be filtered out based on the message filtering rules corresponding to each message topic, thereby achieving the purpose of message aggregation based on the message topic. It should be noted that since the message filtering rules provide a dynamic update function to the message consumers who subscribe to the message topic, the obtained message filtering rules can be the latest and can dynamically and promptly respond to the filtering needs of the message consumers.

[0070] Furthermore, after the message filtering rule is obtained, the first intermediate message may be filtered based on the message filtering rule to obtain second intermediate messages that match the respective multiple message topics.

[0071] In the embodiments of this specification, the core capability of message filtering rule parsing may be parsing of filtering rules. Exemplarily, filtering rules may be recorded in the filterRule field, as shown below.

[0072]

[0073] In an example, the message filtering rules may include three types of symbols: logic symbols, rule symbols, and auxiliary symbols, which may be specifically as follows.

[0074] Logical symbols: For example, &, |, and ! represent logical AND, logical OR, and logical NOT, respectively.

[0075] Rule symbols: For example, =, ≠, <, ≤, >, and ≥ are used to determine whether the value of a field is equal to, not equal to, less than, less than or equal to, greater than, and greater than or equal to a certain value. For example, the age field is represented by age, and the rule for configuring age equal to 13 is age=13; %, ×, ^, and $ symbols are used to determine whether the string corresponding to the field value contains a certain string, does not contain a certain string, starts with a certain string, or ends with a certain string. For example, the name field is represented by name, and the rule for configuring obtaining all messages with the surname XX is name^XX; ∈, Symbols are used to determine whether the list corresponding to the field contains or does not contain a certain value. For example, the hobby field is represented by hobby. A person may have multiple hobbies, so hobby is a list. The rule for configuring the favorite computer is hobby[]∈computer.

[0076] Auxiliary symbols: () parentheses are used to divide logical units and priorities, for example: (A=1|B=2)&C=3; square brackets [] can be used with fields to indicate that the field is a list, for example: configure the rule hobby[]∈computer to include the item computer in the hobby list. Square brackets can be combined with numbers to indicate the meaning of this element of the list, for example, the second item in the hobby list is computer, which is hobby[1]=computer; curly brackets {} can be used with fields to indicate that the field is a dictionary map, for example, the score field is represented by score, score{}>90 means that the values ​​corresponding to score are all greater than 90, curly brackets can be used with specific key values ​​to indicate the value of the key item in the field dictionary, for example, score{math}>90 means that the score of the math subject in score is greater than 90; the English period "." can be used to represent subordinate fields, for example, student.name represents the name field under the student field.

[0077] In one possible implementation, filtering a first intermediate message based on a message filtering rule to obtain second intermediate messages matching multiple message topics may include extracting a filtering logic rule unit from the message filtering rule; the filtering logic rule unit may be composed of an attribute value, a rule symbol, and an expected value; and then iteratively filtering the first intermediate message using the filtering logic rule unit to obtain second intermediate messages matching multiple message topics. For example, using the filterRule field, the filtering logic rule unit may include three: student.name^XX, student.age>13, and student.hobby[]∈computer. For example, student.age>13, where student.age can be an attribute value, > can be a rule symbol, and 13 can be an expected value, the filtering logic rule unit can filter out students older than 13. By iteratively filtering the source message using these three filtering logic rule units and combining the logical symbols and auxiliary symbols within the filtering logic rule units, second intermediate messages corresponding to students with a computer hobby, an age older than 13, or a name of XX can be obtained.

[0078] For example, when using a filtering logic rule unit to iteratively filter a source message, the attribute value to be checked can be obtained through a message attribute getter. Based on the rule symbol, the corresponding rule parser is invoked to check whether the message attribute value meets the expected value. If so, True is returned; otherwise, False is returned. For example, when encountering symbols such as <, ≤, >, or ≥, a numeric rule parser can be invoked. When encountering symbols such as %, ^, and $, a string rule parser can be invoked to determine whether the message attribute value string contains, begins with, or ends with the expected value. When encountering symbols such as ∈, a set rule parser can be invoked to determine whether the expected value belongs to or does not belong to the message attribute list. If a user-defined symbol is encountered, the custom rule parser can be invoked for parsing. Furthermore, the results of all minimum filtering logic rule unit checks can be merged based on the logical symbols and auxiliary symbols to obtain the result of the entire message filtering rule. If the result is False, it can be considered a mismatch with the message filtering rule. If the result is True, it can be considered a match with the message filtering rule, i.e., it is selected by the message filtering rule and constitutes the second intermediate message that matches the corresponding message topic.

[0079] In an optional implementation, the grammar of the message filtering rules can also be checked. Based on this, the method can also include: checking the grammar of the message filtering rules to obtain a grammar detection result. Accordingly, the above-mentioned message filtering of the first intermediate message based on the message filtering rules to obtain a second intermediate message that matches each of the multiple message topics can include: when the grammar detection result is that the grammar is correct, the message filtering of the first intermediate message based on the message filtering rules to obtain a second intermediate message that matches each of the multiple message topics. Optionally, when the grammar detection result is a grammatical error, a corresponding prompt can be given, and this application does not limit the prompt method.

[0080] Step S207: obtaining the generation rule configuration information configured under each message topic and the target topic subscribed by the target receiving end from the rule offline file through the rule real-time monitor.

[0081] Among them, the target topic can be a message topic subscribed by the target receiving end among multiple message topics; the target receiving end can be any message consumer end that subscribes to the message topic; the generation rule configuration information configured under each message topic can be used to indicate the message generation method corresponding to each message topic.

[0082] In one example, the generation rule configuration information can be set in the destInfo field, similar to the srcInfo field described above. The example is as follows:

[0083]

[0084]

[0085] Among them, destInfo: can be a list, that is, the messages filtered by the message filtering rules can be forwarded to the target topics of multiple different message queues MQ.

[0086] serviceUrl: The configuration can be the MQ address of the target message. The target message can be on the same MQ address as the source message, or on a different address, which can realize cross-MQ message forwarding.

[0087] listenerThreads: Configure how many threads to use for processing the above mq address.

[0088] topicList: Configure the topic name of the target message. Multiple topics can be configured to achieve one-to-many message forwarding on the same MQ address.

[0089] generator: Configures how the message is generated before being forwarded. If this field is not configured, the source message is sent directly to the target topic without format conversion.

[0090] generatorName: configures the name of the generator. The message generators included in this solution may include: kv generator, which can be used to produce information in kv format; json generator, which can be used to generate information in json format; and serialization generator, which can be used to serialize Java memory objects into text information.

[0091] delimiter: It is a delimiter used with the generator. For example, when the kv generator is selected, you can use = to combine the Key field and the specific Value value, and then use & to assemble the Key-Value structure.

[0092] preprocessor: This is a field value preprocessor. For example, if some fields need to be URL-encoded, specify urlEncode for encoding; if some fields need to be desensitized, specify dataMasking for processing.

[0093] preprocesseTimes: Specifies how many times the preprocessor method should be applied to the field. For example, a field can be urlEncoded multiple times.

[0094] subFields: The fields are the fields to be processed by the generator and preprocessor, and the processing process can be recursively defined downward through this structure.

[0095] It should be noted that the above is an example of generation rule configuration information and does not limit the generation rule configuration information of this application. For example, optionally, instead of configuring the name of the generator, the name of the message generation method can be set. This application does not limit this. As long as the generation method of the template message can be determined based on the correspondence between the message generation method and the generator, it can be used.

[0096] Step S209: Use the generation rule configuration information configured under each message topic to perform message format conversion processing on the second intermediate message matching each message topic, obtain the target message matching each message topic, and forward the target message matching the target topic to the target receiving end.

[0097] In the embodiment of this specification, the generation rule configuration information can be used to perform message format conversion processing on the second intermediate messages matching each message subject to obtain the target message matching each message subject, for example Figure 1 The following example shows msg-1 and msg-2 for target topic 1, and msg-3 and msg-4 for target topic 2. In other words, the message generation method for target topic 1 is the key-value generation method, while the message generation method for target topic 2 is the json generation method.

[0098] In one example, the thread configured in the aforementioned generation configuration information, the message generation method configured in the generation configuration information, and the generator configured in the generation configuration information can be used to perform message format conversion on the second intermediate message that matches the message subject, thereby obtaining a target message that matches the message subject. After the target messages that match the message subject are screened, the target message that matches the target subject can be forwarded to the target receiving end.

[0099] In one possible implementation, performing message format conversion on the second intermediate messages matching each message topic using the generation rule configuration information configured under each message topic to obtain target messages matching each message topic may include: for any message topic, if a message generation method is configured in the generation rule configuration information configured under the message topic, executing any of the following:

[0100] In the case where a preset message generation method is configured in the generation rule configuration information, the preset message generation method is used to perform message format conversion processing on the second intermediate message that matches the message subject, and obtain the target message that matches the message subject. For example, the preset message generation method may include but is not limited to the kv generation method, the json generation method and the serialization generator. Accordingly, the generator corresponding to the preset message generation method can be called to perform message format conversion processing on the second intermediate message that matches the message subject, and obtain the target message that matches the message subject. For example, if the preset message generation method configured under the target topic1 is the kv generation method, the kv generator can be called to perform message format conversion processing on the second intermediate message that matches the target topic1, and obtain the target message that matches the target topic1.

[0101] Alternatively, if a custom message generation method is configured in the generation rule configuration information configured under the message subject, the custom message generation method can be used to perform message format conversion processing on a second intermediate message that matches the message subject to obtain a target message that matches the message subject. For example, a custom generator corresponding to the custom message generation method can be called to perform message format conversion processing on the second intermediate message to obtain a target message that matches the message subject.

[0102] Optionally, the above method may further include: when the message generation mode is not configured in the generation rule configuration information, forwarding the source message to the target receiving end according to the message format of the source message.

[0103] By setting the parsing rule configuration information, message filtering rules, and generation rule configuration information configured under each message topic corresponding to the source message, a unified parsing of the source message is achieved to obtain a message of a unified memory object structure adapted to the message filtering rules; thus, the first intermediate message of the unified structure after parsing and conversion can be filtered and screened based on the message filtering rules configured under each message topic, to achieve the aggregation of messages under each message topic, that is, the source message is filtered and divided into different message topics, and the generation rule configuration information configured under each message topic can be used to perform message format conversion processing on the second intermediate message matching each message topic, to obtain the target message matching each message topic. Based on this, the target message under the target topic subscribed by the target receiving end can be forwarded to the target receiving end, to achieve universal and unified filtering and forwarding of messages, and to achieve the recognition, filtering and forwarding of messages without invading the logic of the generator and consumer ends, so as to achieve the effect of universal and flexible filtering and forwarding of messages.

[0104] Moreover, this message processing method can be applied to message middleware, realizing a method of completing message processing by setting up an intermediate processing layer, which can be applicable to message filtering and forwarding scenarios of all message middleware; based on this, only simple rules need to be configured to achieve the target requirements, and there is no need to write complex filtering rule scripts, and the message processing process is short, and it can achieve message forwarding across message queues and multiple message topics, and message filtering and forwarding are more flexible.

[0105] As well as the parsing rule configuration information, message filtering rules and generation rule configuration information configured under each message topic in the rule offline file, they can be obtained based on the real-time rule monitor and applied to message processing, realizing the thermal recognition capability of the rules, adaptive rules, and making new rules effective without interrupting service, providing a basis for the message filtering and forwarding of this application.

[0106] In an optional embodiment, before the step of performing message format conversion processing on the second intermediate messages that match the subject of each message using the generation rule configuration information to obtain the target messages that match the subject of each message, the method may further include: verifying the legality and connectivity of the generation rule configuration information to obtain a verification result. Based on this, the step of performing message format conversion processing on the second intermediate messages that match the subject of each message using the generation rule configuration information to obtain the target messages that match the subject of each message may include: when the verification result indicates that the generation rule configuration information is legal and connected, performing message format conversion processing on the second intermediate messages that match the subject of each message using the generation rule configuration information to obtain the target messages that match the subject of each message; the generation rule configuration information being connected indicates that the target message can be forwarded.

[0107] Optionally, if the verification result indicates that the generated rule configuration information is illegal or incoherent, the message format conversion process may not be performed. For example, a prompt may be given to allow the message consumer to make modifications.

[0108] Reference Figure 3 In the embodiment of this specification, the message consumer can trigger the modification of the message filtering rules and generation rule configuration information under the subscribed message topic. Based on this, the method can also include:

[0109] Step S301: In response to a rule modification request from a target receiving end for a target topic, obtain rule update information set by the target receiving end for the target topic. The rule update information may include update information of message filtering rules or update information of generation rule configuration information.

[0110] Step S303: Use the rule update information to update the message filtering rules under the target topic or the generation rule configuration information under the target topic in the rule offline file.

[0111] In the embodiments of the present specification, a message consumer can modify the message filtering rules and generation rule configuration information under a subscribed message topic. For example, the modification can be triggered by a request, and accordingly, in response to the rule modification request of the target receiving end for the target topic, the rule update information set by the target receiving end for the target topic is obtained. The rule update information may include update information of the message filtering rules or update information of the generation rule configuration information. Furthermore, the rule update information can be used to update the message filtering rules under the target topic or the generation rule configuration information under the target topic in the rule offline file. This enables the message consumer to dynamically update the message filtering rules and generation rule configuration information under the subscribed message topic, and promptly meet the dynamic requirements of the message consumer for filtering rules and generation rules.

[0112] Optionally, the message consumer may also request to modify the subscribed message topic, and this application does not limit the specific subscription modification process for this message topic. Alternatively, the parsing rule configuration information of the source message may also be dynamically modified, for example, by the message producer, and this disclosure does not limit this.

[0113] Figure 4 FIG1 is a block diagram of a message processing device according to an exemplary embodiment. Figure 4 , the apparatus may include:

[0114] The parsing rule acquisition module 401 is configured to obtain, in response to a source message to be processed, parsing rule configuration information corresponding to the source message from a rule offline file via a rule real-time monitor;

[0115] A message format conversion module 403 is configured to parse the source message and convert it into a message of a memory object structure using the parsing rule configuration information, thereby obtaining a first intermediate message after parsing and conversion;

[0116] The message filtering module 405 is configured to obtain, from the offline rule file, message filtering rules corresponding to each of the multiple message topics through the real-time rule monitor, and filter the first intermediate message based on the message filtering rules to obtain second intermediate messages matching each of the multiple message topics; the second intermediate message is a portion of the first intermediate message.

[0117] A generation rule acquisition module 407 is configured to acquire, from the rule offline file, through the rule real-time monitor, generation rule configuration information configured under each message topic and a target topic subscribed to by a target receiving end; the target topic is a message topic subscribed to by the target receiving end among the multiple message topics; the target receiving end is any message consumer that subscribes to a message topic;

[0118] The format conversion and forwarding module 409 is used to use the generation rule configuration information configured under each message topic to perform message format conversion processing on the second intermediate message matching each message topic, obtain the target message matching each message topic, and forward the target message matching the target topic to the target receiving end.

[0119] By setting the parsing rule configuration information, message filtering rules, and generation rule configuration information configured under each message topic corresponding to the source message, a unified parsing of the source message is achieved to obtain a message of a unified memory object structure adapted to the message filtering rules; thus, the first intermediate message of the unified structure after parsing and conversion can be filtered and screened based on the message filtering rules configured under each message topic, to achieve the aggregation of messages under each message topic, that is, the source message is filtered and divided into different message topics, and the generation rule configuration information configured under each message topic can be used to perform message format conversion processing on the second intermediate message matching each message topic, to obtain the target message matching each message topic. Based on this, the target message under the target topic subscribed by the target receiving end can be forwarded to the target receiving end, to achieve universal and unified filtering and forwarding of messages, and to achieve the recognition, filtering and forwarding of messages without invading the logic of the generator and consumer ends, so as to achieve the effect of universal and flexible filtering and forwarding of messages.

[0120] Moreover, this message processing method can be applied to message middleware, realizing a method of completing message processing by setting up an intermediate processing layer, which can be applicable to message filtering and forwarding scenarios of all message middleware; based on this, only simple rules need to be configured to achieve the target requirements, and there is no need to write complex filtering rule scripts, and the message processing process is short, and it can achieve message forwarding across message queues and multiple message topics, and message filtering and forwarding are more flexible.

[0121] As well as the parsing rule configuration information, message filtering rules and generation rule configuration information configured under each message topic in the rule offline file, they can be obtained based on the real-time rule monitor and applied to message processing, realizing the thermal recognition capability of the rules, adaptive rules, and making new rules effective without interrupting service, providing a basis for the message filtering and forwarding of this application.

[0122] In a possible implementation, the message format conversion module 403 may include any one of the following units:

[0123] A first parsing unit is configured to parse the source message using a preset message parser corresponding to the preset message parsing method to obtain the first intermediate message of the memory object structure when a preset message parsing method corresponding to the source message is configured in the parsing rule configuration information; or

[0124] A second parsing unit is configured to load a custom message parser to parse the source message when a custom parsing method is configured in the parsing rule configuration information to obtain the first intermediate message of the memory object structure; or

[0125] The third parsing unit is used to automatically identify the message format of the source message when no message parsing method is configured in the parsing rule configuration information, call the preset message parser corresponding to the message format to parse the source message, and obtain the first intermediate message of the memory object structure.

[0126] In a possible implementation, the format conversion and forwarding module 409 may include:

[0127] The first format conversion and forwarding unit is configured to, when a message generation mode is configured in the generation rule configuration information, perform any one of the following:

[0128] In a case where a preset message generation method is configured in the generation rule configuration information, the preset message generation method is used to perform message format conversion processing on the second intermediate messages matching each message subject to obtain target messages matching each message subject; or

[0129] In the case where a custom message generation method is configured in the generation rule configuration information, the custom message generation method is used to perform message format conversion processing on the second intermediate messages that match each message subject to obtain target messages that match each message subject.

[0130] In a possible implementation, the message processing apparatus may further include:

[0131] The forwarding module is used to forward the source message to the target receiving end according to the message format of the source message when the message generation mode is not configured in the generation rule configuration information.

[0132] In a possible implementation, the message processing apparatus may further include:

[0133] a rule modification request module, configured to, in response to a rule modification request from the target receiving end for the target topic, obtain rule update information set by the target receiving end for the target topic, wherein the rule update information includes update information of message filtering rules or update information of the generation rule configuration information;

[0134] The rule updating module is configured to update the message filtering rules under the target topic or the generation rule configuration information under the target topic in the rule offline file using the rule updating information.

[0135] In a possible implementation, the message processing apparatus may further include:

[0136] A first verification module is used to verify the legitimacy and connectivity of the parsing rule configuration information and obtain a verification result;

[0137] Accordingly, the message format conversion module 403 may include:

[0138] A message format conversion unit is used to parse and convert the source message into a message of a memory object structure using the parsing rule configuration information when the verification result indicates that the parsing rule configuration information is legal and connected, to obtain a first intermediate message after parsing and conversion; the parsing rule configuration information is connected, indicating that the source message can be forwarded.

[0139] In a possible implementation, the message processing apparatus may further include:

[0140] A grammar detection module, used to detect the grammar of the message filtering rule and obtain a grammar detection result;

[0141] Accordingly, the message filtering module 405 may include:

[0142] The message filtering unit is configured to filter the first intermediate message based on the message filtering rule to obtain second intermediate messages that match each of the multiple message topics when the grammar detection result is grammatically correct.

[0143] In a possible implementation, the message filtering module 405 may include:

[0144] A filtering logic rule unit extraction unit, configured to extract a filtering logic rule unit from the message filtering rule; the filtering logic rule unit is composed of an attribute value, a rule symbol, and an expected value;

[0145] The message filtering unit is configured to iteratively filter the first intermediate message using the filtering logic rule unit to obtain second intermediate messages that match each of the multiple message topics.

[0146] In a possible implementation, the message processing apparatus may further include:

[0147] A second verification module is used to verify the legitimacy and connectivity of the generation rule configuration information and obtain a verification result;

[0148] Accordingly, the format conversion and forwarding module 409 may include:

[0149] The second format conversion and forwarding unit is used to use the generation rule configuration information to perform message format conversion processing on the second intermediate messages that match each message subject when the verification result indicates that the generation rule configuration information is legal and connected, so as to obtain the target message that matches each message subject; the generation rule configuration information is connected, indicating that the target message can be forwarded.

[0150] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0151] Figure 5 This is a block diagram of an electronic device for message processing according to an exemplary embodiment. The electronic device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 5 As shown. The electronic device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a message processing method is implemented. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the housing of the electronic device, or an external keyboard, touchpad or mouse, etc.

[0152] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the electronic device to which the solution of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0153] Figure 6 This is a block diagram of an electronic device for message processing based on an exemplary embodiment. The electronic device may be a server, and its internal structure diagram may be as shown in FIG. Figure 6As shown. The electronic device includes a processor, a memory, and a network interface connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, it implements a message processing method.

[0154] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the electronic device to which the solution of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0155] In an exemplary embodiment, an electronic device is also provided, including: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the message processing method in the embodiment of the present application.

[0156] In an exemplary embodiment, a computer-readable storage medium is also provided. When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the message processing method in the embodiment of the present application. The computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, or the like.

[0157] In an exemplary embodiment, a computer program product including instructions is also provided. When the computer program product is run on a computer, the computer is caused to execute the message processing method in the embodiment of the present application.

[0158] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, which can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0159] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0160] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A message processing method, characterized in that: Applied to message middleware, the message processing method includes: In response to a source message to be processed, obtaining parsing rule configuration information corresponding to the source message from a rule offline file through a rule real-time monitor; Parsing the source message into a message of a memory object structure using the parsing rule configuration information to obtain a first intermediate message after parsing and conversion; Obtaining, by the real-time rule monitor, message filtering rules corresponding to the plurality of message topics from the offline rule file, and filtering the first intermediate message based on the message filtering rules to obtain second intermediate messages matching the plurality of message topics; the second intermediate message being a portion of the first intermediate message; The rule real-time monitor obtains, from the rule offline file, generation rule configuration information configured under each message topic and a target topic subscribed to by a target receiving end; the target topic is a message topic subscribed to by the target receiving end among the multiple message topics; the target receiving end is any message consumer end that subscribes to a message topic; Use the generation rule configuration information configured under each message topic to perform message format conversion processing on the second intermediate message matching each message topic, obtain the target message matching each message topic, and forward the target message matching the target topic to the target receiving end.

2. The message processing method according to claim 1, wherein: The converting the source message into a message of a memory object structure by using the parsing rule configuration information to obtain a first intermediate message after parsing and converting includes any one of the following: When a preset message parsing method corresponding to the source message is configured in the parsing rule configuration information, the source message is parsed using a preset message parser corresponding to the preset message parsing method to obtain the first intermediate message of the memory object structure; or, When a custom parsing mode is configured in the parsing rule configuration information, a custom message parser is loaded to parse the source message to obtain the first intermediate message of the memory object structure; or When no message parsing method is configured in the parsing rule configuration information, the message format of the source message is automatically identified, and the preset message parser corresponding to the message format is called to parse the source message to obtain the first intermediate message of the memory object structure.

3. The message processing method according to claim 1, wherein: The method of performing message format conversion on the second intermediate messages matching each message topic using the generation rule configuration information configured under each message topic to obtain target messages matching each message topic includes: for any of the message topics, if a message generation method is configured in the generation rule configuration information configured under the message topic, executing any one of the following: In a case where a preset message generation method is configured in the generation rule configuration information, the preset message generation method is used to perform message format conversion processing on the second intermediate message matching the message subject to obtain a target message matching each message subject; or In the case where a custom message generation method is configured in the generation rule configuration information, the custom message generation method is used to perform message format conversion processing on the second intermediate message matching the message subject to obtain target messages matching each message subject.

4. The message processing method according to claim 3, wherein: The method further comprises: In the case that the message generation mode is not configured in the generation rule configuration information, the source message is forwarded to the target receiving end according to the message format of the source message.

5. The message processing method according to any one of claims 1 to 4, characterized in that: The method further comprises: In response to a rule modification request from the target receiving end for the target topic, obtaining rule update information set by the target receiving end for the target topic, the rule update information including update information of a message filtering rule or update information of the generation rule configuration information; The rule update information is used to update the message filtering rules under the target topic or the generation rule configuration information under the target topic in the rule offline file.

6. The message processing method according to claim 1 or 2, characterized in that: Before the step of using the parsing rule configuration information to parse the source message into a message of a memory object structure to obtain a first intermediate message after parsing and converting, the method further comprises: Verifying the legitimacy and connectivity of the parsing rule configuration information to obtain a verification result; The converting the source message into a message of a memory object structure by using the parsing rule configuration information to obtain a first intermediate message after parsing and converting includes: When the verification result indicates that the parsing rule configuration information is legal and connected, the parsing rule configuration information is used to parse and convert the source message into a message of a memory object structure to obtain a first intermediate message after parsing and conversion; the parsing rule configuration information is connected, indicating that the source message can be forwarded.

7. The message processing method according to claim 1, wherein: The method further comprises: Detecting the grammar of the message filtering rule to obtain a grammar detection result; The filtering the first intermediate message based on the message filtering rule to obtain second intermediate messages that match the multiple message topics includes: If the grammar detection result is that the grammar is correct, the first intermediate message is filtered based on the message filtering rule to obtain second intermediate messages that match the multiple message topics.

8. The message processing method according to claim 1 or 7, characterized in that: The filtering the first intermediate message based on the message filtering rule to obtain second intermediate messages that match the multiple message topics includes: Extracting a filtering logic rule unit from the message filtering rule; the filtering logic rule unit is composed of an attribute value, a rule symbol and an expected value; The first intermediate message is iteratively filtered using the filtering logic rule unit to obtain second intermediate messages that match the multiple message topics.

9. The message processing method according to any one of claims 1, 3-4, characterized in that: Before the step of performing message format conversion processing on the second intermediate messages matching each message subject using the generation rule configuration information to obtain target messages matching each message subject, the method further includes: Verifying the legitimacy and connectivity of the generated rule configuration information to obtain a verification result; The step of performing message format conversion on the second intermediate messages matching each message subject using the generation rule configuration information to obtain target messages matching each message subject includes: When the verification result indicates that the generation rule configuration information is legal and connected, the generation rule configuration information is used to perform message format conversion processing on the second intermediate message that matches each message subject to obtain the target message that matches each message subject; the generation rule configuration information is connected, indicating that the target message can be forwarded.

10. A message processing device, characterized in that: Applied to message middleware, the message processing device includes: A parsing rule acquisition module, configured to respond to a source message to be processed and obtain parsing rule configuration information corresponding to the source message from a rule offline file through a rule real-time monitor; A message format conversion module, configured to parse the source message and convert it into a message of a memory object structure using the parsing rule configuration information, to obtain a first intermediate message after parsing and conversion; a message filtering module configured to obtain, from the rule offline file, message filtering rules corresponding to each of the plurality of message topics via the real-time rule monitor, and filter the first intermediate message based on the message filtering rules to obtain second intermediate messages matching each of the plurality of message topics; the second intermediate message being a portion of the first intermediate message; A generation rule acquisition module is configured to acquire, from the rule offline file, through the rule real-time monitor, generation rule configuration information configured under each message topic and a target topic subscribed to by a target receiving end; the target topic is a message topic subscribed to by the target receiving end among the multiple message topics; the target receiving end is any message consumer that subscribes to a message topic; The format conversion and forwarding module is used to use the generation rule configuration information configured under each message topic to perform message format conversion processing on the second intermediate message matching each message topic, obtain the target message matching each message topic, and forward the target message matching the target topic to the target receiving end.

11. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the message processing method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the message processing method according to any one of claims 1 to 9.

13. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, enable a computer to execute the message processing method according to any one of claims 1 to 9.

Citation Information

Cited By

  • Message interaction method and device, computer program product and electronic equipment

    CN121486325A