Message management method and device, equipment and storage medium

By performing topic matching and policy-configured publishing and subscription scheduling on messages, the problem of system performance degradation in high-frequency message scenarios is solved, and efficient and accurate message delivery and rational utilization of system resources are achieved to meet the needs of different application scenarios.

CN120768872APending Publication Date: 2025-10-10GUANGZHOU HUYA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510568566.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-30
Publication Date
2025-10-10

AI Technical Summary

Technical Problem

The existing message management method is prone to frequent page rendering freezes, excessive cached messages, and decreased system performance in high-frequency message scenarios. It also lacks dynamic management and scheduling, making it difficult to balance the real-time nature of messages and system load, and unable to adapt to diverse message processing needs.

Method used

By obtaining the messages published by the message publisher and determining whether they belong to the subscriber's topic, the system performs message publishing and subscription scheduling based on preset policy configurations, including frequency control processing, batch processing, cache management, etc., to implement a configurable message filtering and distribution mechanism to adapt to the performance requirements of different application scenarios.

Benefits of technology

It improves the efficiency and accuracy of message delivery, ensures that messages are delivered to target subscribers in a timely and accurate manner, optimizes system resource utilization, meets diverse message management needs, and ensures the stability and smooth operation of application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120768872A_ABST
    Figure CN120768872A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and discloses a message management method and device, equipment and a storage medium. The message management method comprises the following steps: acquiring a first message published by a message publisher, wherein the first message comprises a bullet screen message and / or a component communication message; judging whether the first message belongs to a message theme of a message subscriber or not; if the first message belongs to the message theme of the message subscriber, performing message publishing scheduling processing on the first message based on preset first strategy configuration to obtain a second message; and distributing the second message to the message subscriber. Through the method, a message screening and distributing mechanism is realized, the high efficiency and accuracy of message transmission can be ensured, the configurability of issuing and scheduling strategies is realized, different message processing mechanisms can be customized for different application scenes, the flexibility and adaptability are high, the information transmission efficiency is improved, and the user experience is improved. Diversified message management requirements are met, and the stability of an application scene is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a message management method, apparatus, device and storage medium. Background Art

[0002] In front-end application development, the message bus is widely used for communication between different components. It decouples publishers from subscribers through the Pub / Sub model, enabling independent message delivery between publishers and subscribers.

[0003] Traditional message bus-based message management methods typically use a simple event broadcast mechanism for message distribution, processing each message individually and broadcasting it. However, in high-frequency message scenarios, such as data-intensive applications or real-time data stream interaction scenarios, processing messages one by one can easily cause frequent page rendering freezes and excessive cached messages, resulting in degraded system performance and difficulty meeting the stability requirements of the corresponding scenarios. In addition, existing message management methods also lack dynamic management and scheduling of messages, making it difficult to balance the real-time nature of messages and system load. They also suffer from problems such as high memory usage and low message processing efficiency, making them unable to adapt to diverse message processing needs. Summary of the Invention

[0004] The main purpose of the present invention is to provide a message management method, device, equipment and storage medium, aiming to solve the technical problem of low message processing efficiency in existing message management methods.

[0005] The first aspect of the present invention provides a message management method, which includes: obtaining a first message published by a message publisher, the first message including a barrage message and / or a component communication message; determining whether the first message belongs to the message topic of the message subscriber; if the first message belongs to the message topic of the message subscriber, then based on a preset first policy configuration, performing message publishing scheduling processing on the first message to obtain a second message; and distributing the second message to the message subscriber.

[0006] Optionally, in a first implementation method of the first aspect of the present invention, the preset first policy configuration includes a first preset frequency control switch identifier and a preset publishing frequency; if the first message belongs to the message topic of the message subscriber, then based on the preset first policy configuration, the first message is subjected to message publishing scheduling processing, and the second message obtained includes: if the first message belongs to the message topic of the message subscriber, then based on the first preset frequency control switch identifier, it is determined whether the first message needs to be frequency controlled; if it is determined that the first message needs to be frequency controlled, then the first message is frequency controlled based on the preset publishing frequency to obtain the second message.

[0007] Optionally, in a second implementation method of the first aspect of the present invention, the preset first policy configuration also includes a preset processing cycle; if the first message belongs to the message topic of the message subscriber, then based on the first preset frequency control switch identifier, before judging whether the first message needs to be frequency controlled, it includes: batch processing the first message based on the preset processing cycle to obtain multiple publishing groups; if it is determined that the first message needs to be frequency controlled, then frequency control processing is performed on the first message based on the preset publishing frequency to obtain a second message, including: if it is determined that the first message needs to be frequency controlled, then frequency control processing is performed on the first message according to the publishing group based on the preset publishing frequency to obtain a second message.

[0008] Optionally, in a third implementation of the first aspect of the present invention, the message management method further includes: obtaining the second message distributed by the message publisher; determining whether the second message belongs to the message topic of the message subscriber; if the second message belongs to the message topic of the message subscriber, performing message subscription scheduling processing on the second message based on a preset second policy configuration to obtain a third message; generating a message notification of the third message and sending it to the message subscriber.

[0009] Optionally, in a fourth implementation manner of the first aspect of the present invention, the preset second policy configuration includes a second preset frequency control switch identifier and a preset notification frequency; if the second message belongs to the message topic of the message subscriber, then based on the preset second policy configuration, the second message is message subscription scheduling processed to obtain a third message including: if the second message belongs to the message topic of the message subscriber, then based on the second preset frequency control switch identifier, it is determined whether the second message needs to be frequency controlled; if it is determined that the second message needs to be frequency controlled, then the second message is frequency controlled based on the preset notification frequency to obtain a third message.

