Message processing and management method and device, electronic equipment, medium and program product

By randomly allocating producer server nodes in the online chat room service system to establish long links for users, and using consumer servers to listen to message queues and target databases for querying link information, the load problem during multi-device and multi-channel login and the message processing complexity in distributed environments are solved, and efficient message delivery and system performance improvement are achieved.

CN119583499APending Publication Date: 2025-03-07INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411899388.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

When facing multi-device and multi-channel login, the existing online chat room service system leads to multiple independent real-time connections, increasing the system load; in a distributed environment, the complex message processing and distribution may lead to resource waste and performance bottlenecks.

Method used

By randomly allocating the producer server nodes to establish long links for users, storing link information to the target database, and performing business processing and message distribution in response to user message sending. The consumer server listens to the message queue and querys the database to obtain target link information, achieving efficient message delivery.

Benefits of technology

Load balancing is realized, resource waste is reduced, system performance and user experience is improved, operation and maintenance costs and resource utilization efficiency are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119583499A_ABST
    Figure CN119583499A_ABST
Patent Text Reader

Abstract

The invention provides a message processing method which can be applied to the technical field of cloud computing and the field of distributed technologies. The method comprises the following steps: in response to user login, randomly allocating producer server nodes to a user and establishing a long link; the first producer server node stores link information established with the first user into a target database, and the second producer server node stores link information established with the second user into the target database; in response to a first user sending message, performing service processing on the message by using the first producer server node, and distributing the message to a specified message queue according to a preset rule; target link information is returned based on the consumer server; and sending the message to the second user by using the second producer server node based on the target link information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the fields of cloud computing technology and distributed technology, and more specifically to a message processing and management method, apparatus, device, medium, and program product. Background Art

[0002] The existing online chat room service system is widely used in customer marketing, solution design, enterprise docking and other scenarios, providing users with a convenient way of communication through multi-channel services such as mobile terminals. However, the existing online services have many limitations: First, when the same user opens the chat room page on multiple devices and channels, the system will establish an independent real-time connection for each page, resulting in multiple connections for the same user; second, the system processes and distributes each message in a distributed environment, which makes the message processing process complicated, and the same message may be consumed repeatedly on different server nodes, resulting in a waste of resources.

[0003] In addition, as the number of users and online messages grow, the load pressure on server nodes increases significantly, and the system has to continuously add server nodes to maintain performance, which further exacerbates server resource consumption and management difficulties, leading to increased operation and maintenance costs and reduced resource utilization efficiency. Especially in the face of high-concurrency scenarios, existing technologies lack effective mechanisms to balance server loads, which easily leads to performance bottlenecks. Summary of the invention

[0004] In view of the above problems, the present disclosure provides a message processing and management method, apparatus, electronic device, medium and program product.

[0005] According to the first aspect of the present disclosure, a message processing method is provided, which is applied to a producer server, and the method includes: in response to user login, randomly assigning a producer server node to the user and establishing a long link, wherein the user includes a first user and a second user, and the first user and the second user establish long links with a first producer server node and a second producer server node, respectively; the first producer server node stores the link information established with the first user in a target database, and the second producer server node stores the link information established with the second user in the target database; in response to the first user sending a message, using the first producer server node to perform business processing on the message, and distributing the message to a designated message queue according to preset rules; based on the consumer server listening to the designated message queue and querying the target database, obtaining the target link information returned by the consumer server; and based on the target link information, using the second producer server node to send the message to the second user.

[0006] According to an embodiment of the present disclosure, the message includes a chat room message, and the preset rules for message distribution specifically include: dividing the chat rooms of the first user and the second user into queue groups according to product types, wherein each product queue group contains at least one message queue; and randomly distributing the chat room messages to the message queues of the corresponding products.

[0007] According to an embodiment of the present disclosure, the business processing of the message using the first producer server node specifically includes: determining the message sending authority of the first user; in response to the first user having the message sending authority, verifying the sensitive information of the content of the message; and desensitizing the detected sensitive information.

[0008] According to an embodiment of the present disclosure, the producer server node further performs business processing on the message including: querying the list of the second user to determine the online status of the second user; if the second user is online, distributing the message to the corresponding message queue; and if the second user is offline, providing the second user with an offline notification of a third-party channel.

[0009] According to an embodiment of the present disclosure, the target database includes a non-relational database, and the link information is recorded in the non-relational database in a key-value pair format.

[0010] According to a second aspect of the present disclosure, a message processing method is provided, which is applied to a consumer server, and the method includes: monitoring at least one message queue; in response to a message monitored in the message queue, determining a second user who needs to receive the message according to the content of the message; obtaining link information of a second producer server node that establishes a long link with the second user from a target database; and notifying the second producer server node based on the link information, so that the second producer server node sends the message to the second user.

[0011] According to an embodiment of the present disclosure, the method further includes: adjusting the content of the message received by the second user according to the content of the message and the message receiving authority of the second user.

[0012] According to a third aspect of the present disclosure, a message processing method is provided, which is applied to a producer server and a consumer server, and the method includes: in response to a user logging in, the producer server randomly assigns a producer server node to the user and establishes a long link, wherein the user includes a first user and a second user, and the first user and the second user respectively establish long links with a first producer server node and a second producer server node; the first producer server node stores the link information established with the first user in a target database, and the second producer server node stores the link information established with the second user in the target database; in response to the first user sending a message, the first producer server node is used to perform business processing on the message, and the message is distributed to a designated message queue according to a preset rule; based on the consumer server monitoring the designated message queue; in response to the consumer server monitoring the message in the designated message queue, a second user who needs to receive the message is determined according to the content of the message; the target link information of the second producer server node that establishes a long link with the second user is obtained from the target database; the consumer server notifies the second producer server node of the target link information; and based on the target link information, the second producer server node is used to send the message to the second user.

[0013] According to a fourth aspect of the present disclosure, a message management method is provided, which is applied to a message server, and the method includes: configuring at least one message queue for each product, the message queue being used to store messages sent by a producer server and to deliver messages to a consumer server; monitoring the busyness of each message queue at predetermined time intervals; and managing the number of message queues and resource allocation based on a comparison result between the busyness of the message queue and a preset threshold.

