Message processing method, device, equipment and storage medium
By determining the target topic message and boundary message index in the message queue and deleting the static message log file, the problem of degraded message queue performance is solved, and more efficient message cleaning and storage space utilization is achieved.
Patent Information
- Application Number
- CN202310149798.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-13
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2043-02-13
AI Technical Summary
With the increase in the frequency of message interactions and the number of messages in the message queue, it has a negative impact on the operation performance of the message queue. It is difficult for the prior art to improve the performance of the message queue while ensuring consumer demand on the consumer side.
By determining the target topic message from the topic message sequence of the message queue, and querying the boundary message index and log files according to the target message index file, deleting the static message log file in the message log file sequence that is arranged before the boundary message log file, the target message queue containing the dynamic message log file is obtained.
It improves the accuracy of identifying the consumption demand of message log files in the message queue, improves message cleaning efficiency, saves storage space, and improves the storage space utilization and operation performance of the message queue.
Smart Images

Figure CN116320010B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the fields of the Internet and cloud computing, and more specifically, to a message processing method, apparatus, device, storage medium, and program product. Background Art
[0002] With the rapid development of Internet technology, the demand for information interaction has increased dramatically. As an intermediate medium for information interaction, the message queue can save messages (i.e., information in the interaction process) and ensure the delivery of messages. For example, if the recipient is unavailable when sending a message, the message queue will retain the message until the message can be successfully delivered.
[0003] In the process of realizing the concept disclosed in the present invention, the inventors found that there are at least the following problems in the related technology: as the frequency of message interaction and the number of messages in the message queue continue to increase, the operating performance of the message queue is greatly negatively affected, and the method for processing messages in the message queue in the related technology is difficult to improve the performance of the message queue while ensuring the consumption needs of the consumer end, which has a certain negative impact on the information interaction needs of the consumer end. Summary of the invention
[0004] In view of this, the present disclosure provides a message processing method, apparatus, device, storage medium and program product.
[0005] One aspect of the present disclosure provides a message processing method, including:
[0006] Determine a target topic message from a topic message sequence in a message queue, wherein the initial topic messages in the topic message sequence are arranged in a time sequence according to the respective message storage moments;
[0007] Determine a boundary message index file from a message index file sequence according to the target message index file corresponding to the target subject message, wherein the boundary message index file is adjacent to the target message index file in time sequence and is located before the target message index file;
[0008] Using the boundary message index in the boundary message index file, the boundary message index whose message index storage moment satisfies the preset timing rule, to query the boundary message log file from the message log file sequence; and
[0009] The static message log file arranged before the boundary message log file in the message log file sequence is deleted to obtain a target message queue including dynamic message log files.
[0010] According to an embodiment of the present disclosure, the target message queue includes a first message node, and the first message node stores a node topic message set corresponding to the topic identifier;
[0011] The message processing method further includes:
[0012] In the case where the first node occupied space of the first message node is greater than the node occupied space threshold, filtering out a target node topic message set from the first message node; and
[0013] The target node topic message set is migrated to a target idle message node in an idle state to obtain a second message node.
[0014] According to an embodiment of the present disclosure, the target message queue includes a plurality of message nodes;
[0015] The message processing method further includes:
[0016] According to the node resource idle attribute information of each of the plurality of the message nodes, the target idle message node is selected from the target message queue;
[0017] The node resource idle attribute information includes at least one of the following:
[0018] Node memory free information, node computing resource free information, node storage space free information.
[0019] According to an embodiment of the present disclosure, determining a target topic message from a topic message sequence in a message queue includes:
[0020] From the above topic message sequence, a first initial topic message with a consumption completion status is screened out to obtain a first initial topic message subsequence;
[0021] Determine the first initial topic message that satisfies the preset timing rule in the first initial topic message subsequence as the first candidate topic message; and
[0022] According to the first candidate message storage time of the above-mentioned first candidate topic message and the configuration retention attribute information of the above-mentioned topic message sequence, the target topic message is determined from the above-mentioned topic message sequence.
[0023] According to an embodiment of the present disclosure, the above-mentioned configuration retention attribute information includes configuration retention duration;
[0024] Wherein, according to the first candidate message storage time of the first candidate topic message and the configuration retention attribute information of the topic message sequence, determining the target topic message from the topic message sequence includes:
[0025] From the above topic message sequence, filter out expired topic messages whose storage duration is longer than the above configured retention duration;
[0026] In the case where there are multiple expired subject messages, a candidate expired subject message with the latest storage time of the expired message is selected from the multiple expired subject messages;
[0027] Comparing the first candidate message storage time of the first candidate topic message with the expired message storage time of the candidate expired topic message in a time sequence relationship to obtain a first time sequence comparison result; and
[0028] According to the first timing comparison result, the target topic message is determined from the first candidate topic message and the candidate expired topic message.
[0029] According to an embodiment of the present disclosure, the configuration retention attribute information includes configuration retention space;
[0030] Wherein, according to the first candidate message storage time of the first candidate topic message and the configuration retention attribute information of the topic message sequence, determining the target topic message from the topic message sequence includes:
[0031] According to the above-mentioned configuration reserved space, a second candidate topic message is determined from the above-mentioned topic message sequence, wherein the topic message storage space composed of the above-mentioned second candidate topic message to the initial topic message at the end of the arrangement in the above-mentioned topic message sequence matches the configuration reserved space threshold value corresponding to the above-mentioned configuration reserved space;
[0032] Compare the first candidate message storage time of the first candidate topic message with the second candidate message storage time of the second candidate topic message to obtain a second timing comparison result; and
[0033] According to the second time sequence comparison result, the target topic message is determined from the first candidate topic message and the second candidate topic message.
[0034] According to an embodiment of the present disclosure, the above configuration retention attribute information includes configuration retention duration and configuration retention space;
[0035] Wherein, according to the first candidate message storage time of the first candidate topic message and the configuration retention attribute information of the topic message sequence, determining the target topic message from the topic message sequence includes:
[0036] From the above topic message sequence, filter out expired topic messages whose storage duration is longer than the above configured retention duration;
[0037] In the case where there are multiple expired subject messages, a candidate expired subject message with the latest storage time of the expired message is selected from the multiple expired subject messages;
[0038] According to the above-mentioned configuration reserved space, a second candidate topic message is determined from the above-mentioned topic message sequence, wherein the topic message storage space composed of the above-mentioned second candidate topic message to the initial topic message at the end of the arrangement in the above-mentioned topic message sequence matches the configuration reserved space threshold value corresponding to the above-mentioned configuration reserved space;
[0039] Comparing the first candidate message storage time of the first candidate topic message, the expired message storage time of the candidate expired topic message, and the second candidate message storage time of the second candidate topic message to obtain a third timing comparison result; and
[0040] According to the third timing comparison result, the target topic message is determined from the first candidate topic message, the candidate expired topic message and the second candidate topic message.
[0041] According to an embodiment of the present disclosure, using the boundary message index in the above boundary message index file, the message index storage moment satisfies the preset timing rule, and querying the boundary message log file from the message log file sequence includes:
[0042] Querying the boundary message associated with the boundary message index with the latest message index storage time in the boundary message index file; and
[0043] The message log file storing the boundary message is determined as the boundary message log file.
[0044] According to an embodiment of the present disclosure, before deleting the static message log file, the message processing method further includes:
[0045] The boundary message index file and the static message index file arranged before the boundary message index file in the message index file sequence are deleted respectively to obtain a dynamic message index file.
[0046] Another aspect of the present disclosure further provides a message processing device, including:
[0047] A target topic message determination module is used to determine a target topic message from a topic message sequence in a message queue, wherein the initial topic messages in the topic message sequence are arranged in a time sequence according to the respective message storage moments;
[0048] A boundary message index file determination module, used to determine a boundary message index file from a message index file sequence according to a target message index file corresponding to the target subject message, wherein the boundary message index file is adjacent to the target message index file in time sequence and is located before the target message index file;
[0049] A boundary message log file query module, used to query the boundary message log file from the message log file sequence by using the boundary message index whose message index storage moment satisfies the preset timing rule in the above boundary message index file; and
[0050] The first deleting module is used to delete the static message log file arranged before the boundary message log file in the message log file sequence, and obtain a target message queue containing dynamic message log files.
[0051] Another aspect of the present disclosure provides an electronic device, comprising:
[0052] one or more processors;
[0053] a memory for storing one or more programs,
[0054] When the one or more programs are executed by the one or more processors, the one or more processors implement the message processing method as described above.
[0055] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the message processing method described above when executed.
[0056] Another aspect of the present disclosure provides a computer program product, which includes computer executable instructions, and when the instructions are executed, are used to implement the message processing method as described above.
[0057] According to the embodiments of the present disclosure, a technical means is adopted by determining a target topic message in a topic message sequence, querying a boundary message index and a corresponding boundary message log file based on the target topic message, and using the boundary message log file as a boundary to distinguish between static message log files and dynamic message log files in a message log file sequence. This at least partially solves the technical problem of improving the accuracy of identifying the consumption requirements of message log files in a message queue, thereby saving storage space in the message queue by deleting static log files, achieving the technical effect of improving message cleaning efficiency, and improving the storage space utilization and operating performance of the message queue. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0059] Figure 1 An exemplary system architecture to which the message processing method and device according to an embodiment of the present disclosure can be applied is schematically shown;
[0060] Figure 2 The flowchart of the message processing method according to the embodiment of the present disclosure is schematically shown;
[0061] Figure 3 A flowchart of determining a target topic message from a topic message sequence in a message queue according to an embodiment of the present disclosure is schematically shown;
[0062] Figure 4 The flowchart of the message processing method according to another embodiment of the present disclosure is schematically shown;
[0063] Figure 5 A flowchart of a message processing method according to another embodiment of the present disclosure is schematically shown;
[0064] Figure 6 A block diagram schematically shows a message processing device according to an embodiment of the present disclosure; and
[0065] Figure 7 A block diagram of an electronic device suitable for implementing a message processing method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0066] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0067] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0068] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0069] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0070] In order to clearly express the technical solution of the embodiments of the present disclosure, the specific content of the embodiments of the present disclosure may be understood by referring to the following technical term explanations.
[0071] A topic or topic identifier, namely a Topic, is a classification identifier used to record or distinguish different messages. Messages usually need to be classified and stored according to topics. Messages in the same topic can constitute a topic message sequence.
[0072] Message log files, files that store topic messages, can be the basic unit of message queue communication.
[0073] A message node, or broker, can be a server or server cluster in a message queue. The same message node can store topic messages corresponding to different topics. Correspondingly, topic messages in the same topic message sequence can also be stored in different message nodes.
[0074] As a commonly used message middleware, message queues are usually used for decoupling service system messages and message transfer. As user data grows, the message logs stored in message queues are increasing day by day, which also increases the storage pressure on message queues. How to clean up expired message logs in a timely and automatic manner has become an important factor in measuring the message queue's carrying capacity and operation and maintenance capabilities.
[0075] In the related art, the strategies or methods for cleaning messages in the message queue are mostly to delete the corresponding message log files by referring to the time dimension attributes of the messages, and usually need to call the interface tool of the message node to complete the message cleaning work. This may cause the deletion of messages that still have consumption needs, and it is difficult to delete inactive messages, that is, static messages that no longer have consumption needs, resulting in more storage space occupied by the message node, affecting the overall operation performance of the message queue.
[0076] The embodiments of the present disclosure provide a message processing method, device, equipment, storage medium and program product. The message processing method includes: determining a target topic message from a topic message sequence of a message queue, wherein the initial topic messages in the topic message sequence are arranged in the time sequence of their respective message storage moments; determining a boundary message index file from a message index file sequence according to a target message index file corresponding to the target topic message, wherein the boundary message index file is adjacent to the target message index file in time sequence and is located before the target message index file; using the boundary message index in the boundary message index file whose message index storage moment meets the preset time sequence rule, querying the boundary message log file from a message log file sequence; and deleting the static message log file arranged before the boundary message log file in the message log file sequence to obtain a target message queue containing a dynamic message log file.
[0077] According to an embodiment of the present disclosure, by determining the target topic message in the topic message sequence, and querying the boundary message index and the corresponding boundary message log file based on the target topic message, and using the boundary message log file as the boundary to distinguish the static message log file and the dynamic message log file in the message log file sequence, the accuracy of identifying the consumption demand of the message log file in the message queue is at least partially improved, and the message cleaning efficiency is improved, so that by deleting the static log file, the storage space in the message queue can be saved, and the technical effect of improving the storage space utilization and operating performance of the message queue can be achieved.
[0078] In the technical solution of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.
[0079] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision, disclosure and application of user personal information involved comply with the provisions of relevant laws and regulations, take necessary confidentiality measures, and do not violate public order and good morals.
[0080] Figure 1 The exemplary system architecture to which the message processing method and device according to the embodiments of the present disclosure can be applied is schematically shown. It should be noted that: Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0081] like Figure 1As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104, a message queue 110 and consumer servers 121, 121, 123. The message queue 110 may include message nodes 111, 112 and 113.
[0082] The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the message queue 110. The network 104 may include various connection types, such as wired and / or wireless communication links, and the like.
[0083] The user can use the terminal devices 101, 102, 103 to interact with the message queue 110 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 101, 102, 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients and / or social platform software, etc. (only as examples).
[0084] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0085] It should be understood that the terminal devices 101, 102, 103 can be producers of topic messages, and the message queue 110 can obtain the topic messages from the terminal devices 101, 102, 103, and store the topic messages according to the topics in any one of the message nodes 111, 112, and 113. The message nodes 111, 112, 113 can include a server, or can also include a server cluster consisting of multiple servers.
[0086] The consumer-side servers 121, 122, 123 may be servers that provide various services, such as a background management server (only as an example) that provides support for websites browsed by users using the terminal devices 101, 102, 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0087] It should be noted that the message processing method provided in the embodiment of the present disclosure can generally be executed by the message queue 110. Accordingly, the message processing device provided in the embodiment of the present disclosure can generally be set in the message queue 110. The message processing method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the message queue 110 and can communicate with the terminal devices 101, 102, 103 and / or the message queue 110. Correspondingly, the message processing device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the message queue 110 and can communicate with the terminal devices 101, 102, 103 and / or the message queue 110.
[0088] It should be understood that Figure 1 The number of terminal devices, networks, message nodes, message queues, and consumer servers in the embodiment is only illustrative. According to the implementation requirements, there can be any number of terminal devices, networks, message nodes, message queues, and consumer servers.
[0089] Figure 2 The flowchart of the message processing method according to the embodiment of the present disclosure is schematically shown.
[0090] like Figure 2 As shown, the message processing method includes operations S210 to S240.
[0091] In operation S210, a target topic message is determined from a topic message sequence in a message queue, wherein initial topic messages in the topic message sequence are arranged in a time sequence according to respective message storage moments.
[0092] According to an embodiment of the present disclosure, a topic message sequence may be messages stored in a message queue according to topic categories, and topic messages in the same topic message sequence may have the same topic type, for example, may have the same topic identifier, so that the consumer end can call the messages in the corresponding topic message sequence from the message queue to realize the message consumption process.
[0093] According to an embodiment of the present disclosure, the message storage time may be the time when the message producer submits the subject message to the message queue, that is, the time when the subject message is stored in the message queue. It is understandable that the consumer can consume the subject message according to the time sequence of the message storage time. Therefore, the target subject message can be a subject message in the subject message sequence and still have a boundary of consumption demand.
[0094] It should be understood that the message storage time can be represented by the timestamp of each subject message.
[0095] In operation S220, a boundary message index file is determined from a message index file sequence according to a target message index file corresponding to a target subject message, wherein the boundary message index file is adjacent to the target message index file in time sequence and is located before the target message index file.
[0096] According to an embodiment of the present disclosure, the target message index file may include a target topic message index that can be associated with the target topic message. By determining the boundary index file according to the target message index file, the message index file generated and / or updated before the target message index file can be clearly queried.
[0097] In operation S230, the boundary message log file is searched from the message log file sequence by using the boundary message index in the boundary message index file, the boundary message index of which the message index storage moment satisfies the preset timing rule.
[0098] According to the embodiments of the present disclosure, the boundary message index that satisfies the preset timing rule may be a message index that satisfies the preset time period attribute (e.g., generated within the preset time period) in the boundary message index file, or may be a message index that satisfies the preset time attribute (e.g., generated at the preset time) in the boundary message index file. The embodiments of the present disclosure do not limit the specific design method of the preset timing rule, and those skilled in the art may design it according to actual needs, as long as it can satisfy the time attribute correlation.
[0099] It should be noted that the message index file sequence and the message log file sequence may be file sequences arranged according to the time sequence attributes of the message index file and the message log file, respectively.
[0100] In operation S240, the static message log files arranged before the boundary message log files in the message log file sequence are deleted to obtain a target message queue including dynamic message log files.
[0101] According to an embodiment of the present disclosure, a static message log file may be composed of static messages, which may be predicted as messages with a low degree of consumption demand or no consumption demand. A dynamic message log file may be composed of dynamic messages, which may be predicted as messages that still have a consumption demand or a high probability of being consumed. By deleting the static message log file, it is possible to quickly delete static messages in batches to save storage space in the message queue.
[0102] It should be noted that the embodiments of the present disclosure do not limit the number of subject message sequences in the message queue, and the message queue may include any number of subject message sequences. Accordingly, the static message log files of one or more subject message sequences may be deleted based on the same or similar method, thereby cleaning up as many messages in the message queue as possible and increasing the free storage space of the message queue.
[0103] According to an embodiment of the present disclosure, by determining the target topic message in the topic message sequence, and querying the boundary message index and the corresponding boundary message log file based on the target topic message, and using the boundary message log file as the boundary to distinguish the static message log file and the dynamic message log file in the message log file sequence, the accuracy of identifying the consumption demand of the message log file in the message queue is at least partially improved, and the message cleaning efficiency is improved, so that by deleting the static log file, the storage space in the message queue can be saved, and the technical effect of improving the storage space utilization and operating performance of the message queue can be achieved.
[0104] Figure 3 The flowchart of determining a target topic message from a topic message sequence in a message queue according to an embodiment of the present disclosure is schematically shown.
[0105] like Figure 3 As shown, operation S210, determining a target topic message from a topic message sequence in a message queue may include operations S310 to S330.
[0106] In operation S310, a first initial topic message with a consumption completion status is screened out from a topic message sequence to obtain a first initial topic message subsequence.
[0107] In operation S320, a first initial topic message that meets a preset timing rule in the first initial topic message subsequence is determined as a first candidate topic message.
[0108] In operation S330, a target topic message is determined from the topic message sequence according to the first candidate message storage time of the first candidate topic message and the configuration retention attribute information of the topic message sequence.
[0109] According to the embodiments of the present disclosure, the consumption completion status can represent whether the message has been completely consumed by the consumer end, for example, it can represent that it has been consumed by all consumer ends at least once, or it can also represent that it has been consumed by a consumer end with corresponding topic consumption authority for a preset frequency, or it can also update the consumption completion status of the topic message in the topic message sequence through one or more consumer ends. The embodiments of the present disclosure do not limit the specific design method of the consumption completion status, and those skilled in the art can make a choice according to actual needs.
[0110] In one embodiment of the present disclosure, when all consumption terminals connected to the message queue have consumed the first initial topic message, the consumption status of the first initial topic message may be determined as the consumption completion status.
[0111] In one embodiment of the present disclosure, the first initial topic message at the end of the first initial topic message subsequence, that is, the first initial topic message with the latest message storage time, can be determined as the first candidate topic message, thereby improving the prediction accuracy of subsequent static message log files.
[0112] According to the embodiments of the present disclosure, the configuration retention attribute information may correspond to the storage requirements of the subject message sequence, such as storage size requirements, storage duration requirements, subject message attribute type requirements, etc. Those skilled in the art may determine the configuration retention attribute information according to actual needs, and the embodiments of the present disclosure do not limit the specific information type of the configuration retention attribute information, as long as the corresponding storage requirements can be met.
[0113] According to the embodiments of the present disclosure, by comprehensively considering the consumption completion status of the topic message and the configuration retention attribute information of the topic message sequence to determine the target topic information, the message queue cleanup strategy can be determined from multiple dimensions, thereby achieving the unity of the consumption demand for the topic message and the cleanup of the consumption queue message, and meeting the actual data processing needs.
[0114] According to an embodiment of the present disclosure, configuring the retention attribute information may include configuring the retention duration.
[0115] In operation S330, determining the target topic message from the topic message sequence may include the following operations according to the first candidate message storage time of the first candidate topic message and the configuration retention attribute information of the topic message sequence.
[0116] From the subject message sequence, filter out expired subject messages whose storage duration is greater than the configured retention duration; in the case of multiple expired subject messages, filter out the candidate expired subject message with the latest storage time of the expired message from the multiple expired subject messages; compare the first candidate message storage time of the first candidate subject message with the expired message storage time of the candidate expired subject message in a timing relationship to obtain a first timing comparison result; and determine the target subject message from the first candidate subject message and the candidate expired subject messages based on the first timing comparison result.
[0117] According to an embodiment of the present disclosure, configuring the retention time can characterize the storage requirements of the topic message sequence. It can be calculated by the message storage time of each topic message in the topic message sequence. By comparing the respective message storage times of the first candidate topic message and the candidate expired topic message, and based on the topic message with an earlier timing relationship represented by the first timing comparison result, such as the one with an earlier timing relationship represented by the timestamp, it is determined as the target topic message to avoid accidental deletion of topic messages that are still in demand for consumption, thereby improving the accuracy of message cleaning.
[0118] According to an embodiment of the present disclosure, configuring the retention attribute information includes configuring the retention space.
[0119] In operation S330, determining the target topic message from the topic message sequence according to the first candidate message storage time of the first candidate topic message and the configuration retention attribute information of the topic message sequence includes the following operations:
[0120] According to the configured retention space, a second candidate topic message is determined from the topic message sequence, wherein the topic message storage space formed by the second candidate topic message to the initial topic message at the end of the topic message sequence matches the configured retention space threshold corresponding to the configured retention space; a first candidate message storage time of the first candidate topic message is compared with a second candidate message storage time of the second candidate topic message to obtain a second timing comparison result; and according to the second timing comparison result, a target topic message is determined from the first candidate topic message and the second candidate topic message.
[0121] According to an embodiment of the present disclosure, the configuration retention space can characterize the data volume requirement for topic messages with the same topic. For example, the configuration retention space can be set by setting a minimum storage data volume for the topic message sequence. The configuration retention space threshold can be a storage space threshold corresponding to the configuration retention space. For example, when the configuration retention space is 1GB, the configuration retention space threshold can be set to 0.9GB to 1.1GB. In a topic message sequence, if the storage space of the topic message formed by the initial topic message at the end of the arrangement is 0.95GB, the topic message can be determined as the second candidate topic message.
[0122] According to an embodiment of the present disclosure, the second candidate topic message may be determined by traversing forward from the end of the topic message sequence.
[0123] According to an embodiment of the present disclosure, the topic message with an earlier message storage time among the second candidate topic message and the first candidate topic message can be determined as the target topic message, so as to achieve the unification of the configuration of retention space and consumption status of the cleaned topic message sequence, thereby achieving the improvement of the working performance of the message queue while meeting the consumption needs of the consumer end.
[0124] According to an embodiment of the present disclosure, the configuration retention attribute information includes the configuration retention duration and the configuration retention space.
[0125] In operation S330, according to the first candidate message storage time of the first candidate topic message and the configuration retention attribute information of the topic message sequence, determining the target topic message from the topic message sequence may include the following operations:
[0126] From the topic message sequence, filter out expired topic messages whose storage duration is greater than the configured retention duration; in the case of multiple expired topic messages, filter out the candidate expired topic message with the latest storage time of the expired message from the multiple expired topic messages; determine the second candidate topic message from the topic message sequence according to the configured retention space, wherein the topic message storage space formed by the second candidate topic message to the initial topic message at the end of the topic message sequence matches the configured retention space threshold corresponding to the configured retention space; compare the first candidate message storage time of the first candidate topic message, the expired message storage time of the candidate expired topic message, and the second candidate message storage time of the second candidate topic message in a timing relationship to obtain a third timing comparison result; and determine the target topic message from the first candidate topic message, the candidate expired topic message, and the second candidate topic message according to the third timing comparison result.
[0127] According to an embodiment of the present disclosure, a topic message with an earlier message storage time among the candidate expired topic messages, the second candidate topic message and the first candidate topic message can be determined as the target topic message, so as to achieve the unification of the retention time requirement, the retention space requirement and the consumption status of the cleaned topic message sequence, thereby achieving the improvement of the working performance of the message queue while meeting the consumption needs of the consumer end.
[0128] According to an embodiment of the present disclosure, operation S230, using the boundary message index in the boundary message index file, the message index storage moment satisfies the preset timing rule, and querying the boundary message log file from the message log file sequence may include the following operations:
[0129] The boundary message index file is searched for the boundary message associated with the boundary message index having the latest message index storage time; and the message log file storing the boundary message is determined as the boundary message log file.
[0130] According to an embodiment of the present disclosure, when the message index file is sorted according to the generation time of the message index, the boundary message index with the latest message index storage time can be the last message index sorted in the boundary message index file. Therefore, the rate of finding the boundary message index can be improved, thereby improving the overall efficiency of message clearing of the message queue.
[0131] According to an embodiment of the present disclosure, before deleting the static message log file in operation S240, the message processing method may further include the following operations:
[0132] The boundary message index file and the static message index file arranged before the boundary message index file in the message index file sequence are deleted respectively to obtain a dynamic message index file.
[0133] According to an embodiment of the present disclosure, deleting the static message index file before deleting the static message log file can further expand the free storage space of the message queue. At the same time, it can also avoid errors such as empty index appearing during message query due to the failure to delete the message index, thereby improving the stability of the message queue operation.
[0134] Figure 4 The following schematically shows a flow chart of a message processing method according to another embodiment of the present disclosure.
[0135] like Figure 4 As shown, the message processing method in this embodiment may include operations S401 to S417.
[0136] After the start operation S401 is executed, operation 402 may be executed to determine whether the subject message sequence has a mandatory deletion attribute, that is, it may be determined whether the subject message sequence has a mandatory deletion attribute.
[0137] In case the judgment result of operation S402 is no, operation S403 may be performed to query the first candidate topic message identifier P0 in the topic message sequence.
[0138] If the result of the judgment in operation S402 is yes, operation S404 may be performed to search for the last subject message, that is, to search for the subject message identifier at the end of the subject message sequence arrangement, and then operation S405 may be performed.
[0139] It should be noted that P0 may be the first candidate topic message identifier, and the topic messages in the topic message sequence may be arranged according to their respective message storage times. Accordingly, the temporal relationship between different topic messages may be represented according to their respective message identifiers.
[0140] For example, in a topic message sequence, adjacent topic messages may have topic message identifiers 111 and 112 respectively. It can be understood that the message storage time of the topic message with topic identifier 111 is earlier than that of the topic message with topic identifier 112.
[0141] In operation S405, it is determined whether the topic message sequence has a configured retention time. If the determination result of operation S405 is yes, operation S406 can be performed to query the candidate expired topic message identifier P1 in the topic message sequence. Accordingly, if the determination result of operation S405 is no, operation S407 can be performed to determine whether the candidate expired topic message identifier P1 is the same as the message identifier P0 of the first candidate topic message.
[0142] Then, operation S408 is performed to determine whether there is configuration reserved space. If the determination result of operation S408 is yes, operation S409 may be performed, otherwise, operation S410 is performed.
[0143] In operation S409, the second candidate topic message identifier P2 in the topic message sequence is queried. Accordingly, in operation S410, the second candidate topic message identifier P2 can be determined as the first candidate topic message identifier, that is, P2=P0 can be determined.
[0144] According to the execution results of operations S401 to S410, in operation S411, a target topic message identifier P may be determined according to the second candidate topic message identifier P2, the candidate expired topic message identifier P1 and the first candidate topic message identifier. For example, the target topic message identifier P may be determined according to formula (1).
[0145] P = min(P0, P1, P2); (1)
[0146] Then, operation S412 may be performed to search the target message index file according to the target subject message, for example, to search for a target index that can index the target subject message from the message index file sequence, and then to search for a target message index file containing the target message index.
[0147] In operation S413, a boundary message index file is determined from the message index file sequence according to the target message index file, that is, a message index file that is adjacent to the target message index file in time sequence and is located before the target message index file can be found.
[0148] Then, operation S414 is performed to query the boundary message log file using the boundary message index in the boundary message index file. For example, the message index at the end of the order in the boundary message index file can be determined as the boundary message index, and then the boundary message log file associated with the boundary message index can be queried.
[0149] In operation S415, the boundary message index file and the static message index file in the message index file sequence are deleted.
[0150] In operation S416, the static message log file arranged before the boundary message log file in the message log file sequence is deleted. The message queue usually creates a message index file of the message log file synchronously. Accordingly, the message index file will be loaded into the cache of the message node and will not be deleted arbitrarily. Therefore, by first deleting the boundary message index file and the static message index file, it is possible to avoid the situation where the message queue will query an empty message log file, and at the same time, the storage space in the message queue can be further cleaned up to improve the operation efficiency and operation stability of the message queue.
[0151] After deleting the corresponding boundary message index file, static message index file and static message log file, operation S417 may be performed to end the operation, so as to complete a cycle of message processing.
[0152] It should be understood that the same or similar method can also be used to execute multiple cycles of message processing on the message queue. The embodiments of the present disclosure do not limit the number of cycles of the message processing process in the message processing method, and technical personnel in this field can make a choice based on actual needs.
[0153] According to an embodiment of the present disclosure, the target message queue includes a first message node, and the first message node stores a node topic message set corresponding to the topic identifier.
[0154] Figure 5 The flowchart of a message processing method according to another embodiment of the present disclosure is schematically shown.
[0155] like Figure 5 As shown, the message processing method of this embodiment may further include operations S510 to S520.
[0156] In operation S510, when the first node occupied space of the first message node is greater than the node occupied space threshold, a target node topic message set is filtered out from the first message node.
[0157] In operation S520, the target node topic message set is migrated to a target idle message node in an idle state to obtain a second message node.
[0158] According to an embodiment of the present disclosure, the topic messages in the topic message sequence can be stored in one or more message nodes of the message queue. Therefore, in the target message queue that has cleaned up the static message log file, the dynamic message log file corresponding to the same topic identifier can be stored in one or more first message nodes. For the same topic identifier, the dynamic message log files stored in the same first message node can constitute a node topic message set. In the case where the node topic message set includes multiple nodes, the target node topic message set can be any one of the multiple node topic message sets.
[0159] According to an embodiment of the present disclosure, when the space occupied by the first node is greater than the node space occupied threshold, it indicates that the first message node still needs to perform further message cleanup. By migrating the target node topic message set that occupies the largest space to the target idle message node, for example, copying the target node topic message set from the first message node to the target idle node, and then deleting the target node topic message set from the first message node, the storage space of the first message node can be further cleared, and the operating stability and performance of the first message node can be improved by increasing the free storage space.
[0160] In one embodiment of the present disclosure, the target node topic message set may be the node topic message set that occupies the largest storage space in the first message node. Therefore, by migrating the target node topic message set, the cleaning efficiency of the first message node can be improved.
[0161] It should be noted that after migrating the target node topic message set to the target idle node, if the first node occupied space of the first message node is still greater than the node occupied space threshold, the new target node topic message set in the first message node can be iteratively cleaned up until the first node occupied space is less than or equal to the node occupied space threshold, thereby obtaining a first message node that meets the storage space requirements. The embodiments of the present disclosure do not limit the frequency of migrating the target node topic message set, and those skilled in the art can design it according to actual needs.
[0162] According to an embodiment of the present disclosure, the target idle message node may be a message node in the target message queue, or may be a message node constructed by other means, for example, a new target idle message node may be constructed using a server or a server cluster, and a communication connection may be established with the first message node in the target message queue, thereby realizing the subsequent migration of the target node topic message. The embodiment of the present disclosure does not limit the specific method for determining the target idle message node, and those skilled in the art may make a selection according to actual needs.
[0163] According to an embodiment of the present disclosure, the target message queue includes multiple message nodes.
[0164] The message processing method also includes the following operations:
[0165] According to the node resource idle attribute information of each of the plurality of message nodes, a target idle message node is screened out from the target message queue.
[0166] The node resource idle attribute information includes at least one of the following:
[0167] Node memory free information, node computing resource free information, node storage space free information.
[0168] According to an embodiment of the present disclosure, the message node may include the first message node in the target message queue, or may also include a constructed new idle message node. The embodiment of the present disclosure does not limit the specific type of the message node.
[0169] According to an embodiment of the present disclosure, the node memory idle information may include idle resources of memory in a server or server cluster in the message node, such as real-time memory idle rate, average memory idle rate, etc.
[0170] According to an embodiment of the present disclosure, the node computing resource idle information can characterize the computing resource idle situation of the node, such as the real-time computing resource idle rate, the average computing resource idle rate, and the like.
[0171] According to the embodiments of the present disclosure, the node storage space free information may represent the free storage space of the message node in real time and / or in a preset time period, and those skilled in the art may set the node storage space free information according to actual needs.
[0172] According to an embodiment of the present disclosure, by determining the target idle message node based on the node resource idle attribute information, a target idle message node with relatively abundant node resources can be provided for the subsequent migration of the target subject message set, so as to avoid insufficient node resources of the second message node after migrating the target subject message set, thereby achieving the technical effect of improving the operating performance and operating stability of the target message queue.
[0173] Figure 6 The block diagram of a message processing device according to an embodiment of the present disclosure is schematically shown.
[0174] like Figure 6 As shown, the message processing device 600 includes a target topic message determination module 610 , a boundary message index file determination module 620 , a boundary message log file query module 630 and a first deletion module 640 .
[0175] The target topic message determination module 610 is used to determine the target topic message from the topic message sequence of the message queue, wherein the initial topic messages in the topic message sequence are arranged in the time sequence of their respective message storage moments.
[0176] The boundary message index file determination module 620 is used to determine the boundary message index file from the message index file sequence according to the target message index file corresponding to the target subject message, wherein the boundary message index file is adjacent to the target message index file in time sequence and is located before the target message index file.
[0177] The boundary message log file query module 630 is used to query the boundary message log file from the message log file sequence by using the boundary message index whose message index storage moment satisfies the preset timing rule in the boundary message index file.
[0178] The first deleting module 640 is used to delete the static message log files arranged before the boundary message log files in the message log file sequence, and obtain a target message queue including dynamic message log files.
[0179] According to an embodiment of the present disclosure, the target message queue includes a first message node, and the first message node stores a node topic message set corresponding to the topic identifier.
[0180] The message processing device also includes: a target node topic message set screening module and a migration module.
[0181] The target node topic message set screening module is used to screen out the target node topic message set from the first message node when the first node occupied space of the first message node is greater than the node occupied space threshold.
[0182] The migration module is used to migrate the target node topic message set to a target idle message node in an idle state to obtain a second message node.
[0183] According to an embodiment of the present disclosure, the target message queue includes multiple message nodes.
[0184] The message processing device also includes a target idle message node screening module.
[0185] The target idle message node screening module is used to screen out target idle message nodes from the target message queue according to the node resource idle attribute information of each of the multiple message nodes.
[0186] The node resource idle attribute information includes at least one of the following:
[0187] Node memory free information, node computing resource free information, node storage space free information.
[0188] According to an embodiment of the present disclosure, the target topic message determination module 610 includes: a first screening unit, a first determination unit and a second determination unit.
[0189] The first screening unit is used to screen out a first initial topic message with a consumption completion status from the topic message sequence to obtain a first initial topic message subsequence.
[0190] The first determining unit is used to determine a first initial topic message that meets a preset timing rule in the first initial topic message subsequence as a first candidate topic message.
[0191] The second determining unit is used to determine the target topic message from the topic message sequence according to the first candidate message storage time of the first candidate topic message and the configuration retention attribute information of the topic message sequence.
[0192] According to an embodiment of the present disclosure, configuring the retention attribute information includes configuring the retention duration.
[0193] The second determining unit includes: a first screening subunit, a second screening subunit, a first comparing subunit and a first determining subunit.
[0194] The first screening subunit is used to screen out expired topic messages whose storage duration is greater than the configured retention duration from the topic message sequence.
[0195] The second screening subunit is used to screen out a candidate expired subject message with the latest expiration message storage time from the multiple expired subject messages when there are multiple expired subject messages.
[0196] The first comparison subunit is used to compare the first candidate message storage time of the first candidate topic message with the expired message storage time of the candidate expired topic message to obtain a first timing comparison result.
[0197] The first determination subunit is used to determine a target topic message from the first candidate topic message and the candidate expired topic message according to the first timing comparison result.
[0198] According to an embodiment of the present disclosure, configuring the retention attribute information includes configuring the retention space.
[0199] The second determining unit includes: a second candidate topic message determining subunit, a second comparing subunit, and a second determining subunit.
[0200] The second candidate topic message determination subunit is used to determine the second candidate topic message from the topic message sequence according to the configured reserved space, wherein the topic message storage space formed by the second candidate topic message to the initial topic message at the end of the topic message sequence matches the configured reserved space threshold corresponding to the configured reserved space.
[0201] The second comparison subunit is used to compare the first candidate message storage time of the first candidate topic message with the second candidate message storage time of the second candidate topic message to obtain a second timing comparison result.
[0202] The second determining subunit is used to determine the target topic message from the first candidate topic message and the second candidate topic message according to the second time sequence comparison result.
[0203] According to an embodiment of the present disclosure, the configuration retention attribute information includes the configuration retention duration and the configuration retention space.
[0204] The second determining unit includes: a third screening subunit, a fourth screening subunit, a third determining subunit, a third comparing subunit and a fourth determining subunit.
[0205] The third screening subunit is used to screen out expired topic messages whose storage duration is greater than the configured retention duration from the topic message sequence.
[0206] The fourth screening subunit is used to screen out a candidate expired subject message with the latest expiration message storage time from the multiple expired subject messages when there are multiple expired subject messages.
[0207] The third determination subunit is used to determine a second candidate topic message from the topic message sequence according to the configured reserved space, wherein the topic message storage space formed by the second candidate topic message to the initial topic message at the end of the topic message sequence matches the configured reserved space threshold corresponding to the configured reserved space.
[0208] The third comparison subunit is used to compare the timing relationship of the first candidate message storage time of the first candidate topic message, the expired message storage time of the candidate expired topic message, and the second candidate message storage time of the second candidate topic message to obtain a third timing comparison result.
[0209] The fourth determining subunit is used to determine the target topic message from the first candidate topic message, the candidate expired topic message and the second candidate topic message according to the third time sequence comparison result.
[0210] According to an embodiment of the present disclosure, the boundary message log file query module 630 includes: a first query unit and a boundary message log file determination unit.
[0211] The first query unit is used to query the boundary message associated with the boundary message index with the latest message index storage time in the boundary message index file.
[0212] The boundary message log file determination unit is used to determine a message log file storing a boundary message as a boundary message log file.
[0213] According to an embodiment of the present disclosure, the message processing device also includes a second deletion module.
[0214] The second deleting module is used to delete the boundary message index file and the static message index file arranged before the boundary message index file in the message index file sequence, respectively, to obtain a dynamic message index file.
[0215] According to the embodiments of the present invention, any one or more of the modules, units, and sub-units, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, units, and sub-units can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, units, and sub-units can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging the circuit, or in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, units, and sub-units can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.
[0216] For example, any multiple of the target topic message determination module 610, the boundary message index file determination module 620, the boundary message log file query module 630, and the first deletion module 640 can be combined in one module / unit / sub-unit for implementation, or any one of the modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functions of one or more of these modules / units / sub-units can be combined with at least part of the functions of other modules / units / sub-units and implemented in one module / unit / sub-unit. According to an embodiment of the present disclosure, at least one of the target topic message determination module 610, the boundary message index file determination module 620, the boundary message log file query module 630 and the first deletion module 640 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or in any one of the three implementation methods of software, hardware and firmware or in an appropriate combination of any of them. Alternatively, at least one of the target topic message determination module 610, the boundary message index file determination module 620, the boundary message log file query module 630 and the first deletion module 640 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.
[0217] It should be noted that the message processing device part in the embodiment of the present disclosure corresponds to the message processing method part in the embodiment of the present disclosure. The description of the message processing device part specifically refers to the message processing method part, which will not be repeated here.
[0218] Figure 7 A block diagram of an electronic device suitable for implementing a message processing method according to an embodiment of the present disclosure is schematically shown. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0219] like Figure 7 As shown, the electronic device 700 according to an embodiment of the present disclosure includes a processor 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 to a random access memory (RAM) 703. The processor 701 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 701 may also include an onboard memory for caching purposes. The processor 701 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0220] In RAM 703, various programs and data required for the operation of electronic device 700 are stored. Processor 701, ROM 702 and RAM 703 are connected to each other via bus 704. Processor 701 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 702 and / or RAM 703. It should be noted that the program can also be stored in one or more memories other than ROM 702 and RAM 703. Processor 701 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0221] According to an embodiment of the present disclosure, the electronic device 700 may further include an input / output (I / O) interface 705, which is also connected to the bus 704. The system 700 may further include one or more of the following components connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.
[0222] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure 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 carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the processor 701, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
[0223] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0224] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.
[0225] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 702 and / or the RAM 703 described above and / or one or more memories other than the ROM 702 and the RAM 703 .
[0226] An embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains a program code for executing the method provided by the embodiment of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the message processing method provided by the embodiment of the present disclosure.
[0227] When the computer program is executed by the processor 701, the above functions defined in the system / device of the embodiment of the present disclosure are executed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0228] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 709, and / or installed from the removable medium 711. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0229] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0230] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two 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 box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, 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. It can be understood by those skilled in the art that the features recorded in the various embodiments and / or claims of the present disclosure can be combined and / or combined in a variety of ways, even if such a combination or combination is not explicitly recorded in the present disclosure. In particular, without departing from the spirit and teaching of the present disclosure, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0231] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A message processing method, comprising: Determine a target topic message from a topic message sequence in a message queue, wherein initial topic messages in the topic message sequence are arranged in a time sequence according to respective message storage moments; Determine a boundary message index file from a message index file sequence according to a target message index file corresponding to the target subject message, wherein the boundary message index file is adjacent to the target message index file in time sequence and is located before the target message index file; Using the boundary message index in the boundary message index file, the boundary message index whose message index storage moment satisfies the preset timing rule, to query the boundary message log file from the message log file sequence; and The static message log file arranged before the boundary message log file in the message log file sequence is deleted to obtain a target message queue including dynamic message log files.
2. The method according to claim 1, wherein: The target message queue includes a first message node, wherein the first message node stores a node topic message set corresponding to the topic identifier; The message processing method further includes: When the first node occupied space of the first message node is greater than the node occupied space threshold, filtering out a target node topic message set from the first message node; as well as The target node topic message set is migrated to a target idle message node in an idle state to obtain a second message node.
3. The method according to claim 2, wherein: The target message queue includes a plurality of message nodes; The message processing method further includes: Filtering the target idle message node from the target message queue according to the node resource idle attribute information of each of the plurality of message nodes; The node resource idle attribute information includes at least one of the following: Node memory free information, node computing resource free information, node storage space free information.
4. The method according to claim 1, wherein: Determining the target topic message from the topic message sequence of the message queue includes: Filtering out a first initial topic message with a consumption completion status from the topic message sequence to obtain a first initial topic message subsequence; Determine the first initial topic message that satisfies the preset timing rule in the first initial topic message subsequence as a first candidate topic message; and According to the first candidate message storage time of the first candidate topic message and the configuration retention attribute information of the topic message sequence, a target topic message is determined from the topic message sequence.
5. The method according to claim 4, wherein: The configuration retention attribute information includes the configuration retention duration; Wherein, according to the first candidate message storage time of the first candidate topic message and the configuration retention attribute information of the topic message sequence, determining the target topic message from the topic message sequence includes: Filter out expired topic messages whose storage duration is greater than the configured retention duration from the topic message sequence; In the case where there are multiple expired subject messages, screening out a candidate expired subject message with the latest storage time of the expired message from the multiple expired subject messages; Comparing the first candidate message storage time of the first candidate topic message with the expired message storage time of the candidate expired topic message in a time sequence relationship to obtain a first time sequence comparison result; and The target topic message is determined from the first candidate topic messages and the candidate expired topic messages according to the first timing comparison result.
6. The method according to claim 4, wherein: The configuration retention attribute information includes configuration retention space; Wherein, according to the first candidate message storage time of the first candidate topic message and the configuration retention attribute information of the topic message sequence, determining the target topic message from the topic message sequence includes: Determine a second candidate topic message from the topic message sequence according to the configured reserved space, wherein the topic message storage space formed by the second candidate topic message to the initial topic message at the end of the topic message sequence matches the configured reserved space threshold value corresponding to the configured reserved space; Comparing a first candidate message storage time of the first candidate topic message with a second candidate message storage time of the second candidate topic message in a time sequence relationship to obtain a second time sequence comparison result; and According to the second timing comparison result, the target topic message is determined from the first candidate topic message and the second candidate topic message.
7. The method according to claim 4, wherein: The configuration retention attribute information includes configuration retention duration and configuration retention space; Wherein, according to the first candidate message storage time of the first candidate topic message and the configuration retention attribute information of the topic message sequence, determining the target topic message from the topic message sequence includes: Filter out expired topic messages whose storage duration is greater than the configured retention duration from the topic message sequence; In the case where there are multiple expired subject messages, screening out a candidate expired subject message with the latest storage time of the expired message from the multiple expired subject messages; Determine a second candidate topic message from the topic message sequence according to the configured reserved space, wherein the topic message storage space formed by the second candidate topic message to the initial topic message at the end of the topic message sequence matches the configured reserved space threshold value corresponding to the configured reserved space; Comparing the first candidate message storage time of the first candidate topic message, the expired message storage time of the candidate expired topic message, and the second candidate message storage time of the second candidate topic message in a time sequence relationship to obtain a third time sequence comparison result; and According to the third timing comparison result, the target topic message is determined from the first candidate topic messages, the candidate expired topic messages and the second candidate topic messages.
8. The method according to claim 1, wherein: Using the boundary message index in the boundary message index file, the boundary message index whose message index storage moment satisfies the preset timing rule, and querying the boundary message log file from the message log file sequence includes: Querying the boundary message associated with the boundary message index with the latest message index storage time in the boundary message index file; and A message log file storing the boundary message is determined as the boundary message log file.
9. The method according to any one of claims 1 to 8, wherein: Before deleting the static message log file, the message processing method further includes: The boundary message index file and the static message index file arranged before the boundary message index file in the message index file sequence are deleted respectively to obtain a dynamic message index file.
10. A message processing device, comprising: A target topic message determination module, used to determine a target topic message from a topic message sequence in a message queue, wherein the initial topic messages in the topic message sequence are arranged in a time sequence according to the respective message storage moments; A boundary message index file determination module, configured to determine a boundary message index file from a message index file sequence according to a target message index file corresponding to the target subject message, wherein the boundary message index file is adjacent to the target message index file in time sequence and is located before the target message index file; A boundary message log file query module, used to query the boundary message log file from the message log file sequence by using the boundary message index whose message index storage moment satisfies the preset timing rule in the boundary message index file; and The first deleting module is used to delete the static message log file arranged before the boundary message log file in the message log file sequence to obtain a target message queue containing dynamic message log files.
11. An electronic device, comprising: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 9.
12. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method according to any one of claims 1 to 9.
13. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Method and system for efficiently cleaning up Hbase time series data
CN108153805A
Method and system for viewing system log context
CN111177098A