[0010] Optionally, in a fifth implementation of the first aspect of the present invention, the third message includes multiple message entities, the message subscribers include multiple subscription groups, and each subscription group corresponds to a message cache list; if the second message belongs to the message topic of the message subscriber, the second message is subjected to message subscription scheduling processing based on a preset second policy configuration, and after obtaining the third message, it also includes: caching the message entity, and generating a message identifier corresponding to the message entity, and caching the message identifier into the message cache list corresponding to each subscription group; when it is detected that the message identifier is adopted by the subscription group, releasing the message identifier cached in the message cache list corresponding to the subscription group; when it is detected that the message identifier has been released in the message cache list of each subscription group, releasing the cached message entity.

[0011] Optionally, in the sixth implementation method of the first aspect of the present invention, after caching the message entity, generating a message identifier corresponding to the message entity, and caching the message identifier in the message cache list corresponding to each subscription group, it also includes: judging whether the number of message identifiers in the message cache list reaches the preset message cache maximum threshold; if the number of message identifiers reaches the preset message cache maximum threshold, discarding the newly acquired third message, and limiting the acquisition of the third message.

[0012] The second aspect of the present invention also provides a message management device, which includes: an acquisition module for acquiring a first message published by a message publisher, the first message including a barrage message and / or a component communication message; a judgment module for judging whether the first message belongs to the message topic of the message subscriber; a processing module for performing message publishing scheduling processing on the first message based on a preset first policy configuration when the first message belongs to the message topic of the message subscriber to obtain a second message; and a communication module for distributing the second message to the message subscriber.

[0013] The third aspect of the present invention also provides a computer device, which includes: a memory and at least one processor, wherein the memory stores instructions; the at least one processor calls the instructions in the memory so that the computer device executes the message management method as described above.

[0014] A fourth aspect of the present invention further provides a computer-readable storage medium, on which instructions are stored. When the instructions are executed by a processor, the message management method as described above is implemented.

[0015] The embodiments of the present invention provide a message management method, apparatus, device and storage medium, which implement a message screening and distribution management mechanism with configurable policies by screening the message topics published by the publisher and scheduling the publication of the messages according to a preset policy configuration, realize the configurability of the publication scheduling policy, and can customize different message processing mechanisms for different application scenarios to adapt to different performance requirements, business requirements and fault tolerance. It has high flexibility and adaptability, is conducive to improving the efficiency of information transmission, meets diverse message management needs, ensures the stable and smooth operation of application scenarios, and ensures the efficiency and accuracy of message transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A schematic diagram of a flow chart of an embodiment of a message management method according to an embodiment of the present invention;

[0017] Figure 2 A flow chart of another embodiment of the message management method in the embodiment of the present invention

[0018] Figure 3 for Figures 1 to 2 A schematic diagram of the process structure of an embodiment of the message management method described;

[0019] Figure 4 This is a functional module diagram of an embodiment of a message management device according to an embodiment of the present invention;

[0020] Figure 5 In the embodiment of the present invention, Figure 4 A schematic diagram of functional modules of a message management device described herein that is in communication with an application side and a server side;

[0021] Figure 6 This is a schematic diagram of the functional modules of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0022] The terms "first," "second," "third," "fourth," and the like (if any) in the description and claims of the present invention and in the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to these processes, methods, products, or apparatus.

[0023] For ease of understanding, the specific process of the message management method in the embodiment of the present invention is described below. The message management method of this embodiment is applied to electronic devices, which can be terminals, such as smart phones, laptops, tablet computers, desktop computers, etc., or development boards, chip systems, etc. Figure 1 , Figure 1 This is a flow chart of a first embodiment of a message management method according to an embodiment of the present invention. In this embodiment, the message management method includes:

[0024] 101. Obtain a first message published by a message publisher, where the first message includes a bullet screen message and / or a component communication message;

[0025] In this embodiment, the message publisher is a component that creates and sends messages, such as an application, a service module, or a user terminal, and the first message it publishes includes a barrage message and / or a component message, wherein a barrage message refers to text information that needs to be displayed in real time on the application-side screen, which is usually pushed by the server to the application-side component for acquisition and consumption by the corresponding application side, and a component communication message refers to events, commands, and requests transmitted between components. These two types of messages are the most common message types in high-frequency message scenarios such as data-intensive applications or real-time data stream interactions, such as live broadcasts, video conferences, and online games. By obtaining these messages, the method of the present invention can further process and schedule them. By publishing the first message, the message publisher can achieve instant information delivery and efficient interaction to meet its expression and communication needs.

[0026] 102. Determine whether the first message belongs to the message topic of the message subscriber;

[0027] In this embodiment, the message subscriber is a component that subscribes to and receives specific messages, and can also be an application, a service module, or a user terminal. The message topic (Topic) of the message subscriber refers to the default or preset preferred topic category of the message subscriber, which is used to filter and receive specific types of messages. By logically grouping messages to achieve directional delivery, decoupled communication between the message sender and the message subscriber is achieved. When the first message is the message topic of the message subscriber, it usually indicates that the message subscriber has specific needs or concerns about the content of the message. The message can be processed and delivered with priority in the future, and some or all irrelevant messages can be blocked, thereby improving the pertinence and efficiency of information processing. When the first message does not belong to the message topic of the message subscriber, it usually indicates that the message subscriber has no specific needs or concerns about the content of the message, and may even be in a blocked state. Subsequent processing can be performed according to the policy configuration, such as ignoring, discarding, or delaying processing.