[0014] According to an embodiment of the present disclosure, the number of message queues and resource allocation are managed based on the comparison result between the busyness of the message queues and a preset threshold, specifically including: in response to the throughput of a certain message queue reaching a first predetermined value M1, determining the corresponding first product, and increasing the number of message queues of the first product; and in response to the throughput of a certain message queue being lower than a second predetermined value M2, determining the corresponding second product, and reducing the number of message queues of the second product.

[0015] According to an embodiment of the present disclosure, the method further includes: allocating an idle message queue of the second product to the first product.

[0016] According to an embodiment of the present disclosure, the method further includes: if the quantity of the second product is equal to 0 and the quantity of the first product is greater than or equal to 1, creating a new message queue and appending it to the queue group of the first product.

[0017] According to an embodiment of the present disclosure, a first predetermined value M1 and a second predetermined value M2 are set according to the throughput per second of each message queue.

[0018] According to an embodiment of the present disclosure, the method for calculating the throughput per second of each message queue includes: calculating the throughput per second of the target product based on the total throughput of the target product messages within the statistical time and the statistical duration; calculating the average throughput of each message queue in the target product based on the throughput per second of the target product and the current number of message queues of the target product; and setting the average throughput as the throughput per second of each message queue.

[0019] According to a fifth aspect of the present disclosure, a message processing device is provided, which is applied to a producer server, and the device includes: an allocation module, which is used to: in response to user login, randomly allocate a producer server node to the user and establish a long link, wherein the user includes a first user and a second user, and the first user and the second user establish a long link with the first producer server node and the second producer server node respectively; a storage module, which is used to: store the link information between the first user and the first producer server node and the link information between the second user and the second producer server node in a target database; a business processing module, which is used to: in response to the first user sending a message, use the first producer server node to perform business processing on the message, and distribute the message to a designated message queue according to preset rules; a link information return module, which is used to: based on the consumer server listening to the designated message queue and querying the target database, obtain the target link information returned by the consumer server; and a message sending module, which is used to: based on the target link information, use the second producer server node to send the message to the second user.

[0020] In an embodiment of the present disclosure, the business processing module can also be used to divide the chat rooms of the first user and the second user into queue groups according to product types, wherein each product queue group contains at least one message queue; and randomly distribute the chat room messages to the message queues of the corresponding products.

[0021] In an embodiment of the present disclosure, the business processing module can also be used to determine the message sending authority of the first user; in response to the first user having the message sending authority, verify the sensitive information of the message content; and desensitize the detected sensitive information.

[0022] In an embodiment of the present disclosure, the business processing module can also be used to query the list of the second user and determine the online status of the second user; if the second user is online, distribute the message to the corresponding message queue; and if the second user is offline, send an offline notification to the second user through a third-party channel.

[0023] According to a sixth aspect of the present disclosure, a message processing device is provided, which is applied to a consumer server, and the device includes: a monitoring module, which is used to monitor at least one message queue; a second user determination module, which is used to determine a second user who needs to receive the message according to the content of the message in response to monitoring a message in the message queue; a link information acquisition module, which is used to obtain link information of a second producer server node that establishes a long link with the second user from a target database; and a notification module, which is used to notify the second producer server node based on the link information, so that the second producer server node sends the message to the second user.

[0024] According to the seventh aspect of the present disclosure, a message management device is provided, which is applied to a message server, and the device includes: a message queue configuration module, which is used to configure at least one message queue for each product, and the message queue is used to store messages sent by the producer server and deliver the messages to the consumer server; a monitoring module, which is used to monitor the busyness of each message queue at a predetermined time interval; and a management module, which is used to manage the number of message queues and resource allocation based on the comparison result of the busyness of the message queue and a preset threshold.

[0025] In an embodiment of the present disclosure, the management module can also be used to determine the corresponding first product in response to the throughput of a certain message queue reaching a first predetermined value M1, and increase the number of message queues of the first product; and to determine the corresponding second product in response to the throughput of a certain message queue being lower than a second predetermined value M2, and reduce the number of message queues of the second product.

[0026] In an embodiment of the present disclosure, the management module may also be configured to allocate an idle message queue of the second product to the first product.

[0027] In an embodiment of the present disclosure, the management module may also be configured to create a new message queue and append it to the queue group of the first product if the quantity of the second product is equal to 0 and the quantity of the first product is greater than or equal to 1.

[0028] In an embodiment of the present disclosure, the management module may also be used to set a first predetermined value M1 and a second predetermined value M2 according to the throughput per second of each message queue.

[0029] According to an eighth aspect of the present disclosure, a message processing system is provided, the system comprising a producer server, a consumer server and a message server, the producer server being used for: in response to a user login, randomly assigning a producer server node to the user and establishing a long link, wherein the user comprises a first user and a second user, the first user and the second user respectively establish a long link with a first producer server node and a second producer server node; the first producer server node stores the link information established with the first user in a target database, and the second producer server node stores the link information established with the second user in the target database; in response to the first user sending a message, performing business processing on the message using the first producer server node, and distributing the message to a designated message queue according to preset rules; based on the consumer server The target link information returned by the producer server is used to send the message to the second user using the second producer server node; the consumer server is used to: monitor the specified message queue; in response to monitoring the message in the specified message queue, determine the second user who needs to receive the message according to the content of the message; obtain the target link information of the second producer server node that establishes a long link with the second user from the target database; notify the second producer server node of the target link information; the message server is used to: configure at least one message queue for each product, the message queue is used to store the messages sent by the producer server and pass the messages to the consumer server; monitor the busyness of each message queue at a predetermined time interval; manage the number of message queues and resource allocation based on the comparison result of the busyness of the message queue and the preset threshold.

[0030] A ninth aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.

[0031] The tenth aspect of the present disclosure also provides a computer-readable storage medium on which a computer program or instruction is stored, and the steps of the above method are implemented when the above computer program or instruction is executed by a processor.

[0032] The eleventh aspect of the present disclosure further provides a computer program product, comprising a computer program or instructions, which implement the steps of the above method when the computer program or instructions are executed by a processor.

[0033] According to the embodiments of the present disclosure, by reasonably designing the interaction process between the producer server, consumer server, message queue and database, efficient processing, reliable delivery, flexible expansion and accurate push of messages are achieved, which brings a good experience to users and improves the overall performance and resource utilization of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The above contents 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:

[0035] Figure 1A The application scenario diagram schematically shows the message processing and management method, apparatus, device, medium and program product according to the embodiments of the present disclosure;

[0036] Figure 1B A schematic diagram schematically shows a message processing system according to an embodiment of the present disclosure;

