Message conversion method and device, equipment, storage medium and program product
Through parsing and priority processing in the message adapter, the problem of low message conversion efficiency between different message middleware systems is solved, flexibility and maintainability are improved, and high concurrency requirements are adapted.
Patent Information
- Application Number
- CN202510786162.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-09-19
AI Technical Summary
When exchanging messages between different message middleware systems, existing technologies require the development of message adaptation functions for different formats, resulting in high development costs, complex maintenance, and low throughput. This cannot meet the needs of high-concurrency message exchange and has low message conversion efficiency.
Messages are received by the first message middleware in the message adapter, stored in the target area according to the message identifier, parsed and classified, the priority of the message block is determined, and the message is packaged and processed in sequence before being sent through the second message middleware. This decouples the message adaptation function from the business system, achieves flexibility and maintainability, and allows for elastic scaling based on changes in the volume of message sending and receiving.
It improves message conversion efficiency, reduces dependence on business systems, ensures that important messages are processed and sent first, adapts to business volume fluctuations, and improves system flexibility and maintainability.
Smart Images

Figure CN120676050A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of financial technology, and in particular to a message conversion method, device, equipment, storage medium and program product. Background Art
[0002] Numerous business systems can interact with each other through message-based middleware, enabling efficient business collaboration and data sharing. As a middleware layer, message-based middleware provides functions such as message sending, receiving, and storage, and is widely used in various industries, including finance, telecommunications, and the internet. When systems using different message-based middleware need to exchange messages, differences in message formats and transmission protocols must be addressed.
[0003] At present, when two systems using message middleware with different message formats exchange messages, the message exchange can be carried out in the following way: a message adaptation function module is added to the internal of each system. For any system, when receiving the message sent by the other system, the message adaptation function module is used to convert the message into the message format corresponding to the current system, and then business processing is performed. If the current system wants to send a message to another system, the message adaptation function module is used to convert the message into the message format corresponding to the other system, and then the message is transmitted.
[0004] In the above message exchange, different message middlewares need to develop message adaptation functions in different formats, resulting in high development costs and complex maintenance. At the same time, the message throughput is low and cannot meet the needs of high-concurrency message exchange, resulting in low message conversion efficiency. Summary of the Invention
[0005] The present application provides a message conversion method, apparatus, device, storage medium and program product to solve the problem of low message conversion efficiency.
[0006] In a first aspect, the present application provides a message conversion method, which is applied to a message adapter, wherein the message adapter includes a first message middleware and a second message middleware, including:
[0007] Receiving, through the first message middleware, a first message sent by the first system, where the first message includes a first identifier, and the first identifier is used to identify a source of the first message;
[0008] storing the first message in a target area according to the first identifier, where the target area is a storage area determined according to the first identifier;
[0009] parsing at least one first message in the target area to obtain at least one message block and a priority corresponding to each message block, wherein the parsing is used to identify content in the first message and classify it using a target algorithm;
[0010] encapsulating the at least one message block in sequence according to the message type corresponding to the target area and the priority corresponding to each message block to obtain a second message sequence, where the second message sequence includes at least one second message;
[0011] At least one second message in the second message sequence is sent in sequence to the second system corresponding to the target area through the second message middleware.
[0012] In a possible implementation, parsing the at least one first message in the target area to obtain at least one message block and a priority corresponding to each message block includes:
[0013] For any first message, identify the first message using the target algorithm to obtain a first feature corresponding to the first message;
[0014] classifying the at least one first message according to the first features respectively corresponding to the at least one first message to obtain at least one message block, where the message block includes the at least one first message;
[0015] Determining a weight value corresponding to each first message according to the first feature corresponding to the at least one first message;
[0016] For any message block, the priority of the message block is determined according to the weight value of at least one first message corresponding to the message block.
[0017] In a possible implementation, identifying the first message by using the target algorithm to obtain a first feature corresponding to the first message includes:
[0018] preprocessing the first message to obtain a processed first message;
[0019] dividing the processed first message into a plurality of vocabulary units by a text segmentation algorithm;
[0020] Perform part-of-speech tagging on multiple vocabulary units using a part-of-speech tagging algorithm to obtain multiple part-of-speech categories;
[0021] Determine multiple semantic relationships between multiple lexical units;
[0022] A first feature corresponding to the first message is determined based on the multiple part-of-speech types and the multiple semantic relationships.
[0023] In a possible implementation, the first feature includes message timeliness and message keywords. Classifying the at least one first message according to the first feature corresponding to each of the at least one first message to obtain at least one message block includes:
[0024] determining at least one keyword category based on at least one message keyword;
[0025] For any keyword category, determining at least one first set corresponding to the keyword category, wherein the first set includes at least one first message, and each first message corresponds to the same message timeliness;
[0026] At least one message block is determined based on the at least one first set.
[0027] In a possible implementation, determining a weight value corresponding to each first message according to the first feature corresponding to at least one first message includes:
[0028] Obtaining a first mapping relationship, where the first mapping relationship includes multiple keyword categories and a first weight factor corresponding to each keyword category;
[0029] Determining first weights corresponding to the at least one first message respectively according to the first mapping relationship and the keyword categories corresponding to the at least one first message respectively;
[0030] Obtain a second mapping relationship, where the second mapping relationship includes multiple message timelinesses and a second weighting factor corresponding to each message timeliness;
[0031] Determining a second weight corresponding to each of the at least one first message according to the second mapping relationship and the message timeliness corresponding to each of the at least one first message;
[0032] A weight value corresponding to each first message is determined according to the first weight and the second weight.
[0033] In a possible implementation, for any second message, sending the second message to the second system corresponding to the target area in sequence through the second message middleware includes:
[0034] determining, by a second message middleware, at least one target address of the second system according to the second message;
[0035] generating second transmission information according to the second message;
[0036] The second transmission information is sent respectively according to the at least one target address.
[0037] In a possible implementation, after sending the second transmission information respectively according to the at least one target address, the method further includes:
[0038] receiving response information corresponding to the second transmission information, the response information including a processing result;
[0039] If the processing result is successful, update the processing status of the second message to successful and record the processing time;
[0040] If the processing result is processing failure, the processing status of the second message is updated to processing failure, and the error information is recorded.
[0041] In a second aspect, the present application provides a message conversion device, which is applied to a message adapter, wherein the message adapter includes a first message middleware and a second message middleware, including:
[0042] a receiving module, configured to receive, through the first message middleware, a first message sent by the first system, wherein the first message includes a first identifier, and the first identifier is used to identify a source of the first message;
[0043] a storage module, configured to store the first message in a target area according to the first identifier, where the target area is a storage area determined according to the first identifier;
[0044] a parsing module, configured to parse at least one first message in the target area to obtain at least one message block and a priority corresponding to each message block, wherein the parsing process is configured to identify and classify content in the first message using a target algorithm;
[0045] an encapsulation module, configured to encapsulate the at least one message block in sequence according to the message type corresponding to the target area and the priority corresponding to each message block, to obtain a second message sequence, where the second message sequence includes at least one second message;
[0046] The sending module is configured to send, in sequence, at least one second message in the second message sequence to the second system corresponding to the target area through the second message middleware.
[0047] In a possible implementation, the parsing module is specifically configured to:
[0048] For any first message, identify the first message using the target algorithm to obtain a first feature corresponding to the first message;
[0049] classifying the at least one first message according to the first features respectively corresponding to the at least one first message to obtain at least one message block, where the message block includes the at least one first message;
[0050] Determining a weight value corresponding to each first message according to the first feature corresponding to the at least one first message;
[0051] For any message block, the priority of the message block is determined according to the weight value of at least one first message corresponding to the message block.
[0052] In a possible implementation, the parsing module is specifically configured to:
[0053] preprocessing the first message to obtain a processed first message;
[0054] dividing the processed first message into a plurality of vocabulary units by a text segmentation algorithm;
[0055] Perform part-of-speech tagging on multiple vocabulary units using a part-of-speech tagging algorithm to obtain multiple part-of-speech categories;
[0056] Determine multiple semantic relationships between multiple lexical units;
[0057] A first feature corresponding to the first message is determined based on the multiple part-of-speech types and the multiple semantic relationships.
[0058] In a possible implementation, the first feature includes message timeliness and message keywords, and the parsing module is specifically configured to:
[0059] determining at least one keyword category based on at least one message keyword;
[0060] For any keyword category, determining at least one first set corresponding to the keyword category, wherein the first set includes at least one first message, and each first message corresponds to the same message timeliness;
[0061] At least one message block is determined based on the at least one first set.
[0062] In a possible implementation, the parsing module is specifically configured to:
[0063] Obtaining a first mapping relationship, where the first mapping relationship includes multiple keyword categories and a first weight factor corresponding to each keyword category;
[0064] Determining first weights corresponding to the at least one first message respectively according to the first mapping relationship and the keyword categories corresponding to the at least one first message respectively;
[0065] Obtain a second mapping relationship, where the second mapping relationship includes multiple message timelinesses and a second weighting factor corresponding to each message timeliness;
[0066] Determining a second weight corresponding to each of the at least one first message according to the second mapping relationship and the message timeliness corresponding to each of the at least one first message;
[0067] A weight value corresponding to each first message is determined according to the first weight and the second weight.
[0068] In a possible implementation, for any second message, the sending module is specifically configured to:
[0069] determining, by a second message middleware, at least one target address of the second system according to the second message;
[0070] generating second transmission information according to the second message;
[0071] The second transmission information is sent respectively according to the at least one target address.
[0072] In a possible implementation manner, the sending module is further configured to:
[0073] receiving response information corresponding to the second transmission information, the response information including a processing result;
[0074] If the processing result is successful, update the processing status of the second message to successful and record the processing time;
[0075] If the processing result is processing failure, the processing status of the second message is updated to processing failure, and the error information is recorded.
[0076] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;
[0077] The memory stores computer-executable instructions;
[0078] The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of the first aspects.
[0079] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method as described in any one of the first aspects.
[0080] In a fifth aspect, the present application provides a computer program product, comprising a computer program, which, when executed by a computer, implements the method as described in any one of the first aspects.
[0081] The present application provides a message conversion method, apparatus, device, storage medium, and program product. The method comprises: receiving a first message sent by a first system through a first message middleware, the first message including a first identifier, the first identifier being used to identify the source of the first message; storing the first message in a target area according to the first identifier, the target area being a storage area determined according to the first identifier; parsing at least one first message in the target area to obtain at least one message block and a priority corresponding to each message block, the parsing process being used to identify the content in the first message and classify it through a target algorithm; encapsulating at least one message block in accordance with the message type corresponding to the target area and the priority corresponding to each message block to obtain a second message sequence, the second message sequence including at least one second message; and sending at least one second message in the second message sequence to a second system corresponding to the target area through the second message middleware in sequence. In this way, the message adaptation function is decoupled from the business system, reducing dependence on the business system and improving the flexibility and maintainability of the system. Moreover, since the message adaptation function module is independent of the business system, it can be elastically scaled according to changes in the message sending and receiving volume, better coping with business volume fluctuations. In addition, through parsing and prioritization, important messages are ensured to be processed and sent first, thereby improving the message conversion efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0083] Figure 1 A schematic diagram of the structure of a message adapter provided in an embodiment of the present application;
[0084] Figure 2 A flowchart of a message conversion method provided in an embodiment of the present application;
[0085] Figure 3 A flowchart of another message conversion method provided in an embodiment of the present application;
[0086] Figure 4 A schematic diagram of the structure of a message conversion device provided in an embodiment of the present application;
[0087] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0088] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION
[0089] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0090] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0091] It should be noted that the message conversion method, device, equipment, storage medium and product provided in this application can be used in the field of financial technology, and can also be used in any field other than financial technology. The application field of the message conversion method, device, equipment, storage medium and product in this application is not limited.
[0092] Numerous business systems can interact with each other through message-based middleware, enabling efficient business collaboration and data sharing. As a middleware layer, message-based middleware provides functions such as message sending, receiving, and storage, and is widely used in various industries, including finance, telecommunications, and the internet. When systems using different message-based middleware need to exchange messages, differences in message formats and transmission protocols must be addressed.
[0093] In related technologies, when two systems using message middleware with different message formats exchange messages, the message exchange can be carried out in the following manner: a message adaptation function module is added to the interior of each of the two systems. For any system, when receiving a message sent by the other system, the message is converted into the message format corresponding to the current system through the message adaptation function module, and then business processing is performed. If the current system wants to send a message to another system, the message is converted into the message format corresponding to the other system through the message adaptation function module, and then the message is transmitted.
[0094] In the above message exchange, different message middlewares need to develop message adaptation functions in different formats, resulting in high development costs and complex maintenance. At the same time, the message throughput is low and cannot meet the needs of high-concurrency message exchange, resulting in low message conversion efficiency.
[0095] In order to solve the above technical problems, an embodiment of the present application provides a message conversion method, which is applied to a message adapter. The message adapter includes a first message middleware and a second message middleware. The first message sent by the first system is received by the first message middleware. According to the first identifier of the first message, the first message is stored in the target area. At least one first message in the target area is parsed and processed. The message content is identified and classified by the target algorithm to obtain at least one message block and the priority corresponding to each message block. According to the message type corresponding to the target area and the priority of each message block, the message blocks are encapsulated and processed in sequence to generate a second message sequence. The second message in the second message sequence is sent to the second system corresponding to the target area in sequence through the second message middleware. In this way, the message adaptation function is decoupled from the business system, the dependence on the business system is reduced, and the flexibility and maintainability of the system are improved. Moreover, since the message adaptation function module is independent of the business system, it can be elastically scaled according to the changes in the message sending and receiving volume, and better cope with business volume fluctuations. In addition, through parsing and priority division, it is ensured that important messages can be processed and sent first, thereby improving the message conversion efficiency.
[0096] Next, combine Figure 1 , which gives an example of a message adapter.
[0097] Figure 1 This is a structural diagram of a message adapter provided in an embodiment of the present application. Figure 1 , Figure 1 It may include a first message middleware, a message processor, and a second message middleware.
[0098] The first message middleware can be used to receive messages sent from different first systems.
[0099] Messages can come from different business systems and have different formats and protocols.
[0100] The first message middleware may be an interface between the message adapter and the external system to ensure that the message can enter the processing flow of the message adapter safely and reliably.
[0101] The first message middleware can provide preliminary message processing and storage functions to prepare for subsequent message parsing and processing.
[0102] The first message middleware can also be used to verify the source and integrity of the message.
[0103] For example, the first message middleware can verify the source and integrity of the message through information such as the digital signature and message header information in the message to ensure that the message is legitimate and has not been tampered with.
[0104] Message processors can be used to perform in-depth processing on messages, including parsing, classification, prioritization, and encapsulation, to ensure that messages are forwarded in the correct format and order. They also provide fault handling and logging capabilities to improve system reliability and maintainability.
[0105] Message processors can identify the content and structure of messages and extract useful information through specific algorithms or rules.
[0106] The second message middleware can be an interface between the message adapter and different target systems to ensure that messages can be sent to the target system in the correct order and format.
[0107] The second message middleware can be used to receive the message sequence encapsulated from the message processor and send the messages in the message sequence to the target system in sequence. The messages in the message sequence have been parsed, classified and encapsulated and have a unified format and protocol.
[0108] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0109] Figure 2 This is a flow chart of a message conversion method provided by an embodiment of the present application. The execution subject of the embodiment of the present application may be a message processor. The processor may be implemented by software or by a combination of software and hardware. Figure 2 , the method comprising:
[0110] S201: Receive a first message sent by a first system through a first message middleware.
[0111] The first message includes a first identifier.
[0112] The first identifier is used to identify the source of the first message.
[0113] The first message may be information about business data, event notification, or status update.
[0114] The first message may include a message header, a message body, and at least one metadata.
[0115] Metadata can include message type, sending timestamp, etc.
[0116] The first system may be a source system of the first message, and the first system may be used to generate and send the message.
[0117] The message sent by the first system may have a specific format and protocol.
[0118] The first message middleware can receive the first message from the first system through the network interface, perform integrity verification on the first message, extract the first identifier in the first message after the verification is passed, and perform identity authentication on the first message based on the first identifier to obtain a verification result.
[0119] It should be noted that the first message sent by the first system can be received according to any feasible implementation method, and the embodiment of the present application is not limited to this.
[0120] S202: Store the first message in a target area according to the first identifier.
[0121] The target area is a storage area determined according to the first identifier.
[0122] The target area can be a specific location where the message is stored.
[0123] For example, the target area may be a memory queue, a disk file, a database, or other forms of storage media.
[0124] According to the message type field in the first identifier, the first message may be stored in a target area corresponding to the message type field.
[0125] The first message may be stored in a target area corresponding to the sender information according to the sender information in the first identifier.
[0126] For example, assuming that an order message is sent via DMQS message middleware, the first identifier of the order message may be the messageType field in the message header, whose value is order.
[0127] When the messageType field value of the first identifier is extracted as order, the message is stored in the target area corresponding to the order message.
[0128] It should be noted that the first message can be stored in the target area according to the first identifier in any feasible implementation manner, and the embodiment of the present application is not limited to this.
[0129] S203: parse and process at least one first message in the target area to obtain at least one message block and a priority corresponding to each message block.
[0130] The parsing process is used to identify and classify the content in the first message through a target algorithm.
[0131] The target algorithm can be a rule-based parser, regular expression, XML parser, JSON parser, machine learning algorithm, etc., depending on the format and content of the first message, which is not limited here.
[0132] A message block can be an independent data unit.
[0133] The message block may be composed of multiple first messages, or may be composed of at least one sub-message in a first message, which is not limited here.
[0134] Priority can be used to indicate the importance and urgency of a message block.
[0135] Priority can be represented by high, medium, low, or a numerical value, and is not limited here.
[0136] At least one first message in the target area can be parsed and processed by the target algorithm in the message processor to obtain the first feature of each first message, and at least one message block and the priority corresponding to each message block can be determined based on the first feature of each first message.
[0137] At least one first message may be input into a target algorithm in a message processor, and at least one message block and a priority corresponding to each message block may be output.
[0138] It should be noted that the at least one first message in the target area can be parsed and processed according to any feasible implementation method, and the embodiments of the present application are not limited to this.
[0139] S204: Encapsulate at least one message block in sequence according to the message type corresponding to the target area and the priority corresponding to each message block to obtain a second message sequence.
[0140] The second message sequence includes at least one second message.
[0141] Each second message in the second message sequence has an order.
[0142] The message type may be a message type corresponding to the target area, which refers to the type of messages stored in the area.
[0143] A message type corresponds to a message format, or a message type corresponds to a protocol.
[0144] Encapsulation processing may refer to encapsulating the sorted message blocks according to a specific format or protocol to generate a new message sequence.
[0145] The target encapsulation method can be determined according to the message type corresponding to the target area, and at least one message block can be sorted according to the priority corresponding to each message block to obtain a message block sequence. According to the target encapsulation method, the message blocks in the message block sequence are encapsulated in turn to obtain a second message sequence.
[0146] It should be noted that, at least one message block can be encapsulated and processed in sequence according to any feasible implementation method to obtain a second message sequence, and the embodiment of the present application is not limited to this.
[0147] S205: Send at least one second message in the second message sequence to the second system corresponding to the target area in sequence through the second message middleware.
[0148] The second system may be a recipient of the second message.
[0149] Each target area may correspond to one second system.
[0150] The second message middleware can extract the second messages from the second message queue in sequence and send the second messages to the second system corresponding to the target area. After sending the message, the second message middleware waits for a confirmation response from the second system. If a confirmation response is received, it may indicate that the second system has successfully received the second message; if no confirmation response is received or an error response is received, it may indicate that the second system has not successfully received the second message. The second message middleware will retry or record an error log and determine that the second message has failed to be sent until each second message in the second message queue is sent successfully or failed to be sent.
[0151] It should be noted that, according to any feasible implementation method, at least one second message in the second message sequence can be sent sequentially to the second system corresponding to the target area through the second message middleware, and this embodiment of the present application is not limited to this.
[0152] Optionally, for any second message, the second message can be sent to the second system corresponding to the target area in sequence through the second message middleware in the following manner: according to the second message, determine at least one target address of the second system through the second message middleware; according to the second message, generate second transmission information; according to at least one target address, send the second transmission information respectively.
[0153] The target address may refer to a specific address in the second system for receiving messages, and the target address may be one or more.
[0154] The second transmission information may be used to transmit specific information of the second message, including the content, format, protocol, etc. of the message.
[0155] In this way, the target address is determined based on the content of the second message, so that the system can dynamically adjust the target address according to different business needs without modifying the code or redeploying.
[0156] Optionally, after sending the second transmission information respectively according to at least one target address, the method also includes receiving response information corresponding to the second transmission information. The response information corresponding to the second transmission information can be received in the following manner: receiving the response information corresponding to the second transmission information, the response information includes the processing result; if the processing result is successful processing, the processing status of the second message is updated to successful processing, and the processing time is recorded; if the processing result is failed processing, the processing status of the second message is updated to failed processing, and the error information is recorded.
[0157] In this way, by logging error information, the system can quickly identify and process failed messages, improving the overall reliability of the system.
[0158] Optionally, after updating the processing status of the second message to processing failure and recording the error information, the method also includes: determining the number of retransmissions of the second message, if the number of retransmissions is less than or equal to a threshold, retransmitting the second message, if the number of retransmissions is greater than the threshold, determining that the second message has failed to be sent.
[0159] This embodiment provides a message conversion method, which includes receiving a first message sent by a first system through a first message middleware, the first message including a first identifier for identifying the source of the first message; storing the first message in a target area based on the first identifier, the target area being a storage area determined based on the first identifier; parsing at least one first message in the target area to obtain at least one message block and a priority corresponding to each message block, wherein the parsing process is used to identify and classify the content of the first message using a target algorithm; encapsulating the at least one message block in accordance with the message type corresponding to the target area and the priority corresponding to each message block to obtain a second message sequence, the second message sequence including at least one second message; and sending the at least one second message in the second message sequence to a second system corresponding to the target area through the second message middleware. In this way, the message adaptation function is decoupled from the business system, reducing dependence on the business system and improving the flexibility and maintainability of the system. Since the message adaptation function module is independent of the business system, it can be elastically scaled according to changes in message sending and receiving volume, better coping with business volume fluctuations. In addition, through parsing and prioritization, important messages are ensured to be processed and sent first, thereby improving message conversion efficiency.
[0160] Next, combine Figure 3, the process (S203) of parsing at least one first message in the target area to obtain at least one message block and the priority corresponding to each message block is explained.
[0161] Figure 3 This is a flow chart of another message conversion method provided by the embodiment of the present application. Based on the above embodiment, please refer to Figure 3 , the method comprising:
[0162] Below, any one of the at least one first message is taken as an example:
[0163] S301: Preprocess a first message to obtain a processed first message.
[0164] Preprocessing may include checking data integrity, decompression, decryption, removing redundant information, etc., which are not limited here.
[0165] The fields of the first message may be verified to determine whether all necessary fields are included. If so, redundant information in the message is removed to obtain a processed first message.
[0166] Optionally, if the business type corresponding to the first message is single-threaded consumption, before preprocessing the first message to obtain the processed first message, the method also includes determining whether the first message has a sending record. If so, delete the first message; if not, parse and process the first message.
[0167] S302: Divide the processed first message into multiple vocabulary units using a text segmentation algorithm.
[0168] A text segmentation algorithm may be an algorithm that breaks down a continuous text string into multiple vocabulary units.
[0169] Lexical units can be the basic units of text and can be used for subsequent text analysis and processing.
[0170] Lexical units can include lemmas, words, phrases, etc.
[0171] Optionally, text content that needs to be segmented may be extracted from the processed first message, and the text content may be segmented to obtain a plurality of vocabulary units.
[0172] Optionally, the processed first message may be input into a text segmentation algorithm to obtain a plurality of vocabulary units.
[0173] S303 , performing part-of-speech tagging on the multiple vocabulary units using a part-of-speech tagging algorithm to obtain multiple part-of-speech categories.
[0174] A part-of-speech tagging algorithm may be an algorithm that classifies lexical units into specific part-of-speech categories.
[0175] Optionally, part-of-speech tagging can be performed using predefined rules and dictionaries in a part-of-speech tagging algorithm to obtain multiple part-of-speech categories.
[0176] Optionally, a deep learning model in a part-of-speech tagging algorithm can be used to perform part-of-speech tagging to obtain multiple part-of-speech categories.
[0177] S304: Determine multiple semantic relationships between multiple vocabulary units.
[0178] Semantic relations can refer to the grammatical and semantic connections between lexical units in a sentence.
[0179] Multiple semantic relationships between multiple vocabulary units can be determined based on the dictionary and the knowledge base.
[0180] It is also possible to determine multiple semantic relationships between multiple vocabulary units based on preset rules.
[0181] S305: Determine a first feature corresponding to the first message according to the multiple part-of-speech types and the multiple semantic relationships.
[0182] The first feature may refer to key information or features extracted from the first message.
[0183] The first feature may include message timeliness and message keywords.
[0184] The first feature corresponding to the first message can be determined through a deep learning model based on multiple part-of-speech types and multiple semantic relationships.
[0185] S306: Classify the at least one first message according to the first characteristics corresponding to the at least one first message to obtain at least one message block.
[0186] The message block includes at least one first message.
[0187] Classification rules may be defined according to business requirements and analysis objectives. According to the classification rules, at least one first message may be classified according to first features corresponding to the at least one first message to obtain at least one message block.
[0188] In this way, the first message can be classified according to its characteristics to generate multiple message blocks, thereby providing structured data for subsequent processing and analysis.
[0189] Optionally, at least one first message can be classified according to the first features corresponding to the at least one first message in the following manner to obtain at least one message block: determining at least one keyword category based on at least one message keyword; for any keyword category, determining at least one first set corresponding to the keyword category; and determining at least one message block based on at least one first set.
[0190] The first set includes at least one first message, and the message validity period corresponding to each first message is the same.
[0191] In this way, a large number of messages can be effectively managed and processed through message blocks, ensuring that the system can process and analyze message content efficiently and accurately.
[0192] S307: Determine a weight value corresponding to each first message according to the first feature corresponding to at least one first message.
[0193] A weight mapping relationship may be determined according to business requirements and analysis objectives, and a weight value corresponding to each first message may be determined according to the weight mapping relationship and the first feature corresponding to at least one first message.
[0194] Optionally, the weight value corresponding to each first message can be determined according to the first feature corresponding to at least one first message in the following manner: obtain a first mapping relationship; determine the first weight corresponding to at least one first message according to the first mapping relationship and the keyword category corresponding to at least one first message; obtain a second mapping relationship; determine the second weight corresponding to at least one first message according to the second mapping relationship and the message timeliness corresponding to at least one first message; determine the weight value corresponding to each first message according to the first weight and the second weight.
[0195] The first mapping relationship includes multiple keyword categories and a first weight factor corresponding to each keyword category.
[0196] The second mapping relationship includes multiple message time-efficiencies and a second weight factor corresponding to each message time-efficiency.
[0197] The first mapping relationship and the second mapping relationship are preset.
[0198] In this way, messages can be prioritized through the comprehensive weight value to ensure that important and time-sensitive messages are processed first.
[0199] S308: For any message block, determine the priority of the message block according to the weight value of at least one first message corresponding to the message block.
[0200] A weight value of at least one first message corresponding to the message block may be determined, and the priority of the message block may be determined according to the size of the weight value.
[0201] The implementation content of each step in the embodiment of the present application can refer to the description of the corresponding steps or operations in the above method embodiment, and repeated content will not be repeated.
[0202] This embodiment provides a message conversion method. For any first message, the method preprocesses the first message to obtain a processed first message. The processed first message is divided into multiple lexical units using a text segmentation algorithm. The multiple lexical units are tagged with part-of-speech (POS) using a part-of-speech (POS) tagging algorithm to obtain multiple part-of-speech categories. Multiple semantic relationships between the multiple lexical units are determined. Based on the multiple POS types and the multiple semantic relationships, a first feature corresponding to the first message is determined. Based on the first feature corresponding to the at least one first message, the at least one first message is classified to obtain at least one message block, each of which includes at least one first message. A weight value corresponding to each first message is determined based on the first feature corresponding to the at least one first message. For any message block, the method prioritizes the message block based on the weight value of the at least one first message corresponding to the message block. In this way, through parsing and prioritization, important messages are prioritized for processing and transmission, thereby improving message conversion efficiency.
[0203] Figure 4 This is a structural diagram of a message conversion device provided in an embodiment of the present application. Figure 4 The message conversion device 400 includes a receiving module 401, a storage module 402, a parsing module 403, a packaging module 404 and a sending module 405, wherein,
[0204] A receiving module 401 is configured to receive, through the first message middleware, a first message sent by a first system, where the first message includes a first identifier, and the first identifier is used to identify a source of the first message;
[0205] A storage module 402 is configured to store the first message in a target area according to the first identifier, where the target area is a storage area determined according to the first identifier;
[0206] a parsing module 403 configured to parse at least one first message in the target area to obtain at least one message block and a priority corresponding to each message block, wherein the parsing is configured to identify and classify the content of the first message using a target algorithm;
[0207] an encapsulation module 404, configured to encapsulate the at least one message block in sequence according to the message type corresponding to the target area and the priority corresponding to each message block, to obtain a second message sequence, where the second message sequence includes at least one second message;
[0208] The sending module 405 is configured to send, in sequence, at least one second message in the second message sequence to the second system corresponding to the target area through the second message middleware.
[0209] In a possible implementation, the parsing module 403 is specifically configured to:
[0210] For any first message, identify the first message using the target algorithm to obtain a first feature corresponding to the first message;
[0211] classifying the at least one first message according to the first features respectively corresponding to the at least one first message to obtain at least one message block, where the message block includes the at least one first message;
[0212] Determining a weight value corresponding to each first message according to the first feature corresponding to the at least one first message;
[0213] For any message block, the priority of the message block is determined according to the weight value of at least one first message corresponding to the message block.
[0214] In a possible implementation, the parsing module 403 is specifically configured to:
[0215] preprocessing the first message to obtain a processed first message;
[0216] dividing the processed first message into a plurality of vocabulary units by a text segmentation algorithm;
[0217] Perform part-of-speech tagging on multiple vocabulary units using a part-of-speech tagging algorithm to obtain multiple part-of-speech categories;
[0218] Determine multiple semantic relationships between multiple lexical units;
[0219] A first feature corresponding to the first message is determined based on the multiple part-of-speech types and the multiple semantic relationships.
[0220] In a possible implementation, the first feature includes message timeliness and message keywords, and the parsing module 403 is specifically configured to:
[0221] determining at least one keyword category based on at least one message keyword;
[0222] For any keyword category, determining at least one first set corresponding to the keyword category, wherein the first set includes at least one first message, and each first message corresponds to the same message timeliness;
[0223] At least one message block is determined based on the at least one first set.
[0224] In a possible implementation, the parsing module 403 is specifically configured to:
[0225] Obtaining a first mapping relationship, where the first mapping relationship includes multiple keyword categories and a first weight factor corresponding to each keyword category;
[0226] Determining first weights corresponding to the at least one first message respectively according to the first mapping relationship and the keyword categories corresponding to the at least one first message respectively;
[0227] Obtain a second mapping relationship, where the second mapping relationship includes multiple message timelinesses and a second weighting factor corresponding to each message timeliness;
[0228] Determining a second weight corresponding to each of the at least one first message according to the second mapping relationship and the message timeliness corresponding to each of the at least one first message;
[0229] A weight value corresponding to each first message is determined according to the first weight and the second weight.
[0230] In a possible implementation, for any second message, the sending module 405 is specifically configured to:
[0231] determining, by a second message middleware, at least one target address of the second system according to the second message;
[0232] generating second transmission information according to the second message;
[0233] The second transmission information is sent respectively according to the at least one target address.
[0234] In a possible implementation, the sending module 405 is further configured to:
[0235] receiving response information corresponding to the second transmission information, the response information including a processing result;
[0236] If the processing result is successful, update the processing status of the second message to successful and record the processing time;
[0237] If the processing result is processing failure, the processing status of the second message is updated to processing failure, and the error information is recorded.
[0238] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 , the electronic device 500 may include: a memory 501 , a processor 502 , and a transceiver 503 .
[0239] The memory 501 is used to store computer-executable instructions;
[0240] The processor 502 is configured to execute the computer-executable instructions stored in the memory, so as to enable the electronic device 500 to perform the above method.
[0241] The transceiver 503 may include a transmitter and / or a receiver. The transmitter may also be referred to as a transmitter, a transmitter, a transmission port, a transmission interface, or similar descriptions, and the receiver may also be referred to as a receiver, a reception port, a reception interface, or similar descriptions. For example, the memory 501, the processor 502, and the transceiver 503 are interconnected via a bus 504.
[0242] An embodiment of the present application further provides a computer program product, which can be executed by a processor. When the computer program product is executed, the above method can be implemented.
[0243] The message conversion device, electronic device, computer-readable storage medium and computer program product of the embodiments of the present application can execute the technical solutions shown in the above method embodiments. Their implementation principles and beneficial effects are similar and will not be repeated here.
[0244] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all optional embodiments, and the actions and modules involved are not necessarily required by this application.
[0245] It should be further noted that, although the various steps in the flowchart are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps may be performed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily performed at the same time, but may be performed at different times. The execution order of these sub-steps or stages is not necessarily to be performed in sequence, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0246] It should be understood that the above-described device embodiments are merely illustrative, and the device of the present application may also be implemented in other ways. For example, the division of units / modules in the above-described embodiments is merely a logical functional division, and actual implementations may employ other division methods. For example, multiple units, modules, or components may be combined or integrated into another system, or some features may be omitted or not implemented.
[0247] In addition, unless otherwise specified, the functional units / modules in the various embodiments of the present application may be integrated into a single unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The aforementioned integrated units / modules may be implemented in the form of hardware or software program modules.
[0248] If an integrated unit / module is implemented in hardware, the hardware may be digital circuits, analog circuits, etc. The physical implementation of the hardware structure includes, but is not limited to, transistors, memristors, etc. Unless otherwise specified, the processor may be any appropriate hardware processor, such as a CPU, GPU, FPGA, DSP, and ASIC. Unless otherwise specified, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as resistive random access memory (RRAM), dynamic random access memory (DRAM), static random access memory (SRAM), enhanced dynamic random access memory (EDRAM), high-bandwidth memory (HBM), hybrid memory cube (HMC), etc.
[0249] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, 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. The computer software product is stored in a memory and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, magnetic disk, or optical disk, etc., various media that can store program code.
[0250] In the above embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a particular embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined in any way. To keep the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0251] 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 the present 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.
[0252] It should be understood that the present application is not limited to the exact structure 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 conversion method, characterized in that: Applied to a message adapter, the message adapter including a first message middleware and a second message middleware, the method comprising: Receiving, through the first message middleware, a first message sent by the first system, where the first message includes a first identifier, and the first identifier is used to identify a source of the first message; storing the first message in a target area according to the first identifier, where the target area is a storage area determined according to the first identifier; parsing at least one first message in the target area to obtain at least one message block and a priority corresponding to each message block, wherein the parsing is used to identify content in the first message and classify it using a target algorithm; encapsulating the at least one message block in sequence according to the message type corresponding to the target area and the priority corresponding to each message block to obtain a second message sequence, where the second message sequence includes at least one second message; At least one second message in the second message sequence is sent in sequence to the second system corresponding to the target area through the second message middleware.
2. The method according to claim 1, characterized in that Parsing at least one first message in the target area to obtain at least one message block and a priority corresponding to each message block includes: For any first message, identify the first message using the target algorithm to obtain a first feature corresponding to the first message; classifying the at least one first message according to the first features respectively corresponding to the at least one first message to obtain at least one message block, where the message block includes the at least one first message; Determining a weight value corresponding to each first message according to the first feature corresponding to the at least one first message; For any message block, the priority of the message block is determined according to the weight value of at least one first message corresponding to the message block.
3. The method according to claim 2, characterized in that Identifying the first message by using the target algorithm to obtain a first feature corresponding to the first message includes: preprocessing the first message to obtain a processed first message; dividing the processed first message into a plurality of vocabulary units by a text segmentation algorithm; Perform part-of-speech tagging on multiple vocabulary units using a part-of-speech tagging algorithm to obtain multiple part-of-speech categories; Determine multiple semantic relationships between multiple lexical units; A first feature corresponding to the first message is determined based on the multiple part-of-speech types and the multiple semantic relationships.
4. The method according to claim 2, characterized in that The first feature includes a message timeliness and a message keyword. The at least one first message is classified according to the first feature corresponding to each of the at least one first message to obtain at least one message block, including: determining at least one keyword category based on at least one message keyword; For any keyword category, determining at least one first set corresponding to the keyword category, wherein the first set includes at least one first message, and each first message corresponds to the same message timeliness; At least one message block is determined based on the at least one first set.
5. The method according to claim 4, characterized in that Determining a weight value corresponding to each first message according to the first feature corresponding to the at least one first message includes: Obtaining a first mapping relationship, where the first mapping relationship includes multiple keyword categories and a first weight factor corresponding to each keyword category; Determining first weights corresponding to the at least one first message respectively according to the first mapping relationship and the keyword categories corresponding to the at least one first message respectively; Obtain a second mapping relationship, where the second mapping relationship includes multiple message timelinesses and a second weighting factor corresponding to each message timeliness; Determining a second weight corresponding to each of the at least one first message according to the second mapping relationship and the message timeliness corresponding to each of the at least one first message; A weight value corresponding to each first message is determined according to the first weight and the second weight.
6. The method according to any one of claims 1 to 5, characterized in that For any second message, sending the second message to the second system corresponding to the target area in sequence through the second message middleware includes: determining, by a second message middleware, at least one target address of the second system according to the second message; generating second transmission information according to the second message; The second transmission information is sent respectively according to the at least one target address.
7. The method according to claim 6, characterized in that After sending the second transmission information respectively according to the at least one target address, the method further includes: receiving response information corresponding to the second transmission information, the response information including a processing result; If the processing result is successful, update the processing status of the second message to successful and record the processing time; If the processing result is processing failure, the processing status of the second message is updated to processing failure, and the error information is recorded.
8. A message conversion device, characterized in that: Applied to a message adapter, the message adapter includes a first message middleware and a second message middleware, and the device includes: a receiving module, configured to receive, through the first message middleware, a first message sent by the first system, wherein the first message includes a first identifier, and the first identifier is used to identify a source of the first message; a storage module, configured to store the first message in a target area according to the first identifier, where the target area is a storage area determined according to the first identifier; a parsing module, configured to parse at least one first message in the target area to obtain at least one message block and a priority corresponding to each message block, wherein the parsing process is configured to identify and classify content in the first message using a target algorithm; an encapsulation module, configured to encapsulate the at least one message block in sequence according to the message type corresponding to the target area and the priority corresponding to each message block, to obtain a second message sequence, where the second message sequence includes at least one second message; The sending module is configured to send, in sequence, at least one second message in the second message sequence to the second system corresponding to the target area through the second message middleware.
9. An electronic device, characterized in that: include: a processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.
11. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 7 when being executed by a processor.