[0028] 103. If the first message belongs to the message topic of the message subscriber, perform message publishing scheduling processing on the first message based on the preset first policy configuration to obtain a second message;

[0029] In this embodiment, when the first message belongs to the message topic of the message subscriber, the corresponding first message can be scheduled and processed. The scheduling process is performed based on the preset first policy configuration, which refers to a pre-set processing rule that can be obtained from internal storage or input from the outside. It can be flexibly adjusted and preset according to the actual needs of message management, application scenarios, and the real-time status of the application end. The preset first policy configuration can specifically include the configuration of parameters such as message priority, processing method, and forwarding path. According to the preset first policy configuration, efficient distribution and accurate delivery of messages are achieved, ensuring that important information reaches the target subscribers in a timely manner, while optimizing system resource allocation, improving overall message processing performance, and meeting complex and changing application requirements.

[0030] In this embodiment, the message release scheduling of the first message refers to optimizing the path, timing, and method of the first message release according to the preset first policy configuration, such as adjusting the frequency, quantity, and priority of the first message release to ensure that the message is delivered at the right time, along the right path, and in the right manner. In a high-frequency message scenario, there are usually multiple first messages obtained within a period of time. In order to avoid message congestion and resource waste and ensure that each message can efficiently reach the target subscriber, the corresponding preset first policy configuration usually needs to take into account factors such as the type, importance, and timeliness of the first message to dynamically adjust the release strategy to ensure the timeliness and accuracy of message delivery and optimize resource utilization. The second message can be obtained by performing message release scheduling processing on the first message through the preset first configuration. The second message retains the core content of the first message, and since it is a message obtained after the message release scheduling processing, it will also be more adapted to the performance conditions and subscription requirements of the message publisher, thereby improving the pertinence and effectiveness of message delivery.

[0031] Optionally, in some embodiments, the preset first policy configuration includes a first preset frequency control switch identifier and a preset publishing frequency. If the first message belongs to the message topic of the message subscriber, then based on the preset first policy configuration, message publishing scheduling processing is performed on the first message to obtain the second message, including: if the first message belongs to the message topic of the message subscriber, then based on the first preset frequency control switch identifier, determining whether frequency control is required for the first message; if it is determined that frequency control is required for the first message, then performing frequency control processing on the first message based on the preset publishing frequency to obtain the second message.

[0032] This optional embodiment specifically provides a frequency control processing method, wherein frequency control refers to controlling the frequency of message publishing to avoid issues such as excessive system resource usage or delayed message processing due to overly frequent message publishing, thereby limiting the flow of messages and ensuring the stability and efficiency of message publishing. Through frequency control processing, resources can be reasonably allocated while ensuring timely message delivery, avoiding processing delays caused by excessive messages, ensuring that subscribers receive both accurate and efficient information, and improving the stability of related applications and the overall efficiency of information processing.

[0033] In this optional embodiment, the frequency control processing of the first message is specifically determined based on the first preset frequency control switch flag in the preset first configuration policy to determine whether to perform frequency control. The first preset frequency control switch flag can be preset by relevant management personnel, or it can be dynamically adjusted based on real-time load and message traffic to determine the flag state of turning frequency control on or off. When the first preset frequency control switch flag is in the on state, the first message can be frequency controlled according to the preset publishing frequency. The preset publishing frequency refers to the preset number of times a message is published per unit time. The message distribution time is determined according to the time interval of message distribution, such as once every 50 milliseconds, twice per second, etc., which is used to control the rhythm of message distribution to avoid the second message being published too frequently or sparsely, thereby avoiding accumulation or omission. At the same time, the setting of the preset publishing frequency also facilitates the coordination of the message transmission rhythm between publishers and subscribers, ensuring the synchronization of information reception and processing between the two parties, and further optimizing message transmission efficiency and system resource utilization. The preset publishing frequency can be set based on multiple factors such as message type, traffic conditions, and system load to achieve balanced and stable message distribution. By dynamically adjusting the frequency control strategy, it can not only effectively cope with sudden traffic, but also maintain efficient operation under low load, ensuring the stability and reliability of message delivery.

[0034] Optionally, in some embodiments, the preset first policy configuration also includes a preset processing cycle; if the first message belongs to the message topic of the message subscriber, then based on the first preset frequency control switch identifier, before determining whether the first message needs to be frequency controlled, it includes: batch processing the first message based on the preset processing cycle to obtain multiple publishing groups; if it is determined that the first message needs to be frequency controlled, then frequency control processing is performed on the first message based on the preset publishing frequency to obtain a second message, including: if it is determined that the first message needs to be frequency controlled, then frequency control processing is performed on the first message according to the publishing group based on the preset publishing frequency to obtain a second message.

[0035] In this optional embodiment, the preset processing period is a time window for receiving the first message, which is used to process the received first message in batches according to the time window, package the first message and distribute it centrally, such as processing a batch of messages every 50 milliseconds, processing a batch of messages every second, etc., to ensure the orderliness and efficiency of message processing, avoid the performance degradation problem caused by too frequent page rendering due to directly processing each message one by one, and can effectively reduce the number of page renderings, making message distribution smoother, which is conducive to improving performance.