[0037] Figure 2 A flowchart of a message processing method applied to a producer server according to an embodiment of the present disclosure is schematically shown;

[0038] Figure 3 A flowchart of a message processing method applied to a consumer server according to an embodiment of the present disclosure is schematically shown;

[0039] Figure 4 A flowchart of a message processing method applied to a producer server and a consumer server according to an embodiment of the present disclosure is schematically shown;

[0040] Figure 5 The flowchart of the message management method according to the embodiment of the present disclosure is schematically shown;

[0041] Figure 6 A structural block diagram of a message processing device applied to a producer server according to an embodiment of the present disclosure is schematically shown;

[0042] Figure 7 A structural block diagram schematically shows a message processing device applied to a consumer server according to an embodiment of the present disclosure;

[0043] Figure 8 A structural block diagram of a message management device according to an embodiment of the present disclosure is schematically shown; and

[0044] Fig. 9 A block diagram of an electronic device suitable for implementing a message processing and management method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0045] 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.

[0046] 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.

[0047] 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.

[0048] 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.).

[0049] With the rapid development of the Internet, online services have become a major trend. Among online services, chat room services, especially those provided through browsers, have gradually become a common way for customers to communicate and interact. Chat room services provide a convenient means of communication in business links such as customer marketing, solution design, enterprise docking, and online deployment, thereby supporting the smooth development of various corporate activities.

[0050] Existing online service systems usually provide customers with support services covering the entire process of pre-sales, sales, and after-sales, covering product consultation, docking and joint debugging, online verification, production operation and maintenance and other functions. These systems provide customers with one-stop support materials such as "what you see is what you get" sample code, customized test parameters, process docking guidance, and full-scenario joint debugging tools. They also have online Q&A services, which significantly improve the quality and efficiency of customer service support. These support services are usually provided through multi-channel Internet service systems on PC and mobile terminals to meet the diverse needs of customers. At the same time, the system will also be connected to the company's internal application system to achieve internal and external collaborative operations and meet the needs of multi-party online collaboration.

[0051] In the current chat room service system, by automatically establishing groups based on project establishment information, multiple customer groups can communicate online in the same project group. In order to ensure the security of group information, the system will strictly control group members and implement the filtering function for sensitive information. This sensitive information includes politically sensitive content, personal information, and customer accounts. The system screens the information through the self-developed sensitive information filtering function and blocks customer information for some members, thereby expanding the scope of service support and enhancing information security.

[0052] Existing work chat room services usually support two text chat modes: one-to-one and many-to-many, which are used to provide customers with online problem analysis and answers. However, when a customer opens a chat room page, the server will establish a real-time connection for each page. If the same user opens N chat room pages on multiple devices and multiple channels, N independent real-time connections will be established. Since network sessions are required between users, these real-time connections must maintain synchronous message processing to ensure that all devices can receive messages at the same time.

[0053] In actual applications, the system needs to process and distribute each message in the distributed background, which makes the message processing process complicated. Since there are many service nodes and the real-time connections of users are distributed on different server nodes, each node will consume the message, resulting in the same message being consumed repeatedly by all server nodes. This repeated consumption will significantly increase the load on the server, especially when the number of users and the amount of online messages are growing rapidly, which will put great pressure on the server nodes. In order to cope with this load pressure, the system needs to continuously add server nodes, which not only increases the complexity of system operation and maintenance, but also leads to a large waste of resources.

[0054] Based on this, an embodiment of the present disclosure provides a message processing method, the method comprising: in response to user login, the producer server randomly assigns a producer server node to the user and establishes a long link, wherein the user comprises a first user and a second user, and the first user and the second user respectively establish long links with the first producer server node and the second producer server node; the first producer server node stores the link information established with the first user in a target database, and the second producer server node stores the link information established with the second user in the target database; in response to the first user sending a message, the first producer server node is used to perform business processing on the message, and the message is distributed to a designated message queue according to a preset rule; based on the consumer server monitoring the designated message queue; in response to the consumer server monitoring the message in the designated message queue, the second user who needs to receive the message is determined according to the content of the message; the target link information of the second producer server node that establishes a long link with the second user is obtained from the target database; the consumer server notifies the second producer server node of the target link information; and based on the target link information, the second producer server node is used to send the message to the second user. The message processing method provided by the present invention realizes efficient processing, reliable delivery, flexible expansion and accurate push of messages by reasonably designing the interaction process between producer servers, consumer servers, message queues and databases, which brings a good experience to users and improves the overall performance and resource utilization of the system.

[0055] In addition, an embodiment of the present disclosure also provides a message management method, which is applied to a message server, and the method includes: configuring at least one message queue for each product, the message queue is used to store messages sent by the producer server and deliver messages to the consumer server; monitoring the busyness of each message queue at a predetermined time interval; managing the number of message queues and resource allocation based on the comparison result of the busyness of the message queue and the preset threshold. By configuring message queues in the message server, monitoring throughput, and dynamically managing queues and resources based on actual load conditions, efficient scheduling and management of message queues are achieved; by monitoring throughput according to predetermined time intervals and dynamically adjusting the number of queues, resources can be automatically increased or decreased according to the actual workload, thereby optimizing the utilization of computing resources, reducing performance bottlenecks at high loads and resource waste at low loads, thereby improving the overall resource allocation efficiency of the system, and further improving the computing performance and stability of the system.

[0056] It should be noted that the message processing and management methods, devices, electronic devices, media, and program products determined in the present disclosure can be used in the fields of cloud computing technology and distributed technology, can also be used in the fields of financial technology, and can also be used in a variety of fields other than the fields of cloud computing technology, distributed technology, and financial technology. The application fields of the message processing and management methods, devices, equipment, media, and program products provided by the embodiments of the present disclosure are not limited.

[0057] In the technical solution of the present disclosure, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0058] In the scenario of using personal information for automated decision-making, the methods, devices, and systems provided by the embodiments of the present disclosure provide users with corresponding operation portals for users to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered. The expression "automated decision-making" here refers to the activity of automatically analyzing and evaluating a person's behavioral habits, interests and hobbies, or economic, health, credit status, etc. through computer programs, and making decisions. The expression "expert decision-making" here refers to the activity of making decisions by people who specialize in a certain field, have specialized experience, knowledge and skills, and have reached a certain level of professionalism.

