Message management method, system, electronic device, storage medium and program product
By generating log files and embedding identification information during the message production and consumption process, the complexity and high cost of message transmission delay measurement and error location in the existing technology are solved, and simple and effective message transmission tracking and error location are achieved. .
Patent Information
- Application Number
- CN202210864258.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-21
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2042-07-21
AI Technical Summary
When existing technologies measure end-to-end message transmission delays or locate transmission error points in message production and consumption systems, the operations are complex and time-costly, and the entire system needs to be set up or modified.
By generating log files during the message production and consumption process, and embedding message upload request identification information and message identification information in the log files, tracking of message transmission is achieved.
It implements simple, low-cost, and easy-to-operate message transmission delay measurement and error location, which can effectively measure end-to-end message transmission delay and accurately locate the error point when an error occurs.
Smart Images

Figure CN115396530B
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of data processing technology, and in particular to a message management method, system, electronic device, storage medium, and program product. Background Art
[0002] With the development of science and technology, the application of message production and consumption is becoming more and more common. In the message production and consumption system, messages are sent from message producers to message consumers via message management devices. In this process, if you want to measure the end-to-end message transmission delay, or locate the transmission error point when a message transmission error occurs, you need to track the transmitted message. In the prior art, messages are usually tracked with the help of traceID, but this method requires the setting or modification of the entire message production and consumption system, which is not only complicated to operate, but also requires a high time cost. Summary of the invention
[0003] Embodiments of the present disclosure provide a message management method, system, electronic device, storage medium, and program product.
[0004] In a first aspect, an embodiment of the present disclosure provides a message management method.
[0005] Specifically, the message management method includes:
[0006] The message producer uploads the produced message to the message management device for storage, and generates a corresponding message production log file, wherein the message production log file carries message upload request identification information and / or message identification information, and the message upload request identification information corresponds to the message identification information;
[0007] The message management device sends the stored messages to message consumers and generates corresponding message consumption log files, wherein the message consumption log files carry message identification information;
[0008] In response to receiving a message management request, target message identification information carried in the message management request is obtained, and trajectory data corresponding to the target message is obtained according to the target message identification information.
[0009] In combination with the second aspect, in a first implementation of the second aspect of the embodiment of the present disclosure, the message producer uploads the produced message to the message management device for storage, and generates a corresponding message production log file, including:
[0010] The message producer generates a request for establishing a message upload channel based on the producer identification information and sends it to the message management device;
[0011] In response to receiving the request to establish a message upload channel, the message management device performs identity authentication on the message producer based on the producer identification information carried in the request to establish a message upload channel, establishes a message upload channel with the message producer after the identity authentication is passed, and sends a notification message to the message producer that the message upload channel has been established;
[0012] In response to receiving the notification message that the message upload channel has been established, the message producer sends a message upload request to the message management device using the established message upload channel, wherein the message upload request carries message upload request identification information and the message body, and generates a first message production log file after the sending is completed, wherein the first message production log file contains the message upload request identification information;
[0013] In response to receiving the message upload request, the message management device sets message identification information for the message body and generates a second message production log file, wherein the second message production log file includes the message identification information and the message upload request identification information;
[0014] The message management device stores the message body carried by the message upload request, and after the storage is completed, sends a message storage success notification message to the message producer, and generates a third message production log file, wherein the third message production log file includes the message identification information and the message upload request identification information;
[0015] In response to receiving the message storage success notification message, the message producer generates a fourth message production log file, wherein the fourth message production log file includes the message identification information and the message upload request identification information.
[0016] In combination with the second aspect and the first implementation of the second aspect, in the second implementation of the second aspect of the embodiment of the present disclosure, after the message producer generates the first message production log file, the method further includes:
[0017] The first message production log file is deduplicated using the message upload request identification information.
[0018] In combination with the second aspect, the first implementation of the second aspect, and the second implementation of the second aspect, in a third implementation of the second aspect of the present disclosure, the message management device sends the stored message to the message consumer and generates a corresponding message consumption log file, including:
[0019] The message consumer generates a request to establish a message consumption channel based on the consumer identification information and sends it to the message management device;
[0020] In response to receiving the request to establish a message consumption channel, the message management device performs identity authentication on the message consumer based on the consumer identification information carried in the request to establish a message consumption channel, establishes a message consumption channel with the message consumer after the identity authentication is passed, and sends a notification message to the message consumer that the message consumption channel has been established;
[0021] In response to receiving the notification message that the message consumption channel has been established, the message consumer uses the established message consumption channel to send a message consumption request to the message management device, wherein the message consumption request carries the subscription message attribute information;
[0022] After receiving the subscription message matching the subscription message attribute information, the message management device sends the subscription message to the message consumer through the message consumption channel immediately or regularly, and generates a first message consumption log file, wherein the first message consumption log file contains the subscription message identification information;
[0023] In response to receiving the subscription message through the message consumption channel, the message consumer generates a second message consumption log file, wherein the second message consumption log file includes the subscription message identification information; and sends a subscription message reception success feedback message to the message management device to generate a third message consumption log file, wherein the third message consumption log file includes the subscription message identification information;
[0024] In response to receiving the subscription message reception success feedback message, the message management device generates a fourth message consumption log file, wherein the fourth message consumption log file includes subscription message identification information.
[0025] In combination with the second aspect, the first implementation manner of the second aspect, the second implementation manner of the second aspect, and the third implementation manner of the second aspect, in a fourth implementation manner of the second aspect of the present disclosure, the message management device sends the stored message to the message consumer and generates a corresponding message consumption log file, including:
[0026] The message consumer generates a request to establish a message consumption channel based on the consumer identification information and sends it to the message management device;
[0027] In response to receiving the request to establish a message consumption channel, the message management device performs identity authentication on the message consumer based on the consumer identification information carried in the request to establish a message consumption channel, establishes a message consumption channel with the message consumer after the identity authentication is passed, and sends a notification message to the message consumer that the message consumption channel has been established;
[0028] In response to receiving the notification message that the message consumption channel has been established, the message consumer uses the established message consumption channel to send a message consumption request to the message management device immediately or periodically, wherein the message consumption request carries the subscription message attribute information;
[0029] The message management device sends the stored subscription message matching the subscription message attribute information to the message consumer through the message consumption channel, and generates a fifth message consumption log file, wherein the fifth message consumption log file includes subscription message identification information;
[0030] In response to receiving the subscription message through the message consumption channel, the message consumer generates a sixth message consumption log file, wherein the sixth message consumption log file includes the subscription message identification information; and sends a subscription message reception success feedback message to the message management device to generate a seventh message consumption log file, wherein the seventh message consumption log file includes the subscription message identification information;
[0031] In response to receiving the subscription message reception success feedback message, the message management device generates an eighth message consumption log file, wherein the eighth message consumption log file includes subscription message identification information.
[0032] In combination with the second aspect, the first implementation method of the second aspect, the second implementation method of the second aspect, the third implementation method of the second aspect and the fourth implementation method of the second aspect, in the fifth implementation method of the second aspect of the present disclosure, after the message consumer responds to receiving a notification message that a message consumption channel has been established, and uses the established message consumption channel to send a message consumption request to the message management device immediately or periodically, when the message management device determines that there is no message in the currently stored messages that matches the subscription message attribute information, it sends a no subscription message notification message to the message consumer through the message consumption channel.
[0033] In combination with the second aspect, the first implementation manner of the second aspect, the second implementation manner of the second aspect, the third implementation manner of the second aspect, the fourth implementation manner of the second aspect, and the fifth implementation manner of the second aspect, in a sixth implementation manner of the second aspect of the present disclosure, the acquiring the trajectory data of the corresponding target message according to the target message identification information includes:
[0034] Query the message production log file and the message consumption log file according to the target message identification information, and obtain the message production log file and the message consumption log file containing the target message identification information, or including the corresponding message upload request identification information, wherein the corresponding message upload request identification information is the message upload request identification information that is associated with the target message identification information;
[0035] The track data of the target message is determined according to the message production log file and the message consumption log file.
[0036] In a second aspect, a message management device is provided in an embodiment of the present disclosure.
[0037] Specifically, the message management device includes:
[0038] The message producer is configured to upload the produced message to the message management device for storage, and generate a corresponding message production log file, wherein the message production log file carries message upload request identification information and / or message identification information, and the message upload request identification information corresponds to the message identification information;
[0039] A message management device is configured to send stored messages to message consumers and generate corresponding message consumption log files, wherein the message consumption log files carry message identification information; in response to receiving a message management request, obtain the target message identification information carried in the message management request, and obtain the trajectory data of the corresponding target message according to the target message identification information.
[0040] In combination with the second aspect, in a first implementation of the second aspect of the embodiment of the present disclosure, the message producer uploads the produced message to the message management device for storage, and generates a corresponding message production log file, which is configured as follows:
[0041] The message producer generates a request for establishing a message upload channel based on the producer identification information and sends it to the message management device;
[0042] In response to receiving the request to establish a message upload channel, the message management device performs identity authentication on the message producer based on the producer identification information carried in the request to establish a message upload channel, establishes a message upload channel with the message producer after the identity authentication is passed, and sends a notification message to the message producer that the message upload channel has been established;
[0043] In response to receiving the notification message that the message upload channel has been established, the message producer sends a message upload request to the message management device using the established message upload channel, wherein the message upload request carries message upload request identification information and the message body, and generates a first message production log file after the sending is completed, wherein the first message production log file contains the message upload request identification information;
[0044] In response to receiving the message upload request, the message management device sets message identification information for the message body and generates a second message production log file, wherein the second message production log file includes the message identification information and the message upload request identification information;
[0045] The message management device stores the message body carried by the message upload request, and after the storage is completed, sends a message storage success notification message to the message producer, and generates a third message production log file, wherein the third message production log file includes the message identification information and the message upload request identification information;
[0046] In response to receiving the message storage success notification message, the message producer generates a fourth message production log file, wherein the fourth message production log file includes the message identification information and the message upload request identification information.
[0047] In combination with the second aspect and the first implementation of the second aspect, in the second implementation of the second aspect of the embodiment of the present disclosure, after the message producer generates the part of the first message production log file, it is further configured as follows:
[0048] The first message production log file is deduplicated using the message upload request identification information.
[0049] In combination with the second aspect, the first implementation of the second aspect, and the second implementation of the second aspect, in a third implementation of the second aspect of the present disclosure, the message management device sends the stored message to the message consumer, and generates a corresponding message consumption log file, which is configured as follows:
[0050] The message consumer generates a request to establish a message consumption channel based on the consumer identification information and sends it to the message management device;
[0051] In response to receiving the request to establish a message consumption channel, the message management device performs identity authentication on the message consumer based on the consumer identification information carried in the request to establish a message consumption channel, establishes a message consumption channel with the message consumer after the identity authentication is passed, and sends a notification message to the message consumer that the message consumption channel has been established;
[0052] In response to receiving the notification message that the message consumption channel has been established, the message consumer uses the established message consumption channel to send a message consumption request to the message management device, wherein the message consumption request carries the subscription message attribute information;
[0053] After receiving the subscription message matching the subscription message attribute information, the message management device sends the subscription message to the message consumer through the message consumption channel immediately or regularly, and generates a first message consumption log file, wherein the first message consumption log file contains the subscription message identification information;
[0054] In response to receiving the subscription message through the message consumption channel, the message consumer generates a second message consumption log file, wherein the second message consumption log file includes the subscription message identification information; and sends a subscription message reception success feedback message to the message management device to generate a third message consumption log file, wherein the third message consumption log file includes the subscription message identification information;
[0055] In response to receiving the subscription message reception success feedback message, the message management device generates a fourth message consumption log file, wherein the fourth message consumption log file includes subscription message identification information.
[0056] In combination with the second aspect, the first implementation manner of the second aspect, the second implementation manner of the second aspect, and the third implementation manner of the second aspect, in a fourth implementation manner of the second aspect of the present disclosure, the message management device sends the stored message to the message consumer, and generates a corresponding message consumption log file, which is configured as follows:
[0057] The message consumer generates a request to establish a message consumption channel based on the consumer identification information and sends it to the message management device;
[0058] In response to receiving the request to establish a message consumption channel, the message management device performs identity authentication on the message consumer based on the consumer identification information carried in the request to establish a message consumption channel, establishes a message consumption channel with the message consumer after the identity authentication is passed, and sends a notification message to the message consumer that the message consumption channel has been established;
[0059] In response to receiving the notification message that the message consumption channel has been established, the message consumer uses the established message consumption channel to send a message consumption request to the message management device immediately or periodically, wherein the message consumption request carries the subscription message attribute information;
[0060] The message management device sends the stored subscription message matching the subscription message attribute information to the message consumer through the message consumption channel, and generates a fifth message consumption log file, wherein the fifth message consumption log file includes subscription message identification information;
[0061] In response to receiving the subscription message through the message consumption channel, the message consumer generates a sixth message consumption log file, wherein the sixth message consumption log file includes the subscription message identification information; and sends a subscription message reception success feedback message to the message management device to generate a seventh message consumption log file, wherein the seventh message consumption log file includes the subscription message identification information;
[0062] In response to receiving the subscription message reception success feedback message, the message management device generates an eighth message consumption log file, wherein the eighth message consumption log file includes subscription message identification information.
[0063] In combination with the second aspect, the first implementation manner of the second aspect, the second implementation manner of the second aspect, the third implementation manner of the second aspect, and the fourth implementation manner of the second aspect, in a fifth implementation manner of the second aspect of the present disclosure, after the message consumer, in response to receiving a notification message that a message consumption channel has been established, uses the established message consumption channel to send a message consumption request to the message management device immediately or periodically, the message consumer is further configured to:
[0064] When the message management device determines that there is no message matching the subscription message attribute information in the currently stored messages, a no-subscription message notification message is sent to the message consumer through the message consumption channel.
[0065] In combination with the second aspect, the first implementation manner of the second aspect, the second implementation manner of the second aspect, the third implementation manner of the second aspect, the fourth implementation manner of the second aspect, and the fifth implementation manner of the second aspect, in a sixth implementation manner of the second aspect of the present disclosure, the part of acquiring the trajectory data of the corresponding target message according to the target message identification information is configured as follows:
[0066] Query the message production log file and the message consumption log file according to the target message identification information, and obtain the message production log file and the message consumption log file containing the target message identification information, or including the corresponding message upload request identification information, wherein the corresponding message upload request identification information is the message upload request identification information that is associated with the target message identification information;
[0067] The track data of the target message is determined according to the message production log file and the message consumption log file.
[0068] In a third aspect, an embodiment of the present disclosure provides an electronic device, including a memory and a processor, wherein the memory is used to store one or more computer instructions that support a message management device to execute the above-mentioned message management method, and the processor is configured to execute the computer instructions stored in the memory. The message management device may also include a communication interface for the message management device to communicate with other devices or a communication network.
[0069] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium for storing computer instructions used by a message management device, which includes computer instructions involved in the message management device for executing the above-mentioned message management method.
[0070] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned message management method when executed by a processor.
[0071] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0072] The above technical solution generates corresponding log files in the process of message production and consumption, and embeds message upload request identification information and / or message identification information in the log files, so as to track message transmission with the help of upload request identification information and / or message identification information. The technical solution is simple to implement, has low time cost, is easy to operate, can effectively measure the end-to-end message transmission delay, and can locate the transmission error point when a message transmission error occurs.
[0073] 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 embodiments of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] Other features, purposes and advantages of the embodiments of the present disclosure will become more apparent through the following detailed description of non-limiting embodiments in conjunction with the accompanying drawings. In the accompanying drawings:
[0075] Figure 1 A flowchart showing a message management method according to an embodiment of the present disclosure is shown;
[0076] Figure 2 A system block diagram of a message management system according to an embodiment of the present disclosure is shown;
[0077] Figure 3 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown;
[0078] Figure 4 It is a structural diagram of a computer system suitable for implementing a message management method according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0079] Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement them. In addition, for the sake of clarity, parts not related to the description of the exemplary embodiments are omitted in the accompanying drawings.
[0080] In the embodiments of the present disclosure, it should be understood that terms such as "including" or "having" are intended to indicate the existence of features, numbers, steps, behaviors, components, parts, or a combination thereof disclosed in this specification, and are not intended to exclude the possibility of one or more other features, numbers, steps, behaviors, components, parts, or a combination thereof existing or being added.
[0081] It should also be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0082] The technical solution provided by the embodiment of the present disclosure generates corresponding log files in the process of message production and consumption, and embeds message upload request identification information and / or message identification information in the log files, so as to track message transmission with the help of the upload request identification information and / or message identification information. The technical solution is simple to implement, has low time cost, is easy to operate, can effectively measure the end-to-end message transmission delay, and can locate the transmission error point when a message transmission error occurs.
[0083] Figure 1 A flowchart of a message management method according to an embodiment of the present disclosure is shown. Figure 1 As shown, the message management method includes the following steps S101-S103:
[0084] In step S101, the message producer uploads the produced message to the message management device for storage, and generates a corresponding message production log file, wherein the message production log file carries message upload request identification information and / or message identification information, and the message upload request identification information corresponds to the message identification information;
[0085] In step S102, the message management device sends the stored message to the message consumer and generates a corresponding message consumption log file, wherein the message consumption log file carries the message identification information;
[0086] In step S103, in response to receiving the message management request, the target message identification information carried in the message management request is obtained, and the trajectory data corresponding to the target message is obtained according to the target message identification information.
[0087] As mentioned above, with the development of science and technology, the application of message production and consumption is becoming more and more common. In the message production and consumption system, messages are sent from message producers to message consumers via message management devices. In this process, if you want to measure the end-to-end message transmission delay, or locate the transmission error point when a message transmission error occurs, you need to track the transmitted message. In the prior art, messages are usually tracked with the help of traceID, but this method requires the setting or modification of the entire message production and consumption system, which is not only complicated to operate, but also requires a high time cost.
[0088] In view of the above problems, in this embodiment, a message management method is proposed, which generates corresponding log files in the process of message production and consumption, and embeds message upload request identification information and / or message identification information in the log files, so as to track message transmission with the help of upload request identification information and / or message identification information. The technical solution is simple to implement, has low time cost, is easy to operate, can effectively measure the end-to-end message transmission delay, and can locate the transmission error point when a message transmission error occurs.
[0089] In one embodiment of the present disclosure, the message management method may be applicable to a message management system that manages messages, including a message producer, a message management device, and a message consumer. Figure 2 shown.
[0090] In one embodiment of the present disclosure, the message production log file refers to a file generated when a message producer produces a message and uploads the message to a message management device for storage, and is used to log the production and transmission status of the message, such as production time, transmission time, and transmission end. In order to identify the upload of the message and the message itself, the message production log file needs to carry message upload request identification information and / or message identification information, and there is a corresponding relationship between the message upload request identification information and the message identification information, so as to determine the corresponding message upload request identification information with the help of the message identification information, and determine the corresponding message identification information with the help of the message upload request identification information, so as to facilitate the subsequent tracking of the message.
[0091] In one embodiment of the present disclosure, the message consumption log file refers to a file generated when a message management device sends a message subscribed by a message consumer to a message consumer and a message consumer receives a subscribed message, and is used to log the consumption and transmission status of the message, such as the consumption time, transmission time, and transmission end. In order to identify the consumption of the message and the message itself, the message consumption log file needs to carry message identification information to track the message with the help of the message identification information.
[0092] In the above embodiment, the message producer uploads the produced message to the message management device for storage, and generates a corresponding message production log file carrying corresponding message upload request identification information and / or message identification information during the message uploading and storage process; subsequently, when the message management device sends the stored message to the message consumer, a corresponding message consumption log file carrying message identification information is also generated; in this way, after receiving the message management request, the trajectory data of the corresponding target message can be obtained according to the target message identification information carried in the message management request, so as to track the target message.
[0093] In one embodiment of the present disclosure, step S101, i.e., the step in which the message producer uploads the produced message to the message management device for storage and generates a corresponding message production log file, may include the following steps:
[0094] The message producer generates a request for establishing a message upload channel based on the producer identification information and sends it to the message management device;
[0095] In response to receiving the request to establish a message upload channel, the message management device performs identity authentication on the message producer based on the producer identification information carried in the request to establish a message upload channel, establishes a message upload channel with the message producer after the identity authentication is passed, and sends a notification message to the message producer that the message upload channel has been established;
[0096] In response to receiving the notification message that the message upload channel has been established, the message producer sends a message upload request to the message management device using the established message upload channel, wherein the message upload request carries message upload request identification information and the message body, and generates a first message production log file after the sending is completed, wherein the first message production log file contains the message upload request identification information;
[0097] In response to receiving the message upload request, the message management device sets message identification information for the message body and generates a second message production log file, wherein the second message production log file includes the message identification information and the message upload request identification information;
[0098] The message management device stores the message body carried by the message upload request, and after the storage is completed, sends a message storage success notification message to the message producer, and generates a third message production log file, wherein the third message production log file includes the message identification information and the message upload request identification information;
[0099] In response to receiving the message storage success notification message, the message producer generates a fourth message production log file, wherein the fourth message production log file includes the message identification information and the message upload request identification information.
[0100] In this implementation, in order to track messages, a corresponding message production log file carrying corresponding message upload request identification information and / or message identification information is generated during the message upload and storage process. Specifically:
[0101] First, the message producer generates a request to establish a message upload channel based on its producer identification information, and sends the request to establish a message upload channel to the message management device. The producer identification information refers to identification information used to distinguish the message producer, such as the message producer ID, etc. The request to establish a message upload channel refers to a request to establish a message upload channel, and the request to establish a message upload channel carries the producer identification information, so that the message management device establishes a message upload channel exclusive to the corresponding message producer according to the producer identification information.
[0102] Then, when the message management device receives the request to establish a message upload channel, it performs identity authentication on the message producer based on the producer identification information carried in the request to establish a message upload channel. After the identity authentication is passed, an exclusive message upload channel is established with the message producer, and a notification message that the message upload channel has been established is sent to the message producer to notify the message producer that the message upload channel has been established. The identity authentication refers to an operation to identify the legitimacy of the identity of the message producer based on the producer identification information.
[0103] After receiving the notification message that the message upload channel has been established, the message producer uses the established message upload channel to send a message upload request carrying message upload request identification information and the message body to the message management device, and generates a first message production log file after the sending is completed to mark that the message has been sent, wherein the first message production log file contains the message upload request identification information.
[0104] After receiving the message upload request, the message management device sets message identification information for the message body carried by the message upload request, and then generates a second message production log file to indicate that the message management device has received the message uploaded by the message producer, wherein the second message production log file includes both the message identification information and the message upload request identification information corresponding to the message identification information, so as to facilitate the subsequent determination of the corresponding message upload request identification information with the help of the message identification information, or to determine the corresponding message identification information with the help of the message upload request identification information.
[0105] Then, the message management device stores the message body carried by the message upload request, and after storage is completed, sends a message storage success notification message to the message producer to notify the message producer that the message has been stored successfully, and generates a third message production log file to indicate that the message management device has successfully stored the message uploaded by the message producer, wherein the third message production log file also contains both the message identification information and the message upload request identification information corresponding to the message identification information.
[0106] After receiving the message storage success notification message, the message producer generates a fourth message production log file to indicate that the message producer has learned that the message has been successfully stored, wherein the fourth message production log file also includes both the message identification information and the message upload request identification information corresponding to the message identification information.
[0107] In one embodiment of the present disclosure, after the step of the message producer generating the first message production log file, the following steps may also be included:
[0108] The first message production log file is deduplicated using the message upload request identification information.
[0109] Taking into account the situation that the messages generated by the message producer may be sent repeatedly due to poor network transmission quality, thereby generating multiple first message production log files including the same message upload request identification information. Therefore, in this embodiment, after the message producer generates the first message production log file, the message upload request identification information can also be used to deduplicate the first message production log file to remove redundant first message production log files including the same message upload request identification information.
[0110] In one embodiment of the present disclosure, step S102, i.e., the step in which the message management device sends the stored message to the message consumer and generates a corresponding message consumption log file, may include the following steps:
[0111] The message consumer generates a request to establish a message consumption channel based on the consumer identification information and sends it to the message management device;
[0112] In response to receiving the request to establish a message consumption channel, the message management device performs identity authentication on the message consumer based on the consumer identification information carried in the request to establish a message consumption channel, establishes a message consumption channel with the message consumer after the identity authentication is passed, and sends a notification message to the message consumer that the message consumption channel has been established;
[0113] In response to receiving the notification message that the message consumption channel has been established, the message consumer uses the established message consumption channel to send a message consumption request to the message management device, wherein the message consumption request carries the subscription message attribute information;
[0114] After receiving the subscription message matching the subscription message attribute information, the message management device sends the subscription message to the message consumer through the message consumption channel immediately or regularly, and generates a first message consumption log file, wherein the first message consumption log file contains the subscription message identification information;
[0115] In response to receiving the subscription message through the message consumption channel, the message consumer generates a second message consumption log file, wherein the second message consumption log file includes the subscription message identification information; and sends a subscription message reception success feedback message to the message management device to generate a third message consumption log file, wherein the third message consumption log file includes the subscription message identification information;
[0116] In response to receiving the subscription message reception success feedback message, the message management device generates a fourth message consumption log file, wherein the fourth message consumption log file includes subscription message identification information.
[0117] In this implementation, in order to track messages, a corresponding message consumption log file carrying message identification information is also generated during the message consumption process. Specifically:
[0118] First, the message consumer generates a request to establish a message consumption channel based on its consumer identification information, and sends the request to establish a message consumption channel to the message management device. The consumer identification information refers to identification information used to distinguish the message consumer, such as a message consumer ID, etc. The request to establish a message consumption channel refers to a request for establishing a message consumption channel, and the request to establish a message consumption channel carries the consumer identification information, so that the message management device establishes a message consumption channel exclusive to the corresponding message consumer according to the consumer identification information.
[0119] Then, when the message management device receives the request to establish a message consumption channel, it performs identity authentication on the message consumer based on the consumer identification information carried in the request to establish a message consumption channel. After the identity authentication is passed, an exclusive message consumption channel is established with the message consumer, and a notification message that a message consumption channel has been established is sent to the message consumer to notify the message consumer that the message consumption channel has been established. The identity authentication refers to an operation to identify the legitimacy of the identity of the message consumer based on the consumer identification information.
[0120] After receiving the notification message that the message consumption channel has been established, the message consumer uses the established message consumption channel to send a message consumption request carrying subscription message attribute information to the message management device, wherein the subscription message attribute information refers to information used to characterize what message the message consumer wants to subscribe to, for example, the subscription message attribute information can be subscription message category information, subscription message ID and other identification information, etc.
[0121] Subsequently, after receiving a subscription message that matches the subscription message attribute information, the message management device can send the subscription message to the message consumer through the message consumption channel immediately or periodically, and generate a first message consumption log file to indicate that the message management device has sent the subscription message, wherein the first message consumption log file contains subscription message identification information.
[0122] After the message consumer receives the subscription message through the message consumption channel, a second message consumption log file is generated to indicate that the message consumer has successfully received the message to which it has subscribed, wherein the second message consumption log file also includes the subscription message identification information; thereafter, the message consumer also sends a subscription message reception success feedback message to the message management device to notify the message management device that the message consumer has successfully received the message to which it has subscribed, and generates a third message consumption log file to indicate that the message consumer has fed back to the message management device that it has successfully received the subscription message, wherein the third message consumption log file also includes the subscription message identification information.
[0123] After receiving the subscription message reception success feedback message, the message management device generates a fourth message consumption log file to indicate that the message management device has learned that the message consumer has successfully received the subscribed message, wherein the fourth message consumption log file also includes subscription message identification information.
[0124] In the above implementation, the message management device sends the subscribed messages to the message consumers in a timed push manner. In another implementation of the present disclosure, the subscribed messages may also be sent to the message consumers based on the request of the message consumers.
[0125] That is, in another embodiment of the present disclosure, step S102, that is, the message management device sends the stored message to the message consumer and generates a corresponding message consumption log file, may include the following steps:
[0126] The message consumer generates a request to establish a message consumption channel based on the consumer identification information and sends it to the message management device;
[0127] In response to receiving the request to establish a message consumption channel, the message management device performs identity authentication on the message consumer based on the consumer identification information carried in the request to establish a message consumption channel, establishes a message consumption channel with the message consumer after the identity authentication is passed, and sends a notification message to the message consumer that the message consumption channel has been established;
[0128] In response to receiving the notification message that the message consumption channel has been established, the message consumer uses the established message consumption channel to send a message consumption request to the message management device immediately or periodically, wherein the message consumption request carries the subscription message attribute information;
[0129] The message management device sends the stored subscription message matching the subscription message attribute information to the message consumer through the message consumption channel, and generates a fifth message consumption log file, wherein the fifth message consumption log file includes subscription message identification information;
[0130] In response to receiving the subscription message through the message consumption channel, the message consumer generates a sixth message consumption log file, wherein the sixth message consumption log file includes the subscription message identification information; and sends a subscription message reception success feedback message to the message management device to generate a seventh message consumption log file, wherein the seventh message consumption log file includes the subscription message identification information;
[0131] In response to receiving the subscription message reception success feedback message, the message management device generates an eighth message consumption log file, wherein the eighth message consumption log file includes subscription message identification information.
[0132] In this implementation, after the message consumer sends a message consumption request to the message management device, if the message management device determines that there is no message matching the subscription message attribute information in the currently stored messages, a no subscription message notification message may be sent to the message consumer through the message consumption channel.
[0133] In one embodiment of the present disclosure, the step S103, i.e., the step of acquiring the trajectory data corresponding to the target message according to the target message identification information, may include the following steps:
[0134] Query the message production log file and the message consumption log file according to the target message identification information, and obtain the message production log file and the message consumption log file containing the target message identification information, or including the corresponding message upload request identification information, wherein the corresponding message upload request identification information is the message upload request identification information that is associated with the target message identification information;
[0135] The track data of the target message is determined according to the message production log file and the message consumption log file.
[0136] As mentioned above, the message production log file and the message consumption log file include message identification information and / or the corresponding message upload request identification information. Therefore, in this embodiment, the trajectory data of the corresponding target message can be obtained according to the target message identification information. Specifically: first, the message production log file and the message consumption log file can be queried according to the target message identification information to obtain the message production log file and the message consumption log file containing the target message identification information, or including the message upload request identification information corresponding to the target message identification information. Since the message production log file and the message consumption log file record the time and transmission end of message production, consumption, and transmission, the transmission trajectory data of the target message can be determined according to the message production log file and the message consumption log file, and the tracking and positioning of the target message can be realized, thereby realizing the determination of the message transmission delay between end and end, and the positioning of the transmission error point when the message transmission error occurs.
[0137] The following are embodiments of the apparatus of the present disclosure, which can be used to execute embodiments of the method of the present disclosure.
[0138] Figure 2 FIG. 1 shows a structural block diagram of a message management system according to an embodiment of the present disclosure. The system can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Figure 2 As shown, the message management system includes:
[0139] The message producer is configured to upload the produced message to the message management device for storage, and generate a corresponding message production log file, wherein the message production log file carries message upload request identification information and / or message identification information, and the message upload request identification information corresponds to the message identification information;
[0140] A message management device is configured to send stored messages to message consumers and generate corresponding message consumption log files, wherein the message consumption log files carry message identification information; in response to receiving a message management request, obtain the target message identification information carried in the message management request, and obtain the trajectory data of the corresponding target message according to the target message identification information.
[0141] As mentioned above, with the development of science and technology, the application of message production and consumption is becoming more and more common. In the message production and consumption system, messages are sent from message producers to message consumers via message management devices. In this process, if you want to measure the end-to-end message transmission delay, or locate the transmission error point when a message transmission error occurs, you need to track the transmitted message. In the prior art, messages are usually tracked with the help of traceID, but this method requires the setting or modification of the entire message production and consumption system, which is not only complicated to operate, but also requires a high time cost.
[0142] In view of the above problems, in this embodiment, a message management system is proposed, which generates corresponding log files in the process of message production and consumption, and embeds message upload request identification information and / or message identification information in the log files, so as to track message transmission with the help of upload request identification information and / or message identification information. The technical solution is simple to implement, has low time cost, is easy to operate, can effectively measure the end-to-end message transmission delay, and can locate the transmission error point when a message transmission error occurs.
[0143] In one embodiment of the present disclosure, the message management system may be applicable to a message management system that manages messages and includes a message producer, a message management device, and a message consumer.
[0144] In one embodiment of the present disclosure, the message production log file refers to a file generated when a message producer produces a message and uploads the message to a message management device for storage, and is used to log the production and transmission status of the message, such as production time, transmission time, and transmission end. In order to identify the upload of the message and the message itself, the message production log file needs to carry message upload request identification information and / or message identification information, and there is a corresponding relationship between the message upload request identification information and the message identification information, so as to determine the corresponding message upload request identification information with the help of the message identification information, and determine the corresponding message identification information with the help of the message upload request identification information, so as to facilitate the subsequent tracking of the message.
[0145] In one embodiment of the present disclosure, the message consumption log file refers to a file generated when a message management device sends a message subscribed by a message consumer to a message consumer and a message consumer receives a subscribed message, and is used to log the consumption and transmission status of the message, such as the consumption time, transmission time, and transmission end. In order to identify the consumption of the message and the message itself, the message consumption log file needs to carry message identification information to track the message with the help of the message identification information.
[0146] In the above embodiment, the message producer uploads the produced message to the message management device for storage, and generates a corresponding message production log file carrying corresponding message upload request identification information and / or message identification information during the message uploading and storage process; subsequently, when the message management device sends the stored message to the message consumer, a corresponding message consumption log file carrying message identification information is also generated; in this way, after receiving the message management request, the trajectory data of the corresponding target message can be obtained according to the target message identification information carried in the message management request, so as to track the target message.
[0147] In one embodiment of the present disclosure, the message producer uploads the produced message to the message management device for storage, and generates a corresponding message production log file, which may be configured as follows:
[0148] The message producer generates a request for establishing a message upload channel based on the producer identification information and sends it to the message management device;
[0149] In response to receiving the request to establish a message upload channel, the message management device performs identity authentication on the message producer based on the producer identification information carried in the request to establish a message upload channel, establishes a message upload channel with the message producer after the identity authentication is passed, and sends a notification message to the message producer that the message upload channel has been established;
[0150] In response to receiving the notification message that the message upload channel has been established, the message producer sends a message upload request to the message management device using the established message upload channel, wherein the message upload request carries message upload request identification information and the message body, and generates a first message production log file after the sending is completed, wherein the first message production log file contains the message upload request identification information;
[0151] In response to receiving the message upload request, the message management device sets message identification information for the message body and generates a second message production log file, wherein the second message production log file includes the message identification information and the message upload request identification information;
[0152] The message management device stores the message body carried by the message upload request, and after the storage is completed, sends a message storage success notification message to the message producer, and generates a third message production log file, wherein the third message production log file includes the message identification information and the message upload request identification information;
[0153] In response to receiving the message storage success notification message, the message producer generates a fourth message production log file, wherein the fourth message production log file includes the message identification information and the message upload request identification information.
[0154] In this implementation, in order to track messages, a corresponding message production log file carrying corresponding message upload request identification information and / or message identification information is generated during the message upload and storage process. Specifically:
[0155] First, the message producer generates a request to establish a message upload channel based on its producer identification information, and sends the request to establish a message upload channel to the message management device. The producer identification information refers to identification information used to distinguish the message producer, such as the message producer ID, etc. The request to establish a message upload channel refers to a request to establish a message upload channel, and the request to establish a message upload channel carries the producer identification information, so that the message management device establishes a message upload channel exclusive to the corresponding message producer according to the producer identification information.
[0156] Then, when the message management device receives the request to establish a message upload channel, it performs identity authentication on the message producer based on the producer identification information carried in the request to establish a message upload channel. After the identity authentication is passed, an exclusive message upload channel is established with the message producer, and a notification message that the message upload channel has been established is sent to the message producer to notify the message producer that the message upload channel has been established. The identity authentication refers to an operation to identify the legitimacy of the identity of the message producer based on the producer identification information.
[0157] After receiving the notification message that the message upload channel has been established, the message producer uses the established message upload channel to send a message upload request carrying message upload request identification information and the message body to the message management device, and generates a first message production log file after the sending is completed to mark that the message has been sent, wherein the first message production log file contains the message upload request identification information.
[0158] After receiving the message upload request, the message management device sets message identification information for the message body carried by the message upload request, and then generates a second message production log file to indicate that the message management device has received the message uploaded by the message producer, wherein the second message production log file includes both the message identification information and the message upload request identification information corresponding to the message identification information, so as to facilitate the subsequent determination of the corresponding message upload request identification information with the help of the message identification information, or to determine the corresponding message identification information with the help of the message upload request identification information.
[0159] Then, the message management device stores the message body carried by the message upload request, and after storage is completed, sends a message storage success notification message to the message producer to notify the message producer that the message has been stored successfully, and generates a third message production log file to indicate that the message management device has successfully stored the message uploaded by the message producer, wherein the third message production log file also contains both the message identification information and the message upload request identification information corresponding to the message identification information.
[0160] After receiving the message storage success notification message, the message producer generates a fourth message production log file to indicate that the message producer has learned that the message has been successfully stored, wherein the fourth message production log file also includes both the message identification information and the message upload request identification information corresponding to the message identification information.
[0161] In an embodiment of the present disclosure, after the message producer generates a portion of the first message production log file, it may also be configured as follows:
[0162] The first message production log file is deduplicated using the message upload request identification information.
[0163] Taking into account the situation that the messages generated by the message producer may be sent repeatedly due to poor network transmission quality, thereby generating multiple first message production log files including the same message upload request identification information. Therefore, in this embodiment, after the message producer generates the first message production log file, the message upload request identification information can also be used to deduplicate the first message production log file to remove redundant first message production log files including the same message upload request identification information.
[0164] In one embodiment of the present disclosure, the message management device sends the stored messages to the message consumers and generates a corresponding message consumption log file, which can be configured as follows:
[0165] The message consumer generates a request to establish a message consumption channel based on the consumer identification information and sends it to the message management device;
[0166] In response to receiving the request to establish a message consumption channel, the message management device performs identity authentication on the message consumer based on the consumer identification information carried in the request to establish a message consumption channel, establishes a message consumption channel with the message consumer after the identity authentication is passed, and sends a notification message to the message consumer that the message consumption channel has been established;
[0167] In response to receiving the notification message that the message consumption channel has been established, the message consumer uses the established message consumption channel to send a message consumption request to the message management device, wherein the message consumption request carries the subscription message attribute information;
[0168] After receiving the subscription message matching the subscription message attribute information, the message management device sends the subscription message to the message consumer through the message consumption channel immediately or regularly, and generates a first message consumption log file, wherein the first message consumption log file contains the subscription message identification information;
[0169] In response to receiving the subscription message through the message consumption channel, the message consumer generates a second message consumption log file, wherein the second message consumption log file includes the subscription message identification information; and sends a subscription message reception success feedback message to the message management device to generate a third message consumption log file, wherein the third message consumption log file includes the subscription message identification information;
[0170] In response to receiving the subscription message reception success feedback message, the message management device generates a fourth message consumption log file, wherein the fourth message consumption log file includes subscription message identification information.
[0171] In this implementation, in order to track messages, a corresponding message consumption log file carrying message identification information is also generated during the message consumption process. Specifically:
[0172] First, the message consumer generates a request to establish a message consumption channel based on its consumer identification information, and sends the request to establish a message consumption channel to the message management device. The consumer identification information refers to identification information used to distinguish the message consumer, such as a message consumer ID, etc. The request to establish a message consumption channel refers to a request for establishing a message consumption channel, and the request to establish a message consumption channel carries the consumer identification information, so that the message management device establishes a message consumption channel exclusive to the corresponding message consumer according to the consumer identification information.
[0173] Then, when the message management device receives the request to establish a message consumption channel, it performs identity authentication on the message consumer based on the consumer identification information carried in the request to establish a message consumption channel. After the identity authentication is passed, an exclusive message consumption channel is established with the message consumer, and a notification message that a message consumption channel has been established is sent to the message consumer to notify the message consumer that the message consumption channel has been established. The identity authentication refers to an operation to identify the legitimacy of the identity of the message consumer based on the consumer identification information.
[0174] After receiving the notification message that the message consumption channel has been established, the message consumer uses the established message consumption channel to send a message consumption request carrying subscription message attribute information to the message management device, wherein the subscription message attribute information refers to information used to characterize what message the message consumer wants to subscribe to, for example, the subscription message attribute information can be subscription message category information, subscription message ID and other identification information, etc.
[0175] Subsequently, after receiving a subscription message that matches the subscription message attribute information, the message management device can send the subscription message to the message consumer through the message consumption channel immediately or periodically, and generate a first message consumption log file to indicate that the message management device has sent the subscription message, wherein the first message consumption log file contains subscription message identification information.
[0176] After the message consumer receives the subscription message through the message consumption channel, a second message consumption log file is generated to indicate that the message consumer has successfully received the message to which it has subscribed, wherein the second message consumption log file also includes the subscription message identification information; thereafter, the message consumer also sends a subscription message reception success feedback message to the message management device to notify the message management device that the message consumer has successfully received the message to which it has subscribed, and generates a third message consumption log file to indicate that the message consumer has fed back to the message management device that it has successfully received the subscription message, wherein the third message consumption log file also includes the subscription message identification information.
[0177] After receiving the subscription message reception success feedback message, the message management device generates a fourth message consumption log file to indicate that the message management device has learned that the message consumer has successfully received the subscribed message, wherein the fourth message consumption log file also includes subscription message identification information.
[0178] In the above implementation, the message management device sends the subscribed messages to the message consumers in a timed push manner. In another implementation of the present disclosure, the subscribed messages may also be sent to the message consumers based on the request of the message consumers.
[0179] That is, in another embodiment of the present disclosure, the message management device sends the stored messages to the message consumers and generates a corresponding message consumption log file, which can also be configured as follows:
[0180] The message consumer generates a request to establish a message consumption channel based on the consumer identification information and sends it to the message management device;
[0181] In response to receiving the request to establish a message consumption channel, the message management device performs identity authentication on the message consumer based on the consumer identification information carried in the request to establish a message consumption channel, establishes a message consumption channel with the message consumer after the identity authentication is passed, and sends a notification message to the message consumer that the message consumption channel has been established;
[0182] In response to receiving the notification message that the message consumption channel has been established, the message consumer uses the established message consumption channel to send a message consumption request to the message management device immediately or periodically, wherein the message consumption request carries the subscription message attribute information;
[0183] The message management device sends the stored subscription message matching the subscription message attribute information to the message consumer through the message consumption channel, and generates a fifth message consumption log file, wherein the fifth message consumption log file includes subscription message identification information;
[0184] In response to receiving the subscription message through the message consumption channel, the message consumer generates a sixth message consumption log file, wherein the sixth message consumption log file includes the subscription message identification information; and sends a subscription message reception success feedback message to the message management device to generate a seventh message consumption log file, wherein the seventh message consumption log file includes the subscription message identification information;
[0185] In response to receiving the subscription message reception success feedback message, the message management device generates an eighth message consumption log file, wherein the eighth message consumption log file includes subscription message identification information.
[0186] In this implementation, after the message consumer sends a message consumption request to the message management device, if the message management device determines that there is no message matching the subscription message attribute information in the currently stored messages, a no subscription message notification message may be sent to the message consumer through the message consumption channel.
[0187] In one embodiment of the present disclosure, the part of acquiring the trajectory data of the corresponding target message according to the target message identification information may be configured as follows:
[0188] Query the message production log file and the message consumption log file according to the target message identification information, and obtain the message production log file and the message consumption log file containing the target message identification information, or including the corresponding message upload request identification information, wherein the corresponding message upload request identification information is the message upload request identification information that is associated with the target message identification information;
[0189] The track data of the target message is determined according to the message production log file and the message consumption log file.
[0190] As mentioned above, the message production log file and the message consumption log file include message identification information and / or the corresponding message upload request identification information. Therefore, in this embodiment, the trajectory data of the corresponding target message can be obtained according to the target message identification information. Specifically: first, the message production log file and the message consumption log file can be queried according to the target message identification information to obtain the message production log file and the message consumption log file containing the target message identification information, or including the message upload request identification information corresponding to the target message identification information. Since the message production log file and the message consumption log file record the time and transmission end of message production, consumption, and transmission, the transmission trajectory data of the target message can be determined according to the message production log file and the message consumption log file, and the tracking and positioning of the target message can be realized, thereby realizing the determination of the message transmission delay between end and end, and the positioning of the transmission error point when the message transmission error occurs.
[0191] The present disclosure also discloses an electronic device, Figure 3 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown. Figure 3 As shown, the electronic device 300 includes a memory 301 and a processor 302; wherein,
[0192] The memory 301 is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor 302 to implement the above method steps.
[0193] Figure 4 It is a structural diagram of a computer system suitable for implementing a message management method according to an embodiment of the present disclosure.
[0194] like Figure 4 As shown, the computer system 400 includes a processing unit 401, which can perform various processes in the above-mentioned embodiments according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage part 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the computer system 400 are also stored. The processing unit 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0195] The following components are connected to the I / O interface 405: an input section 406 including a keyboard, a mouse, etc.; an output section 407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN card, a modem, etc. The communication section 409 performs communication processing via a network such as the Internet. The drive 410 is also connected to the I / O interface 405 as needed. Removable media 411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., are installed on the drive 410 as needed, so that the computer program read therefrom is installed into the storage section 408 as needed. Among them, the processing unit 401 can be implemented as a processing unit such as a CPU, a GPU, a TPU, an FPGA, an NPU, etc.
[0196] In particular, according to an embodiment of the present disclosure, the method described above can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program tangibly contained on a readable medium thereof, and the computer program includes a program code for executing the message management method. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 409, and / or installed from a removable medium 411.
[0197] The embodiment of the present disclosure also discloses a computer program product, which includes a computer program / instruction, and when the computer program / instruction is executed by a processor, any of the above method steps is implemented.
[0198] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the road map or block diagram can represent a part of a module, program segment or code, and the part of the module, program segment or code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a different order from the order marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0199] The units or modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The units or modules described may also be set in a processor, and the names of these units or modules do not constitute limitations on the units or modules themselves in some cases.
[0200] As another aspect, the embodiments of the present disclosure further provide a computer-readable storage medium, which may be a computer-readable storage medium included in the device described in the above-mentioned embodiment; or a computer-readable storage medium that exists independently and is not assembled into the device. The computer-readable storage medium stores one or more programs, and the programs are used by one or more processors to execute the methods described in the embodiments of the present disclosure.
[0201] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure.
Claims
1. A message management method, comprising: The message producer uploads the produced message to the message management device for storage, and generates a corresponding message production log file, wherein the message production log file carries message upload request identification information and / or message identification information, and the message upload request identification information corresponds to the message identification information; The message management device sends the stored messages to message consumers and generates corresponding message consumption log files, wherein the message consumption log files carry message identification information; In response to receiving a message management request, obtaining target message identification information carried in the message management request, and obtaining trajectory data corresponding to the target message according to the target message identification information; The message producer uploads the produced message to the message management device for storage, and generates a corresponding message production log file, including: The message producer generates a request for establishing a message upload channel based on the producer identification information and sends it to the message management device; In response to receiving the request to establish a message upload channel, the message management device performs identity authentication on the message producer based on the producer identification information carried in the request to establish a message upload channel, establishes a message upload channel with the message producer after the identity authentication is passed, and sends a notification message to the message producer that the message upload channel has been established; In response to receiving the notification message that the message upload channel has been established, the message producer sends a message upload request to the message management device using the established message upload channel, wherein the message upload request carries message upload request identification information and the message body, and generates a first message production log file after the sending is completed, wherein the first message production log file contains the message upload request identification information; In response to receiving the message upload request, the message management device sets message identification information for the message body and generates a second message production log file, wherein the second message production log file includes the message identification information and the message upload request identification information; The message management device stores the message body carried by the message upload request, and after the storage is completed, sends a message storage success notification message to the message producer, and generates a third message production log file, wherein the third message production log file includes the message identification information and the message upload request identification information; In response to receiving the message storage success notification message, the message producer generates a fourth message production log file, wherein the fourth message production log file includes the message identification information and the message upload request identification information.
2. The method according to claim 1, after the message producer generates the first message production log file, further comprising: The first message production log file is deduplicated using the message upload request identification information.
3. According to the method of claim 1 or 2, the message management device sends the stored messages to the message consumers and generates corresponding message consumption log files, including: The message consumer generates a request to establish a message consumption channel based on the consumer identification information and sends it to the message management device; In response to receiving the request to establish a message consumption channel, the message management device performs identity authentication on the message consumer based on the consumer identification information carried in the request to establish a message consumption channel, establishes a message consumption channel with the message consumer after the identity authentication is passed, and sends a notification message to the message consumer that the message consumption channel has been established; In response to receiving the notification message that the message consumption channel has been established, the message consumer uses the established message consumption channel to send a message consumption request to the message management device, wherein the message consumption request carries the subscription message attribute information; After receiving the subscription message matching the subscription message attribute information, the message management device sends the subscription message to the message consumer through the message consumption channel immediately or regularly, and generates a first message consumption log file, wherein the first message consumption log file contains the subscription message identification information; In response to receiving the subscription message through the message consumption channel, the message consumer generates a second message consumption log file, wherein the second message consumption log file includes the subscription message identification information; and sends a subscription message reception success feedback message to the message management device to generate a third message consumption log file, wherein the third message consumption log file includes the subscription message identification information; In response to receiving the subscription message reception success feedback message, the message management device generates a fourth message consumption log file, wherein the fourth message consumption log file includes subscription message identification information.
4. According to the method of claim 1 or 2, the message management device sends the stored messages to the message consumers and generates corresponding message consumption log files, including: The message consumer generates a request to establish a message consumption channel based on the consumer identification information and sends it to the message management device; In response to receiving the request to establish a message consumption channel, the message management device performs identity authentication on the message consumer based on the consumer identification information carried in the request to establish a message consumption channel, establishes a message consumption channel with the message consumer after the identity authentication is passed, and sends a notification message to the message consumer that the message consumption channel has been established; In response to receiving the notification message that the message consumption channel has been established, the message consumer uses the established message consumption channel to send a message consumption request to the message management device immediately or periodically, wherein the message consumption request carries the subscription message attribute information; The message management device sends the stored subscription message matching the subscription message attribute information to the message consumer through the message consumption channel, and generates a fifth message consumption log file, wherein the fifth message consumption log file includes subscription message identification information; In response to receiving the subscription message through the message consumption channel, the message consumer generates a sixth message consumption log file, wherein the sixth message consumption log file includes the subscription message identification information; and sends a subscription message reception success feedback message to the message management device to generate a seventh message consumption log file, wherein the seventh message consumption log file includes the subscription message identification information; In response to receiving the subscription message reception success feedback message, the message management device generates an eighth message consumption log file, wherein the eighth message consumption log file includes subscription message identification information.
5. According to the method described in claim 4, after the message consumer responds to receiving a notification message that a message consumption channel has been established and uses the established message consumption channel to send a message consumption request to the message management device immediately or periodically, when the message management device determines that there is no message in the currently stored messages that matches the subscription message attribute information, a no subscription message notification message is sent to the message consumer through the message consumption channel.
6. The method according to claim 1, 2 or 5, wherein the step of obtaining the trajectory data of the corresponding target message according to the target message identification information comprises: Query the message production log file and the message consumption log file according to the target message identification information, and obtain the message production log file and the message consumption log file containing the target message identification information, or including the corresponding message upload request identification information, wherein the corresponding message upload request identification information is the message upload request identification information that is associated with the target message identification information; The track data of the target message is determined according to the message production log file and the message consumption log file.
7. A message management system, comprising: The message producer is configured to upload the produced message to the message management device for storage, and generate a corresponding message production log file, wherein the message production log file carries message upload request identification information and / or message identification information, and the message upload request identification information corresponds to the message identification information; A message management device, configured to send the stored messages to message consumers and generate a corresponding message consumption log file, wherein the message consumption log file carries message identification information; in response to receiving a message management request, obtain target message identification information carried in the message management request, and obtain trajectory data corresponding to the target message according to the target message identification information; The part in which the message producer uploads the produced message to the message management device for storage and generates the corresponding message production log file is configured as follows: The message producer generates a request for establishing a message upload channel based on the producer identification information and sends it to the message management device; In response to receiving the request to establish a message upload channel, the message management device performs identity authentication on the message producer based on the producer identification information carried in the request to establish a message upload channel, establishes a message upload channel with the message producer after the identity authentication is passed, and sends a notification message to the message producer that the message upload channel has been established; In response to receiving the notification message that the message upload channel has been established, the message producer sends a message upload request to the message management device using the established message upload channel, wherein the message upload request carries message upload request identification information and the message body, and generates a first message production log file after the sending is completed, wherein the first message production log file contains the message upload request identification information; In response to receiving the message upload request, the message management device sets message identification information for the message body and generates a second message production log file, wherein the second message production log file includes the message identification information and the message upload request identification information; The message management device stores the message body carried by the message upload request, and after the storage is completed, sends a message storage success notification message to the message producer, and generates a third message production log file, wherein the third message production log file includes the message identification information and the message upload request identification information; In response to receiving the message storage success notification message, the message producer generates a fourth message production log file, wherein the fourth message production log file includes the message identification information and the message upload request identification information.
8. The system according to claim 7, after the message producer generates the part of the first message production log file, is further configured to: The first message production log file is deduplicated using the message upload request identification information.
9. According to the system of claim 7 or 8, the part in which the message management device sends the stored messages to the message consumers and generates the corresponding message consumption log file is configured as follows: The message consumer generates a request to establish a message consumption channel based on the consumer identification information and sends it to the message management device; In response to receiving the request to establish a message consumption channel, the message management device performs identity authentication on the message consumer based on the consumer identification information carried in the request to establish a message consumption channel, establishes a message consumption channel with the message consumer after the identity authentication is passed, and sends a notification message to the message consumer that the message consumption channel has been established; In response to receiving the notification message that the message consumption channel has been established, the message consumer uses the established message consumption channel to send a message consumption request to the message management device, wherein: The message consumption request carries subscription message attribute information; After receiving the subscription message matching the subscription message attribute information, the message management device sends the subscription message to the message consumer through the message consumption channel immediately or regularly, and generates a first message consumption log file, wherein the first message consumption log file contains the subscription message identification information; In response to receiving the subscription message through the message consumption channel, the message consumer generates a second message consumption log file, wherein the second message consumption log file includes the subscription message identification information; and sends a subscription message reception success feedback message to the message management device to generate a third message consumption log file, wherein the third message consumption log file includes the subscription message identification information; In response to receiving the subscription message reception success feedback message, the message management device generates a fourth message consumption log file, wherein the fourth message consumption log file includes subscription message identification information.
10. According to the system of claim 7 or 8, the message management device sends the stored messages to the message consumers and generates a corresponding message consumption log file, which is configured as follows: The message consumer generates a request to establish a message consumption channel based on the consumer identification information and sends it to the message management device; In response to receiving the request to establish a message consumption channel, the message management device performs identity authentication on the message consumer based on the consumer identification information carried in the request to establish a message consumption channel, establishes a message consumption channel with the message consumer after the identity authentication is passed, and sends a notification message to the message consumer that the message consumption channel has been established; In response to receiving the notification message that the message consumption channel has been established, the message consumer uses the established message consumption channel to send a message consumption request to the message management device immediately or periodically, wherein: The message consumption request carries subscription message attribute information; The message management device sends the stored subscription message matching the subscription message attribute information to the message consumer through the message consumption channel, and generates a fifth message consumption log file, wherein the fifth message consumption log file includes subscription message identification information; In response to receiving the subscription message through the message consumption channel, the message consumer generates a sixth message consumption log file, wherein the sixth message consumption log file includes the subscription message identification information; and sends a subscription message reception success feedback message to the message management device to generate a seventh message consumption log file, wherein the seventh message consumption log file includes the subscription message identification information; In response to receiving the subscription message reception success feedback message, the message management device generates an eighth message consumption log file, wherein the eighth message consumption log file includes subscription message identification information.
11. The system according to claim 10, in response to receiving a notification message that a message consumption channel has been established, after the message consumer uses the established message consumption channel to send a message consumption request to the message management device immediately or periodically, the message consumer is further configured to: When the message management device determines that there is no message matching the subscription message attribute information in the currently stored messages, a no-subscription message notification message is sent to the message consumer through the message consumption channel.
12. The system according to claim 7, 8 or 11, wherein the part of acquiring the trajectory data corresponding to the target message according to the target message identification information is configured as follows: The message production log file and the message consumption log file are queried according to the target message identification information to obtain the message production log file and the message consumption log file containing the target message identification information or including the corresponding message upload request identification information, wherein: The corresponding message upload request identification information is the message upload request identification information associated with the target message identification information; The track data of the target message is determined according to the message production log file and the message consumption log file.
13. An electronic device comprising a memory and a processor; wherein: The memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the steps of the method according to any one of claims 1 to 6.
14. A computer-readable storage medium having computer instructions stored thereon, wherein: When the computer instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