[0036] In this optional embodiment, after the first message is processed in batches according to a preset processing cycle, multiple publishing groups will be obtained, and each group of messages will be frequency-controlled according to a preset preset publishing frequency. On this basis, whether the first message needs to be frequency-controlled can be judged based on the publishing group information, such as the message volume and accumulation of the publishing group. When the message volume of the publishing group is large or the accumulation is serious, in order to avoid excessive load, the frequency control strategy can be enabled to determine that the first message needs to be frequency-controlled. Based on the setting of the publishing group, the frequency control processing of the first message will be performed according to the publishing group based on the preset publishing frequency. For example, for each publishing group, the message distribution time is determined according to the preset publishing frequency. When the distribution time is reached, a certain number of messages are taken out from a publishing group or a publishing group for distribution to ensure that the message distribution is uniform and not too frequent, so as to achieve the purpose of current limiting. In this way, the frequency control strategy can be further refined to make the message distribution more accurate and efficient, and to meet the needs of different application scenarios. At the same time, the strategy can also better balance the timeliness of message publishing and the occupancy of system resources, ensuring the stability and reliability of message transmission.

[0037] 104. Distribute the second message to the message subscriber;

[0038] In this embodiment, after obtaining the second message, the second message can be distributed to the message subscriber. The distribution of the message can be realized through middleware such as a message bus, a message queue, etc., to ensure efficient transmission and correct delivery of the message. In the distribution process of the second message, the receiving capacity and processing capacity of the subscriber need to be considered to avoid message overload. By dynamically adjusting the distribution strategy, the balanced allocation of messages among subscribers is ensured, and the stability and user experience of the overall system are further improved. At the same time, a feedback mechanism for message sending failure can be set in the distribution process, for example, when the message sending fails, retrying or recording error logs in time for subsequent analysis and processing, to ensure the integrity and reliability of message transmission. In addition, the distribution strategy can be dynamically optimized according to the feedback of the subscriber, for example, the priority and distribution order of the message can be adjusted according to the subscription state of the subscriber, the preference degree of the subscriber to certain message topics, and the change of the processing capacity of the subscriber, etc., to realize more accurate message delivery and improve the efficiency and accuracy of message transmission.

[0039] The message management method described above can realize the scheduling of message publishers, and can be deployed on the server side or the application side. Through flexible and configurable filtering, scheduling and distribution processing of the first message published by the message publisher, the message management method can ensure the ordered distribution of the message, effectively reduce the load while meeting the real-time and accuracy of message transmission, provide customized message processing mechanism for different application scenarios, and meet the diversified message management needs.

[0040] Referring to Figure 2 , Figure 2 is another embodiment flow diagram of the message management method in the embodiment of the application. In this embodiment, the message management method further includes:

[0041] 201. Obtain the second message distributed by the message publisher;

[0042] 202. Determine whether the second message belongs to the message topic of the message subscriber;

[0043] 203. If the second message belongs to the message topic of the message subscriber, perform message subscription scheduling processing on the second message based on the preset second strategy configuration to obtain a third message;

[0044] 204. Generate a message notification of the third message and send it to the message subscriber.

[0045] This embodiment provides a message management method for message subscription scheduling. After receiving a second message distributed by a message publisher, it is also necessary to determine whether the second message belongs to the message subject of the message subscriber to ensure the accuracy of message reception and processing. Since there may be multiple message publishers, the received second messages may also come from different sources. They need to be screened and matched according to the specific needs of the subscriber to avoid interference from irrelevant messages. After confirming that the second message belongs to the subscriber's subject, the message is carefully subscribed and scheduled based on the preset second policy configuration, generating a precise third message and corresponding message notification to ensure timely and accurate delivery to the target subscriber.

[0046] In this embodiment, the preset second policy configuration is a pre-set processing rule that can also be obtained from internal storage or input from the outside. It can be flexibly adjusted and updated, and preset according to the actual needs of message management, application scenarios, and the real-time status of the application end. The preset second policy configuration can specifically include the configuration of parameters such as message priority, processing method, and notification path. According to the preset second policy configuration, personalized subscription and precise push of messages are achieved, ensuring that messages can be processed and notified according to the preferences and needs of subscribers. In addition, the preset second policy configuration can also include deduplication, merging, summarization, and other processing of messages to reduce redundant information and improve the quality and readability of information.

[0047] In this embodiment, subscription scheduling for a second message involves optimizing the processes of receiving, processing, and notifying the second message based on a preset second policy configuration. For example, adjustments are made to the second message's reception priority, processing method, and notification timing, ensuring that the message is delivered to the intended subscriber at the appropriate time and in the appropriate manner. In high-frequency message scenarios, to avoid an overabundance of messages that prevents subscribers from processing them, the preset second policy configuration can be used to intelligently filter and sort second messages, limit or discard second messages, prioritize the processing and delivery of important or urgent messages, and ensure that subscribers receive critical information in a timely manner. Furthermore, reasonable subscription scheduling can effectively reduce the interference of invalid messages, improving subscribers' information processing efficiency and experience. Subscription scheduling for the second message based on the preset second policy configuration yields a third message. This third message retains the core information of the second message, and because it is obtained through message subscription scheduling, its content is more aligned with the subscriber's performance requirements and subscription requirements, thereby improving the relevance and effectiveness of the message, ensuring that subscribers can efficiently obtain and process critical information, and optimizing the overall information delivery process.