[0059] Figure 1A An application scenario diagram of the message processing and management method, apparatus, device, medium, and program product according to an embodiment of the present disclosure is schematically shown.

[0060] like Figure 1A As shown, the application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104 and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc. The server 105 may include a producer server, a consumer server and / or a message server.

[0061] The user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).

[0062] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0063] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 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.

[0064] It should be noted that the message processing method (or message management method) provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the message processing device (or message management device) provided in the embodiment of the present disclosure can generally be set in the server 105. The message processing method (or message management method) provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the message processing device (or message management device) provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.

[0065] It should be understood that Figure 1A The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0066] Figure 1B A schematic diagram of a message processing system according to an embodiment of the present disclosure is schematically shown.

[0067] like Figure 1BAs shown, the message processing system may include three parts: producer server, consumer server and message server. Each part undertakes specific tasks and realizes the production, storage, distribution, consumption and delivery of messages through collaborative cooperation.

[0068] Specifically, when a user logs in to the system through multiple channels, the system will randomly assign a producer server node (producer server A, producer server B, etc.) to the user and establish a long link with the user. This process involves the connection of multiple users and multiple producer nodes. The system achieves load balancing by randomly assigning producer server nodes to avoid overloading of a certain node. After establishing a long link with the user, the producer server node can store the link information in the target database (such as Figure 1B Non-relational database shown).

[0069] When the first user (represented as the user sending the message) sends a message, the producer server node first processes the message. The processed message will be distributed to the specified message queue according to the preset rules.

[0070] The message queue is managed by the message server. Different messages are assigned to different queue groups according to product types (such as queue groups for products A, B, and C). Each queue group contains multiple message queues. This design ensures that the system processes messages of different products independently, improving the flexibility and scalability of the system.

[0071] The consumer server monitors the designated message queue managed by the message server to ensure that it can receive the message sent by the producer server in a timely manner. Once the message in the message queue is monitored, the consumer server will determine the second user (represented as the recipient of the message) based on the content of the message. After determining the second user, the consumer server will query the target database to obtain the target link information of the producer server node that has established a long link with the second user.

[0072] Among them, the consumer server is not a single server, but a server cluster composed of multiple consumer server nodes (consumer server A, consumer server B...), each of which can independently process messages from the message queue. For the same message queue, there may be multiple consumer server nodes responsible for monitoring, but in order to ensure that the message is not consumed repeatedly, each message in the system will only be processed once by one consumer server node. Specifically, each consumer node can determine which node processes which message through the distributed scheduling mechanism of the message queue. For example, when a new message arrives in the message queue, the consumer server cluster will use coordination mechanisms such as polling mechanism, priority mechanism or workload balancing mechanism to decide which consumer server node will process the message.

[0073] After the consumer server obtains the target link information, it will notify the corresponding producer server node and use the second producer server node to send the message to the second user. In this way, through the cooperation of the producer server and the consumer server, real-time push and efficient delivery of messages can be achieved.

[0074] The following will be based on Figure 1A and Figure 1B The scene described by Figure 2~Figure 4 The message processing method of the disclosed embodiment is described in detail.

[0075] Figure 2 The flowchart of the message processing method applied to the producer server according to the embodiment of the present disclosure is schematically shown.

[0076] like Figure 2 As shown, the message processing method of this embodiment includes operations S210 to S250, and the message processing method can be executed by a producer server.

[0077] In operation S210, in response to a user logging in, a producer server node is randomly assigned to the user and a long link is established, wherein the user includes a first user and a second user, and the first user and the second user establish link information with the first producer server node and the second producer server node, respectively.

[0078] In the embodiments of the present disclosure, the random allocation mechanism is to achieve load balancing of user connections, so that system resources can be reasonably allocated to avoid overloading of a single server node under high concurrent requests. The random allocation mechanism can also improve the high availability of the system. Even if a server node is unavailable due to a failure, other nodes can take over the connection request of the new user, thereby ensuring the smooth operation of the entire system, especially in the scenario of large-scale user login.

[0079] In operation S220, the first producer server node stores the link information established with the first user in the target database, and the second producer server node stores the link information established with the second user in the target database.

[0080] After establishing a long link with the user, the producer server node can store the link information in the target database so that the association information between the user and the producer server node can be quickly queried, facilitating the subsequent message processing and delivery. This is crucial for subsequent message processing and message routing, especially in multi-node and multi-user scenarios. Through this centralized storage solution, cross-server user data sharing and fast access can be achieved.

[0081] In an embodiment of the present disclosure, the target database may include a non-relational database. The non-relational database has the ability to quickly read and store, and can efficiently access the association information between the user and the producer server node. Therefore, by using a non-relational database to store the link information between the user and the server node, it is convenient to quickly find the link information across servers in the subsequent message processing and transmission process.

[0082] In the embodiments of the present disclosure, the link information between the user and the server can be recorded in a non-relational database in a key-value pair format, so that when it is necessary to query the connection status of a certain user or the link information with a certain node, the corresponding data can be quickly located and read. For example, KEY can include the IP address of the login node and the unique identifier of the user to ensure that each user's long connection can be uniquely identified; VALUE can be a collection of multiple sessions established by the user on the node.

[0083] In operation S230, in response to the first user sending a message, the first producer server node is used to perform business processing on the message, and the message is distributed to a designated message queue according to a preset rule.

[0084] In the embodiment of the present disclosure, during the processing, in order to ensure security, it can be first determined whether the first user has the authority to send messages in the current chat room. If the user does not have the authority, the message will not be processed and sent, and the system will return relevant prompt information.

[0085] If the user has permission, the system can further verify the sensitive information of the message content, which may include the user's mobile phone number, ID number, financial information, etc. After detecting sensitive information, the information can be desensitized to ensure the security and privacy of the message content.

[0086] In an embodiment of the present disclosure, the message includes a chat room message. The message can be distributed to a corresponding consumption queue according to a channel rule. The channel rule includes: dividing the user's chat room into different queue groups according to different product types, and each product queue group contains at least one message queue; then, the chat room message can be randomly distributed to multiple message queues under the corresponding product to achieve load balancing and efficient message processing.

[0087] It should be noted that the chat room refers to a work chat room that supports both one-to-one and many-to-many modes, so that customers and support personnel can communicate online. Limiting the message to a chat room message here does not mean that the application scenario of the embodiment of the present disclosure is limited to the processing of chat room messages. In fact, the embodiment of the present disclosure can also be widely used in order management, IoT device management, social media notifications, collaborative office, video live broadcast, logistics tracking, automated task scheduling, advertising push, alarm system and other message processing scenarios, that is, the message type of the embodiment of the present disclosure should not be limited.

[0088] Furthermore, during the message service processing, the status of the second user can also be judged to determine the method of sending the message. Specifically, the second user's list is first queried to obtain a list of users who need to receive the message; then the online status of the second user is judged. If the second user is online, the system directly inserts the message into the corresponding message queue to achieve real-time message sending; if the second user is offline, the second user can be notified offline through a third-party channel (such as SMS, email or push notification) to remind the user that there is a new message to be received.

[0089] In operation S240, based on the consumer server monitoring the designated message queue and querying the target database, the target link information returned by the consumer server is obtained.

[0090] In operation S250, based on the target link information, the second producer server node sends the message to the second user. The second producer server node can directly send the message to the second user device using the long link with the second user according to the link information.

[0091] According to the embodiments of the present invention, efficient message delivery and business processing are achieved through the collaborative work between producer servers, consumer servers, and message servers. Specifically, by randomly assigning producer server nodes to establish long connections for users, load balancing and high availability are achieved; link information is stored in a non-relational database, which can be quickly queried and shared; and the security and privacy of messages are ensured through permission verification, sensitive information verification, and desensitization of message content. In addition, the message processing and sending process includes the judgment of the online status of the receiving user and the corresponding sending strategy, ensuring that the message can be effectively delivered when the user is online or offline.

[0092] Figure 3 The flowchart of the message processing method applied to the consumer server according to the embodiment of the present disclosure is schematically shown.

[0093] like Figure 3As shown, the message processing method of this embodiment includes operations S310 to S340, and the message processing method can be executed by a consumer server.

[0094] In operation S310, at least one message queue is monitored.

[0095] In operation S320, in response to monitoring the message in the message queue, a second user who needs to receive the message is determined according to the content of the message. In this scenario, the content of the message may include information such as the sender user information, the recipient user information, the message type, and the user priority.

[0096] Further, according to the content of the message and the message receiving authority of the second user, the consumer server can adjust the content of the message received by the second user. For example, the consumer server can check the receiving authority of the second user to determine whether the user can view all or part of the content of the message.

[0097] Specifically, for users with lower permissions, some sensitive content needs to be hidden or desensitized, and only users with higher permissions can view the complete information. In this embodiment, implementing permission control can not only ensure the appropriateness of users receiving messages, but also ensure the security of user data, prevent unauthorized information leakage, and enhance the privacy protection capability of the system.

[0098] In operation S330, link information of a second producer server node that establishes a long link with the second user is obtained from the target database.

[0099] In operation S340, the second producer server node is notified based on the link information, so that the second producer server node sends a message to the second user.

[0100] It should be noted that the consumer server can be a cluster composed of multiple nodes, each of which has the ability to process the message queue from the message server, that is, each node can perform operations S310 to S340. In order to ensure that each message in the message queue will only be consumed by one consumer node and will not be consumed repeatedly, the nodes of the consumer server can adopt some marking mechanisms when processing messages. For example, when a consumer server node successfully consumes a message in the queue, the node can identify the consumption status and notify the message server, marking the message as processed. For example, when a consumer node starts to consume a message, the message can be locked so that other nodes cannot access the message until the message is processed. For example, after successfully consuming and processing the message, the consumer server can send a confirmation response (ACK) to the message server to inform that the message has been successfully processed and can be removed from the queue.

[0101] According to the embodiments of the present disclosure, the consumer server completes the message delivery by monitoring the message queue, analyzing the message content, querying the user's connection information, and notifying the producer server node, thereby ensuring the efficient and accurate delivery of messages from the producer to the target user. Through the linkage and long link mechanism of the target database between each step, rapid data search and real-time message push are achieved. In particular, by adjusting the message content and controlling the receiving authority, the privacy protection and security management of the user are emphasized during the message delivery process, ensuring the appropriate delivery of the message.

[0102] Figure 4 The flowchart of the message processing method applied to the producer server and the consumer server according to the embodiment of the present disclosure is schematically shown.

[0103] like Figure 4 As shown, the message processing method of this embodiment includes operations S410 to S480, and the message processing method can be executed by a producer server and a consumer server.

[0104] In operation S410, in response to a user logging in, the producer server randomly assigns a producer server node to the user and establishes a long link, wherein the user includes a first user and a second user, and the first user and the second user establish long links with the first producer server node and the second producer server node, respectively.

[0105] In operation S420, the first producer server node stores the link information established with the first user in the target database, and the second producer server node stores the link information established with the second user in the target database.

[0106] In operation S430, in response to the first user sending a message, the first producer server node is used to perform business processing on the message, and the message is distributed to a designated message queue according to a preset rule.

[0107] In operation S440, the consumer server monitors a designated message queue.

[0108] In operation S450, in response to the consumer server monitoring a message in a designated message queue, a second user who needs to receive the message is determined according to the content of the message.

[0109] In operation S460, target link information of the second producer server node that establishes a long link with the second user is obtained from the target database.

[0110] In operation S470, the consumer server notifies the second producer server node of the target link information.

[0111] In operation S480, based on the target link information, a message is sent to a second user using the second producer server node.

[0112] According to an embodiment of the present invention, the entire message processing process constructs an efficient, real-time and reliable message delivery method through the collaboration of the producer server, the consumer server, the message queue and the target database. In the user login stage, load balancing is achieved by randomly allocating server nodes, and the user connection information is stored in the target database to ensure the efficiency of subsequent message processing; in the message processing stage, the producer server distributes the message to the corresponding message queue after business processing, and the consumer server finally realizes the accurate delivery of the message by monitoring the queue and combining the information of the target database. The whole process makes full use of the long connection mechanism, distributed storage and queue management to ensure stability and efficiency under high concurrency, while providing users with a good user experience.

[0113] Figure 5 The flowchart of the message management method according to the embodiment of the present disclosure is schematically shown.

[0114] like Figure 5 As shown, the message management method of this embodiment includes operations S510 to S530, and the message management method can be executed by a message server.

[0115] In operation S510, the message server configures at least one message queue for each product. These message queues are used to store messages sent by the producer server and pass these messages to the consumer server for further processing.