[0048] Optionally, in some embodiments, the preset second policy configuration includes a second preset frequency control switch identifier and a preset notification frequency; if the second message belongs to the message topic of the message subscriber, then based on the preset second policy configuration, the second message is message subscription scheduling processed, and the third message obtained includes: if the second message belongs to the message topic of the message subscriber, then based on the second preset frequency control switch identifier, it is determined whether the second message needs to be frequency controlled; if it is determined that the second message needs to be frequency controlled, then the second message is frequency controlled based on the preset notification frequency to obtain the third message.

[0049] In this optional embodiment, a frequency control processing method for the second message is specifically described. The second preset frequency control switch identifier and the preset notification frequency in the preset second policy configuration are different from the first preset frequency control switch identifier and the preset publishing frequency in the preset first policy configuration, and are mainly used to perform frequency control processing on the second message. Among them, the second preset frequency control switch identifier can also be preset and determined by the relevant management personnel, or it can be dynamically adjusted according to the real-time load of the system, the message traffic and the processing capacity of the subscriber to determine the identification state of turning on or off the frequency control. When the second preset frequency control switch identifier is in the on state, the second message can be frequency controlled according to the preset notification frequency. The preset notification frequency refers to the preset number of message notifications to the subscriber per unit time. Its setting also needs to consider multi-dimensional factors such as message type, subscriber processing capacity and system load to achieve balance and stability of message publishing. Through this frequency control processing, the system can further ensure the timeliness and accuracy of message delivery, while avoiding the problem of subscribers not being able to process in time due to too many messages or excessive system resource usage, thereby optimizing the overall message management process.

[0050] In this optional embodiment, since its message management mainly processes messages for notifying message subscribers, the second messages it receives arrive in batches in some optional cases. Therefore, when frequency-controlling the second messages, it is also necessary to consider the batch arrival of the messages, that is, it is necessary to determine whether the amount of second messages in the current processing batch has reached the preset threshold, or to determine whether the message accumulation is serious, in order to determine whether the messages in the current batch need to be frequency-controlled. If it is determined that the second messages in the current batch need to be frequency-controlled, the notification time of the message is determined according to the preset notification frequency. When the notification time is reached, the messages in the current batch are distributed, or a certain number of messages are taken out of the current batch for distribution, to ensure that the notification of the messages is uniform and not too frequent, to avoid message overload for subscribers. In this way, the frequency control strategy for the second message can be further refined to ensure that the notification of the message is both timely and efficient, while avoiding excessive occupation of system resources, thereby improving the overall message management efficiency and user experience.

[0051] Optionally, in some embodiments, the third message includes multiple message entities, the message subscribers include multiple subscription groups, and each subscription group corresponds to a message cache list; if the second message belongs to the message topic of the message subscriber, the second message is message subscription scheduling processed based on the preset second policy configuration, and after obtaining the third message, it also includes: caching the message entity, and generating a message identifier corresponding to the message entity, and caching the message identifier in the message cache list corresponding to each subscription group; when it is detected that the message identifier is adopted by the subscription group, releasing the message identifier cached in the message cache list of the corresponding subscription group; when it is detected that the message identifier has been released in the message cache list of each subscription group, releasing the cached message entity.

[0052] In this optional embodiment, the message entity refers to the complete data object of the message content, such as the specific content of the barrage message, the sender, the time and other actual information. The message entity is uniquely cached in this embodiment, and all subscription groups share the same message entity, rather than each copying the data of the message entity. The subscription group only caches the message identifier of the message entity in its cached message list, and references the unique message entity through the message identifier, thereby reducing cache occupancy. At the same time, this embodiment sets up a mechanism for timely release of the message entity cache. After the subscription group uses the message identifier to reference the message entity for processing, the message identifier cached in the message cache list will be released in the message cache list. After the subscription groups have released the message identifier, it means that all subscription groups have completed the processing of the message entity. At this time, the system will release the cache of the message entity to save storage space and improve the utilization of system resources. This design can effectively reduce the redundant storage of messages while ensuring that messages can be processed in a timely manner by all relevant subscription groups.

[0053] In this optional embodiment, subscription groups can be specifically divided based on the message subject and processing capabilities of the message subscribers. Processing capabilities include, but are not limited to, single message batch processing capability, processing speed, and maximum concurrent processing capability. For example, subscribers with the same message subject but different processing capabilities can be divided into different subscription groups to achieve accurate message push and efficient processing. Each subscription group is associated with a message cache list, which is used to cache the message identifiers that the subscription group needs to process, so that the subscription group can reference the corresponding message entity based on the message identifier for processing. The message identifier is identification information uniquely corresponding to the message entity and can be used to reference the specific message entity. The message entity cache and message cache list can be specifically located in a specific message storage unit, message processing queue, or memory module. Furthermore, since the acquired second message is one or more, one or more message identifiers will be cached in the message cache list. When a subscription group processes a message, it references the corresponding message entity based on the message identifier in the message cache list. This approach ensures that messages are pushed to the corresponding subscription group in a timely and accurate manner, while avoiding redundant message storage and improving message processing efficiency and system resource utilization.