[0116] In this embodiment, different products are assigned to different queue groups, and each queue group contains at least one message queue. By configuring an independent message queue for each product, targeted message processing and delivery can be achieved according to the needs of different products, effectively preventing messages between different products from interfering with each other, and improving the processing flexibility and scalability of the system.

[0117] In operation S520, the busyness of each message queue is monitored at predetermined time intervals.

[0118] In operation S530, the number of message queues and resource allocation are managed based on a comparison result of the busyness of the message queues and a preset threshold.

[0119] In an embodiment of the present disclosure, the busyness can be determined and managed based on the throughput of the message queue. Specifically, in response to the throughput of a certain message queue reaching a first predetermined value M1, the corresponding first product is determined, and the number of message queues of the first product is increased; and in response to the throughput of a certain message queue being lower than a second predetermined value M2, the corresponding second product is determined, and the number of message queues of the second product is reduced.

[0120] According to this embodiment, the dynamic management mechanism can ensure rapid response under high load conditions and increase resource allocation to adapt to increased business needs; under low load conditions, it can also optimize resource usage and avoid unnecessary waste.

[0121] Furthermore, in order to improve resource utilization, the idle message queue of the second product can be allocated to the first product. The resource reallocation mechanism can not only effectively utilize the idle resources in the system, but also avoid the overhead caused by the creation of new queues, thereby improving the efficiency of the system.

[0122] Furthermore, if the number of the second product is equal to 0 and the number of the first product is greater than or equal to 1, a new message queue is created and added to the queue group of the first product. That is, when there are no idle resources available in the system, this embodiment can flexibly meet business needs by adding new queues to ensure timely processing of messages, thereby improving the service capability and response speed of the system.

[0123] In order to effectively manage the number of message queues for each product, a first predetermined value M1 and a second predetermined value M2 may be set according to the throughput per second of each message queue. Specifically, based on the total throughput of target product messages within the statistical time and the statistical duration, the throughput per second of the target product is calculated; based on the throughput per second of the target product and the current number of message queues of the target product, the average throughput of each message queue in the target product is calculated; and the average throughput is set as the throughput per second of each message queue.

[0124] For example, after analysis and verification, the maximum throughput of a single queue per second is about 10,000 messages. Therefore, the first predetermined value M1 of a single node can be defined as 8000 (this value can be configured and adjusted according to specific business needs), and the second predetermined value M2 can be defined as 5000 (also a configurable value).

[0125] According to the embodiments of the present disclosure, an efficient message processing architecture is constructed through dynamic monitoring, elastic expansion and resource optimization management of message queues. The message server configures independent message queues in each product, regularly monitors the busyness of each queue, and increases or decreases the number of queues according to preset thresholds to adapt to the dynamic needs of the business. At the same time, optimal utilization of resources is achieved by reallocating idle queues and creating new queues when needed. These measures not only improve the processing capacity of the system under high load, but also avoid waste of resources under low load conditions, so that the system can maintain good operating status and stability under any load conditions.

[0126] Based on the above message processing method, the present disclosure also provides a message processing device, which is applied to a producer server. Figure 6 The device is described in detail.

[0127] Figure 6 The structural block diagram of a message processing device applied to a producer server according to an embodiment of the present disclosure is schematically shown.

[0128] like Figure 6 As shown, the message processing device 600 of this embodiment includes an allocation module 610 , a storage module 620 , a service processing module 630 , a link information returning module 640 and a message sending module 650 .

[0129] The allocation module 610 may be used to randomly allocate a producer server node to a user in response to a user login and establish a long link, wherein the user includes a first user and a second user, and the first user and the second user establish a long link with the first producer server node and the second producer server node, respectively. In one embodiment, the allocation module 610 may be used to perform the operation S210 described above, which will not be described in detail herein.

[0130] The storage module 620 can be used for the first producer server node to store the link information established with the first user in the target database, and the second producer server node to store the link information established with the second user in the target database. In one embodiment, the storage module 620 can be used to perform the operation S220 described above, which will not be repeated here.

[0131] The business processing module 630 can be used to respond to the first user sending a message, use the first producer server node to perform business processing on the message, and distribute the message to a specified message queue according to a preset rule. In one embodiment, the business processing module 630 can be used to perform the operation S230 described above, which will not be repeated here.

[0132] The link information return module 640 can be used to obtain the target link information returned by the consumer server based on the consumer server monitoring the specified message queue and querying the target database. In one embodiment, the link information return module 640 can be used to perform the operation S240 described above, which will not be repeated here.

[0133] The message sending module 650 may be used to send a message to the second user using the second producer server node based on the target link information. In one embodiment, the message sending module 650 may be used to perform the operation S250 described above, which will not be described in detail herein.

[0134] In an embodiment of the present disclosure, the business processing module 630 can also be used to divide the chat rooms of the first user and the second user into queue groups according to product types, wherein each product queue group contains at least one message queue; and randomly distribute the chat room messages to the message queues of the corresponding products.

[0135] In an embodiment of the present disclosure, the business processing module 630 can also be used to determine the message sending authority of the first user; in response to the first user having the message sending authority, verify the sensitive information of the message content; and desensitize the detected sensitive information.

[0136] In an embodiment of the present disclosure, the business processing module 630 can also be used to query the list of the second user and determine the online status of the second user; if the second user is online, distribute the message to the corresponding message queue; and if the second user is offline, provide the second user with an offline notification through a third-party channel.

[0137] According to an embodiment of the present disclosure, any multiple modules among the allocation module 610, the storage module 620, the service processing module 630, the link information return module 640 and the message sending module 650 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the allocation module 610, the storage module 620, the service processing module 630, the link information return module 640 and the message sending module 650 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 implemented in any one of the three implementation methods of software, hardware and firmware or in a proper combination of any of them. Alternatively, at least one of the allocation module 610, the storage module 620, the service processing module 630, the link information return module 640 and the message sending module 650 may be at least partially implemented as a computer program module, which may perform a corresponding function when executed.

[0138] Based on the above message processing method, the present disclosure also provides a message processing device, which is applied to a consumer server. Figure 7 The device is described in detail.

[0139] Figure 7 The structural block diagram of a message processing device applied to a consumer server according to an embodiment of the present disclosure is schematically shown.

[0140] like Figure 7 As shown, the message processing device 700 of this embodiment includes a monitoring module 710 , a second user determination module 720 , a link information acquisition module 730 , and a notification module 740 .

[0141] The monitoring module 710 may be used to monitor at least one message queue. In one embodiment, the monitoring module 710 may be used to perform the operation S310 described above, which will not be described in detail herein.

[0142] The second user determination module 720 may be used to determine the second user who needs to receive the message according to the content of the message in response to monitoring the message in the message queue. In one embodiment, the second user determination module 720 may be used to perform the operation S320 described above, which will not be repeated here.

[0143] The link information acquisition module 730 may be used to acquire link information of the second producer server node that has established a long link with the second user from the target database. In one embodiment, the link information acquisition module 730 may be used to perform the operation S330 described above, which will not be described in detail here.

[0144] The notification module 740 may be used to notify the second producer server node based on the link information so that the second producer server node sends a message to the second user. In one embodiment, the notification module 740 may be used to perform the operation S340 described above, which will not be described in detail here.

[0145] According to an embodiment of the present disclosure, any multiple modules of the monitoring module 710, the second user determination module 720, the link information acquisition module 730, and the notification module 740 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the monitoring module 710, the second user determination module 720, the link information acquisition module 730, and the notification module 740 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 implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, at least one of the monitoring module 710 , the second user determination module 720 , the link information acquisition module 730 , and the notification module 740 may be at least partially implemented as a computer program module, and when the computer program module is executed, a corresponding function may be executed.

[0146] Based on the above message management method, the present disclosure also provides a message management device, which is applied to a message server. Figure 8 The device is described in detail.

[0147] Figure 8 The structural block diagram of the message management device according to the embodiment of the present disclosure is schematically shown.

[0148] like Figure 8 As shown, the message management device 800 of this embodiment includes a message queue configuration module 810 , a monitoring module 820 , and a management module 830 .

[0149] The message queue configuration module 810 can be used to configure at least one message queue for each product, and the message queue is used to store messages sent by the producer server and pass the messages to the consumer server. In one embodiment, the message queue configuration module 810 can be used to perform the operation S510 described above, which will not be repeated here.

[0150] The monitoring module 820 may be used to monitor the busyness of each message queue at a predetermined time interval. In one embodiment, the monitoring module 820 may be used to perform the operation S520 described above, which will not be described in detail herein.

[0151] The management module 830 may be used to manage the number of message queues and resource allocation based on the comparison result between the busyness of the message queues and the preset threshold. In one embodiment, the management module 830 may be used to perform the operation S530 described above, which will not be described in detail here.

[0152] In an embodiment of the present disclosure, the management module 830 can also be used to determine the corresponding first product in response to the throughput of a certain message queue reaching a first predetermined value M1, and increase the number of message queues of the first product; and to determine the corresponding second product in response to the throughput of a certain message queue being lower than a second predetermined value M2, and reduce the number of message queues of the second product.

[0153] In an embodiment of the present disclosure, the management module 830 may also be configured to allocate an idle message queue of the second product to the first product.

[0154] In an embodiment of the present disclosure, the management module 830 may also be used to create a new message queue and append it to the queue group of the first product if the quantity of the second product is equal to 0 and the quantity of the first product is greater than or equal to 1.

[0155] In an embodiment of the present disclosure, the management module 830 may also be used to set a first predetermined value M1 and a second predetermined value M2 according to the throughput per second of each message queue.

[0156] According to an embodiment of the present disclosure, any multiple modules of the message queue configuration module 810, the monitoring module 820, and the management module 830 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the message queue configuration module 810, the monitoring module 820, and the management module 830 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 implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, at least one of the message queue configuration module 810, the monitoring module 820, and the management module 830 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.

[0157] Fig. 9 A block diagram of an electronic device suitable for implementing a message processing and management method according to an embodiment of the present disclosure is schematically shown.

[0158] like Fig. 9 As shown, the electronic device 900 according to an embodiment of the present disclosure includes a processor 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage part 908 to a random access memory (RAM) 903. The processor 901 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a dedicated microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 901 may also include an onboard memory for caching purposes. The processor 901 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.

[0159] In RAM 903, various programs and data required for the operation of electronic device 900 are stored. Processor 901, ROM 902 and RAM 903 are connected to each other via bus 904. Processor 901 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 902 and / or RAM 903. It should be noted that the program can also be stored in one or more memories other than ROM 902 and RAM 903. Processor 901 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.

[0160] According to an embodiment of the present disclosure, the electronic device 900 may further include an input / output (I / O) interface 905, which is also connected to the bus 904. The electronic device 900 may further include one or more of the following components connected to the input / output (I / O) interface 905: an input portion 906 including a keyboard, a mouse, etc.; an output portion 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 908 including a hard disk, etc.; and a communication portion 909 including a network interface card such as a LAN card, a modem, etc. The communication portion 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the input / output (I / O) interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that a computer program read therefrom is installed into the storage portion 908 as needed.

[0161] 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.

[0162] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, 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, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 902 and / or RAM 903 described above and / or one or more memories other than ROM 902 and RAM 903.

[0163] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the message processing method provided by the embodiment of the present disclosure.

[0164] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 901. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0165] In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of a signal on a network medium, and downloaded and installed through the communication part 909, and / or installed from a removable medium 911. 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.

[0166] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the processor 901, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.

[0167] 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).

[0168] The flow charts 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 flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order 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 flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0169] It will be appreciated by those skilled in the art that the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations or combinations are not explicitly described in the present disclosure. In particular, without departing from the spirit and teachings of the present disclosure, the features described in the various embodiments 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.

[0170] 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, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. 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, applied to a producer server, characterized in that: The method comprises: In response to a user logging in, randomly assigning a producer server node to the user and establishing a long link, wherein the user includes a first user and a second user, and the first user and the second user establish link information with the first producer server node and the second producer server node respectively; The first producer server node stores the link information established with the first user in the target database, and the second producer server node stores the link information established with the second user in the target database; In response to the first user sending a message, using the first producer server node to perform business processing on the message, and distributing the message to a designated message queue according to a preset rule; Based on the consumer server monitoring the designated message queue and querying the target database, obtaining the target link information returned by the consumer server; and Based on the target link information, the message is sent to the second user using the second producer server node.

2. The method according to claim 1, characterized in that Messages include chat room messages and preset rules for message distribution, including: Dividing the chat rooms of the first user and the second user into queue groups according to product types, wherein each product queue group includes at least one message queue; and The chat room messages are randomly distributed to the message queues of the corresponding products.