[0054] In this optional embodiment, whether the message identifiers in the message cache list of each subscription group have been released can be judged specifically by counting. Specifically, the count can be increased each time the message identifier is cached in a message cache list, and the count can be decreased each time the message identifier is consumed by a subscription group and released from the corresponding message cache list. When the count result is zero, it means that all subscription groups have released the message identifier. At this time, the operation of releasing the message entity corresponding to the message identifier can be triggered, thereby ensuring that the cache of the message entity is cleared in time and avoiding invalid occupation of resources. This design not only improves the efficiency of message processing, but also optimizes the utilization of system resources, so that the message management system can operate more stably and efficiently. At the same time, the mechanism can also dynamically adjust the cache strategy of the message entity according to the real-time status of the subscription group, further improving the flexibility and adaptability of message management.

[0055] Optionally, in some embodiments, after caching the message entity and generating a message identifier corresponding to the message entity, and caching the message identifier in the message cache list corresponding to each subscription group, it also includes: determining whether the number of message identifiers in the message cache list reaches a preset message cache maximum threshold; if the number of message identifiers reaches the preset message cache maximum threshold, discarding the newly acquired third message and limiting the acquisition of the third message.

[0056] In this optional embodiment, a message processing optimization method for a message cache list is provided. In actual applications, since message subscribers may subscribe to multiple message topics at the same time, and the processing capabilities of each subscription group are also different, the number of message identifiers cached in the message cache list may continue to grow. In order to avoid the problem of excessive system resource usage caused by the unlimited growth of the message cache list, a preset message cache maximum threshold is set in this embodiment to limit the maximum number of message identifiers in the message cache list. When the number of message identifiers in the message cache list reaches this preset maximum threshold, corresponding protection measures can be taken, that is, discarding the newly acquired third message and limiting the acquisition of the third message. In this way, the excessive expansion of the message cache list can be effectively avoided, ensuring the rational use of system resources.

[0057] In this optional embodiment, discarding the newly acquired third message can be a simple process, i.e., directly discarding it. However, to avoid the loss of important messages, this embodiment can also consider providing a message backup or message recovery mechanism. For example, the discarded third message can be temporarily stored in a backup storage unit. When the number of message identifiers in the message cache list decreases to a safe range, the backed-up third message can be re-added to the message processing process. At the same time, limiting the acquisition of third messages is also an effective protection measure. Specifically, by adjusting the frequency or number of message acquisitions, reasonable control of message traffic can be achieved, avoiding problems such as insufficient system processing or excessive resource utilization caused by excessive messages. This flow-limiting strategy can be dynamically adjusted based on the system's real-time load, message traffic, and subscriber processing capabilities to achieve balanced and stable message processing. Through the above-mentioned message processing optimization method, more efficient and reliable management of the message cache list is achieved, ensuring that messages are pushed to the corresponding subscription groups in a timely and accurate manner, while avoiding redundant message storage and inefficient use of system resources. This design not only improves the efficiency of message processing but also optimizes the utilization of system resources, enabling the message management system to operate more stably and efficiently.

[0058] This embodiment can be found in Figure 3 , Figure 3It is a flow chart of an embodiment of the message management method of the present invention. This message management method is implemented based on the operations of the publisher and the subscriber, and is implemented through two parts: message publishing management and message subscription management. The publisher operation includes creating a publisher and publishing messages, and the subscriber operation includes creating or canceling subscriptions. After the publisher creates a publisher, the message publishing management part will create a publishing group for the corresponding message topic, so that the messages published by the newly created publisher can be correctly classified and distributed to the corresponding subscribers. After the subscriber creates or cancels the subscription, the message subscription management part will create or cancel the corresponding subscription group, so that the subscriber can receive the messages under its message topic, and will not receive the messages published by the corresponding publisher when there is no corresponding subscription.

[0059] In this embodiment, after the publisher publishes the first message, the message publishing management component will first determine whether the message subject of the message subscriber exists in the published message. If the message subject exists, the corresponding publishing group information can be further obtained to determine whether frequency control is required. If the message subject of the message subscriber does not exist in the published message, it means that the message is irrelevant to the subscriber and can be directly discarded to avoid interference with the subsequent message processing process. If it is confirmed that the published first message requires frequency control, frequency control processing is performed and the message is distributed. If frequency control is not required, the message is directly distributed to distribute the corresponding second message to the message subscription management component of the message subscriber. After the message subscription management component receives one or more second messages sent by some publishers through the processing of the message publishing management component, it will first query the message subject and determine whether the message of the corresponding message subject requires frequency control. If frequency control is required, the corresponding frequency control processing is performed and a message notification of the third message is issued. If frequency control is not required, the corresponding message notification of the third message can be directly issued, realizing the full process of message notification management.

[0060] In this embodiment, it is necessary to understand that Figure 3 The message publishing management part and the message subscription management part in the system may not be the only corresponding connected parts. For example, multiple message publishing management parts and multiple message subscription management parts can communicate decoupledly through a bus or queue, so that messages can be efficiently and accurately transmitted between different publishers and subscribers. This message management method can be specifically applied to the application side, such as mobile phones, computers or tablets, to achieve message transmission between different components of the application side. These components can be divided into message publishers and message subscribers according to their functions or business logic. The decoupled communication between message publishers and message subscribers enables efficient and accurate message transmission within the application side.