3. The method according to claim 1 or 2, characterized in that: The using the first producer server node to perform business processing on the message specifically includes: Determining the message sending authority of the first user; In response to the first user having the message sending authority, performing sensitive information verification on the content of the message; and Desensitize the detected sensitive information.

4. The message processing method according to claim 3, characterized in that: The producer server node further performs business processing on the message including: querying the second user's list to determine the second user's online status; If the second user is online, the message is distributed to the corresponding message queue; and If the second user is offline, the second user is notified of an offline condition through a third-party channel.

5. The message processing method according to any one of claims 1 to 2 and 4, characterized in that: The target database includes a non-relational database, and the link information is recorded in the non-relational database in a key-value pair format.

6. A message processing method, applied to a consumer server, characterized in that: The method comprises: Monitor at least one message queue; In response to monitoring a message in the message queue, determining a second user who needs to receive the message according to the content of the message; Acquire link information of a second producer server node that establishes a long link with a second user from the target database; and The second producer server node is notified based on the link information so that the second producer server node sends a message to a second user.

7. The method according to claim 6, characterized in that The method further comprises: The content of the message received by the second user is adjusted according to the content of the message and the message receiving authority of the second user.

8. A message processing method, applied to a producer server and a consumer server, characterized in that: The method comprises: In response to a user logging in, the producer server randomly assigns a producer server node to the user and establishes a long link, wherein the user includes a first user and a second user, and the first user and the second user establish long links with the first producer server node and the second producer server node respectively; The first producer server node stores the link information established with the first user in the target database, and the second producer server node stores the link information established with the second user in the target database; In response to the first user sending a message, using the first producer server node to perform business processing on the message, and distributing the message to a designated message queue according to a preset rule; Based on the consumer server monitoring a specified message queue; In response to the consumer server monitoring a message in a designated message queue, determining a second user who needs to receive the message according to the content of the message; Acquire target link information of a second producer server node that establishes a long link with a second user from a target database; The consumer server notifies the second producer server node of the target link information; and Based on the target link information, the message is sent to the second user using the second producer server node.

9. A message management method, applied to a message server, characterized in that: The method comprises: At least one message queue is configured for each product, and the message queue is used to store messages sent by the producer server and to deliver the messages to the consumer server; Monitor the busyness of each message queue at predetermined intervals; Based on the comparison between the busyness of the message queue and the preset threshold, the number of message queues and resource allocation are managed.

10. The method according to claim 9, characterized in that The management of the number of message queues and resource allocation based on the comparison result between the busyness of the message queues and the preset threshold value specifically includes: In response to the throughput of a certain message queue reaching a first predetermined value M1, determining a corresponding first product, and increasing the number of message queues of the first product; and In response to the throughput of a certain message queue being lower than a second predetermined value M2, a corresponding second product is determined, and the number of message queues of the second product is reduced.

11. The method according to claim 10, characterized in that The method further comprises: Allocate the idle message queue of the second product to the first product.

12. The method according to claim 10, characterized in that The method further comprises: If the quantity of the second product is equal to 0 and the quantity of the first product is greater than or equal to 1, a new message queue is created and appended to the queue group of the first product.

13. The method according to claim 10, characterized in that According to the throughput per second of each message queue, a first predetermined value M1 and a second predetermined value M2 are set.

14. The method according to claim 13, characterized in that The method for calculating the throughput per second of each message queue includes: Calculate the throughput per second of the target product based on the total throughput of the target product messages within the statistical period and the statistical duration; Calculate the average throughput of each message queue in the target product based on the throughput per second of the target product and the current number of message queues of the target product; and The average throughput is set as the throughput per second of each message queue.

15. A message processing device, applied to a producer server, characterized in that: The device comprises: An allocation module, used for: in response to a user login, randomly allocating a producer server node to the user and establishing a long link, wherein the user includes a first user and a second user, and the first user and the second user respectively establish a long link with the first producer server node and the second producer server node; A storage module, used for: the first producer server node stores the link information established with the first user in a target database, and the second producer server node stores the link information established with the second user in a target database; A business processing module, used to: in response to a message sent by a first user, perform business processing on the message using the first producer server node, and distribute the message to a designated message queue according to a preset rule; A link information returning module, used to: acquire the target link information returned by the consumer server based on the consumer server monitoring the designated message queue and querying the target database; and A message sending module is used to: based on the target link information, use the second producer server node to send the message to the second user.

16. A message processing device, applied to a consumer server, characterized in that: The device comprises: A monitoring module, used to: monitor at least one message queue; A second user determination module is used to: in response to monitoring a message in the message queue, determine a second user who needs to receive the message according to the content of the message; A link information acquisition module, used to: acquire link information of a second producer server node that establishes a long link with a second user from a target database; A notification module is used to: notify the second producer server node based on the link information, so that the second producer server node sends a message to the second user.

17. A message management device, applied to a message server, characterized in that: The device comprises: A message queue configuration module, used to: configure at least one message queue for each product, wherein the message queue is used to store messages sent by the producer server and to deliver the messages to the consumer server; A monitoring module, used to: monitor the busyness of each message queue at a predetermined time interval; The management module is used to manage the number of message queues and resource allocation based on the comparison result between the busyness of the message queues and the preset threshold.

18. A message processing system, characterized in that: The system includes a producer server, a consumer server and a message server. The producer server is used to: in response to a user login, randomly assign a producer server node to the user and establish a long link, wherein the users include a first user and a second user, and the first user and the second user respectively establish long links with a first producer server node and a second producer server node; the first producer server node stores the link information established with the first user in a target database, and the second producer server node stores the link information established with the second user in a target database; in response to the first user sending a message, use the first producer server node to perform business processing on the message, and distribute the message to a designated message queue according to preset rules; based on the target link information returned by the consumer server, use the second producer server node to send the message to the second user; The consumer server is used to: monitor a designated message queue; in response to monitoring a message in the designated message queue, determine a second user who needs to receive the message according to the content of the message; obtain target link information of a second producer server node that establishes a long link with the second user from a target database; and notify the second producer server node of the target link information; The message server is used to: configure at least one message queue for each product, the message queue is used to store messages sent by the producer server and deliver messages to the consumer server; monitor the busyness of each message queue at predetermined time intervals; and manage the number of message queues and resource allocation based on the comparison result of the busyness of the message queue and the preset threshold.

19. An electronic device comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 14.

20. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 14 are implemented.

21. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 14 are implemented.