[0061] This embodiment implements a message filtering and distribution management mechanism with configurable policies by filtering the message topics published by the publisher and scheduling the release of messages according to preset policy configurations. This allows for configurable release scheduling policies and can customize different message processing mechanisms for different application scenarios to accommodate different performance requirements, business needs, and fault tolerance. This method is highly flexible and adaptable, which helps improve information delivery efficiency, meet diverse message management needs, ensure stable and smooth operation of application scenarios, and ensure efficient and accurate message delivery. In high-frequency message scenarios, this method can effectively reduce the frequency of message processing, avoid message overload, and ensure the rational use of system resources. At the same time, by accurately matching the message topics of message subscribers and distributing messages based on the processing capabilities of subscribers, accurate message push is achieved, further improving the efficiency and accuracy of message delivery. Furthermore, this method provides message caching and message recovery mechanisms to ensure the integrity and reliability of messages during delivery and avoid the loss of important messages. This method can effectively balance the real-time nature of messages and system load, improve the efficiency of message processing, meet the stability requirements of application scenarios, and effectively solve the problems of untimely message processing, high resource usage, and message loss in the message management methods in the existing technology.

[0062] In order to execute the corresponding steps in the above method embodiment and each possible implementation method, the following provides an implementation method of a message management device. Figure 4 , Figure 4 The following is a functional module diagram of an embodiment of a message management device in an embodiment of the present invention. In this embodiment, the message management device 300 includes: an acquisition module 310 for acquiring a first message published by a message publisher, the first message including a bullet screen message and / or a component communication message; a judgment module 320 for judging whether the first message belongs to the message subject of a message subscriber; a processing module 330 for performing message publishing scheduling processing on the first message based on a preset first policy configuration when the first message belongs to the message subject of the message subscriber to obtain a second message; and a communication module 340 for distributing the second message to the message subscriber.

[0063] Optionally, in some embodiments, the preset first policy configuration includes a first preset frequency control switch identifier and a preset publishing frequency, and the processing module 330 is specifically used to: when the first message belongs to the message topic of the message subscriber, determine whether the first message needs to be frequency controlled based on the first preset frequency control switch identifier; when it is determined that the first message needs to be frequency controlled, perform frequency control processing on the first message based on the preset publishing frequency to obtain a second message.

[0064] Optionally, in some embodiments, the preset first policy configuration also includes a preset processing cycle; the processing module 330 is specifically used to: perform batch processing on the first message based on the preset processing cycle to obtain multiple release groups; when it is determined that the first message needs to be frequency controlled, perform frequency control processing on the first message according to the release group based on the preset release frequency to obtain a second message.

[0065] Optionally, in some embodiments, the acquisition module 310 is further used to: acquire the second message distributed by the message publisher; the judgment module 320 is further used to: judge whether the second message belongs to the message topic of the message subscriber; the processing module 330 is further used to: when the second message belongs to the message topic of the message subscriber, based on a preset second policy configuration, perform message subscription scheduling processing on the second message to obtain a third message; the communication module 340 is further used to: generate a message notification of the third message and send it to the message subscriber.

[0066] Optionally, in some embodiments, the preset second policy configuration includes a second preset frequency control switch identifier and a preset notification frequency; the processing module 330 is further specifically used to: when the second message belongs to the message topic of the message subscriber, determine whether the second message needs to be frequency controlled based on the second preset frequency control switch identifier; when it is determined that the second message needs to be frequency controlled, perform frequency control processing on the second message based on the preset notification frequency to obtain a third message.

[0067] Optionally, in some embodiments, the third message includes multiple message entities, the message subscribers include multiple subscription groups, and each subscription group corresponds to a message cache list; the processing module 330 is specifically used to: cache the message entity, and generate a message identifier corresponding to the message entity, and cache the message identifier in the message cache list corresponding to each subscription group; when it is detected that the message identifier is adopted by the subscription group, release the message identifier cached in the message cache list of the corresponding subscription group; when it is detected that the message identifier has been released in the message cache list of each subscription group, release the cached message entity.

[0068] Optionally, in some embodiments, the judgment module 320 is further used to determine whether the number of message identifiers in the message cache list reaches a preset message cache maximum threshold; the processing module 330 is further used to discard the newly acquired third message when the number of message identifiers reaches a preset message cache maximum threshold, and limit the acquisition of the third message.

[0069] Optional, see Figure 5 , Figure 5 Inventive embodiments include Figure 4 A schematic diagram of functional modules of a message management device 300 in which an application end communicates with a server end.

[0070] In this optional embodiment, the application end includes the message management device 300 and multiple components. The message management device 300 is connected to each component in communication and is connected to an external server end. Through the message management device 300, the application end can realize the publication, subscription and management of messages, thereby improving the efficiency and accuracy of message transmission. By integrating the message management device 300, the application end can efficiently manage various types of messages, including bullet messages sent by the external server end and component communication messages of its internal components, making the application end more efficient, accurate and flexible in message processing, and can meet diverse message management needs, improve information transmission efficiency and the stability and fluency of application scenarios. The message management device 300 can be an improved message bus or other specific message middleware. Through the message management device 300, the application end can better realize decoupled communication between different components, reduce system complexity, and improve the maintainability and scalability of the system. At the same time, since the message management device 300 supports configurable policy management, the application end can also flexibly adjust the message processing strategy according to actual business needs to adapt to different application scenarios. In addition, the message management device 300 also provides a message cache and message recovery mechanism, which further enhances the reliability and integrity of message delivery and can also avoid the loss of important messages.

[0071] Since the embodiments of the device 300 part correspond to the embodiments of the above-mentioned method, please refer to the above-mentioned method embodiments for the introduction of the message management device 300 provided by the embodiment of the present invention. The embodiment of the present invention will not be repeated here, and it has the same beneficial effects as the above-mentioned message management method.

[0072] The present invention also provides a computer device, which includes a memory and a processor. The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the message management method as described above. Figure 64 is a functional module diagram of a computer device provided by an embodiment of the present invention. The computer device 400 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 410 (for example, one or more processors) and memory 420, and one or more storage media 430 (for example, one or more mass storage devices) storing application programs 433 or data 432. Among them, the memory 420 and the storage medium 430 can be temporary storage or permanent storage. The program stored in the storage medium 430 may include one or more modules (not shown in the figure), each module may include a series of instruction operations in the computer device 400. Furthermore, the processor 410 can be configured to communicate with the storage medium 430 to execute a series of instruction operations in the storage medium 430 on the computer device 400.

[0073] The computer device 400 may further include one or more power supplies 440, one or more wired or wireless network interfaces 450, one or more input and output interfaces 460, and / or one or more operating systems 431. It will be understood by those skilled in the art that Figure 6 The illustrated computer device structure does not limit the computer device and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0074] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the message management method as described above.

[0075] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. If the integrated module or unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0076] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A message management method, characterized in that: include: Obtaining a first message published by a message publisher, where the first message includes a bullet screen message and / or a component communication message; Determining whether the first message belongs to the message subject of the message subscriber; If the first message belongs to the message topic of the message subscriber, performing message publishing scheduling processing on the first message based on the preset first policy configuration to obtain a second message; The second message is distributed to message subscribers.

2. The message management method according to claim 1, wherein: The preset first strategy configuration includes a first preset frequency-controlled switch identifier and a preset release frequency; If the first message belongs to the message topic of the message subscriber, performing message publishing scheduling processing on the first message based on the preset first policy configuration to obtain a second message includes: If the first message belongs to the message topic of the message subscriber, determining whether frequency control needs to be performed on the first message based on the first preset frequency control switch identifier; If it is determined that the first message needs to be frequency controlled, the first message is frequency controlled based on the preset publishing frequency to obtain a second message.

3. The message management method according to claim 2, wherein: The preset first policy configuration further includes a preset processing period; Before determining whether frequency control is required for the first message based on the first preset frequency control switch identifier if the first message belongs to the message topic of the message subscriber, the method includes: Processing the first message in batches based on the preset processing period to obtain multiple publishing groups; If it is determined that frequency control needs to be performed on the first message, frequency control processing is performed on the first message based on the preset publishing frequency to obtain a second message, including: If it is determined that the first message needs to be frequency controlled, frequency control is performed on the first message according to the release group based on the preset release frequency to obtain a second message.

4. The message management method according to any one of claims 1 to 3, characterized in that: The message management method further includes: Obtaining the second message distributed by the message publisher; Determining whether the second message belongs to the message subject of the message subscriber; If the second message belongs to the message topic of the message subscriber, performing message subscription scheduling processing on the second message based on the preset second policy configuration to obtain a third message; A message notification of the third message is generated and sent to the message subscriber.

5. The message management method according to claim 4, characterized in that: The preset second strategy configuration includes a second preset frequency control switch identifier and a preset notification frequency; If the second message belongs to the message topic of the message subscriber, performing message subscription scheduling processing on the second message based on the preset second policy configuration, and obtaining a third message includes: If the second message belongs to the message topic of the message subscriber, determining whether frequency control needs to be performed on the second message based on the second preset frequency control switch identifier; If it is determined that the second message needs to be frequency controlled, frequency control is performed on the second message based on the preset notification frequency to obtain a third message.

6. The message management method according to claim 4, characterized in that: The third message includes multiple message entities, the message subscribers include multiple subscription groups, and each subscription group corresponds to a message cache list; If the second message belongs to the message topic of the message subscriber, performing message subscription scheduling processing on the second message based on the preset second policy configuration, and obtaining the third message further includes: caching the message entity, generating a message identifier corresponding to the message entity, and caching the message identifier into the message cache list corresponding to each subscription group; When detecting that the message identifier is adopted by the subscription group, releasing the message identifier cached in the message cache list corresponding to the subscription group; When it is detected that the message identifiers in the message cache list of each subscription group have been released, the cached message entity is released.

7. The message management method according to claim 6, characterized in that: After caching the message entity, generating a message identifier corresponding to the message entity, and caching the message identifier in the message cache list corresponding to each subscription group, the method further includes: Determine whether the number of the message identifiers in the message cache list reaches a preset message cache maximum threshold; If the number of the message identifiers reaches the preset message cache maximum threshold, the newly acquired third message is discarded, and acquisition of the third message is limited.

8. A message management device, characterized in that: include: An acquisition module, configured to acquire a first message published by a message publisher, wherein the first message includes a bullet screen message and / or a component communication message; A judgment module, configured to judge whether the first message belongs to a message subject of a message subscriber; a processing module, configured to, when the first message belongs to a message topic of a message subscriber, perform message publishing scheduling processing on the first message based on a preset first policy configuration to obtain a second message; The communication module is configured to distribute the second message to message subscribers.

9. A computer device, characterized in that: The computer device includes: a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instructions in the memory to enable the computer device to execute the message management method according to any one of claims 1 to 7.

10. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by a processor, the message management method according to any one of claims 1 to 7 is implemented.