Enterprise group message flow limiting method and device, equipment and storage medium
By using the combination of long connection gateway and token bucket algorithms in enterprise groups, we can judge and process the message body, and solve the blocking and delay problems caused by message storms, ensuring priority processing of messages for important users and limiting the flow of other messages, improving the improvement of User experience.
Patent Information
- Application Number
- CN202311750940.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-19
- Publication Date
- 2024-11-15
AI Technical Summary
In large enterprise groups, message storms lead to information blockage, loss and delay, especially in groups of more than 1,000 or even 10,000 people. The high-frequency transmission of red envelope messages and expression messages brings huge communication burden to the system. .
Receive the client message body through a long connection gateway and send it to the message forwarding service. According to the user ID, whether the message body is a priority message body. If so, it will be processed directly. Otherwise, use the token bucket algorithm to decide whether to process the message to avoid the message Overload.
It effectively avoids message blocking, loss and delay, ensures that the messages of important users are processed first, and at the same time, limits other messages through the token bucket algorithm, improving the user experience.
Smart Images

Figure CN118972331A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of instant messaging, and in particular to a method, device, equipment and storage medium for limiting the flow of enterprise group messages. Background Art
[0002] With the development of enterprise IM (Instant Messaging), the number of employees in some large enterprises has increased to tens of thousands. During the work process, the communication needs of employees have also increased linearly. In the daily communication of employees, cross-departmental and cross-subsidiary communication is usually required, resulting in the emergence of enterprise groups with more than a thousand or even tens of thousands of employees. In the IM enterprise group scenario, if a message storm occurs, such as a large number of red envelope messages and emoticon messages in the enterprise group, it will bring a huge communication burden to the entire IM enterprise group, and may cause problems such as message blocking, loss, and a large number of delays. Summary of the invention
[0003] The present invention provides a method, device, equipment and storage medium for limiting the flow of enterprise group messages, which are used to solve the technical problems of message blocking, loss and large-scale delay in the case of message storm.
[0004] In order to solve the above technical problems, in a first aspect, the present invention provides a method for limiting the flow of enterprise group messages, the method comprising:
[0005] Enable the persistent connection gateway to receive a message body sent by the client, and send the message body to a message forwarding service, wherein the message body includes a user ID and a business message body;
[0006] enabling the message forwarding service to obtain user information from a user message service according to the user ID, and determining whether the message body is a priority message body according to the user information;
[0007] If the message body is a priority message body, calling a message processing service to process the entity class code information corresponding to the message body;
[0008] If the message body is not a priority message body, it is determined whether to call the message processing service to process the entity class code information corresponding to the message body according to the token bucket algorithm.
[0009] Optionally, determining whether to call the message processing service to process the entity class code information corresponding to the message body according to the token bucket algorithm includes:
[0010] If there is a token in the current token bucket, the message processing service is called to process the entity class code information corresponding to the message body, otherwise, the message processing service is not called.
[0011] Optionally, after not calling the message processing service, the method further includes:
[0012] The call rejection event is written back to the persistent connection gateway, so that the persistent connection gateway writes the call rejection event back to the client, so that the client performs page prompt rendering after perceiving the call rejection event.
[0013] Optionally, the calling message processing service processes the entity class code information corresponding to the message body, including:
[0014] According to the business message body, a group chat processing service or a single chat processing service is called to process the entity class code information corresponding to the message body.
[0015] Optionally, the group chat processing service is used to process group chat red envelope messages and announcement messages, and the single chat processing service is used to process single chat red envelope messages and shake messages.
[0016] Optionally, the user information includes a user rank and a user weight. Accordingly, judging whether the message body is a priority message body according to the user information includes:
[0017] If the user's rank is greater than the preset rank, the message body is determined to be a priority message body. Otherwise, it is determined whether the user's weight is greater than the preset weight. If the user's weight is greater than the preset weight, the message body is determined to be a priority message body. If the user's weight is not greater than the preset weight, the message body is determined not to be a priority message body.
[0018] Optionally, before enabling the persistent connection gateway to receive the message body sent by the client, the method further includes:
[0019] Enable the client to initiate a connection establishment request to the persistent connection gateway to establish a connection between the client and the persistent connection gateway;
[0020] The client obtains the user ID and the service message body, assembles the user ID and the service message body into the message body, and converts the message body into a binary array to obtain a binary message body;
[0021] The client sends the binarized message body to the persistent connection gateway, so that the persistent connection gateway receives the binarized message body sent by the client.
[0022] In a second aspect, the present invention provides an enterprise group message flow limiting device, including a message body forwarding module, a message body judgment module, a first information processing module and a second information processing module;
[0023] The message body forwarding module is used to enable the persistent connection gateway to receive the message body sent by the client and send the message body to the message forwarding service, wherein the message body includes the user ID and the business message body;
[0024] The message body determination module is used to enable the message forwarding service to obtain user information from the user message service according to the user ID, and determine whether the message body is a priority message body according to the user information;
[0025] The first information processing module is used to call a message processing service to process the entity class code information corresponding to the message body when the message body is a priority message body;
[0026] The second information processing module is used to determine whether to call the message processing service to process the entity class code information corresponding to the message body according to the token bucket algorithm when the message body is not a priority message body.
[0027] In a third aspect, the present invention provides an enterprise group message flow limiting device, including a memory and a processor, wherein:
[0028] The memory is used to store computer programs;
[0029] The processor is used to read the program in the memory and execute the steps of the enterprise group message flow limiting method provided in the first aspect above.
[0030] In a fourth aspect, the present invention provides a computer-readable storage medium having a readable computer program stored thereon, which, when executed by a processor, implements the steps of the enterprise group message flow limiting method provided in the first aspect above.
[0031] Compared with the prior art, the enterprise group message flow limiting method, device, equipment and storage medium provided by the present invention have the following beneficial effects:
[0032] The long connection gateway receives the message body sent by the client and sends the message body to the message forwarding service, wherein the message body includes a user ID and a business message body; the message forwarding service obtains user information from the user message service according to the user ID, and determines whether the message body is a priority message body according to the user information; if the message body is a priority message body, the message processing service is called to process the entity class code information corresponding to the message body; if the message body is not a priority message body, the message processing service is called to process the entity class code information corresponding to the message body according to the token bucket algorithm; whether the message body is a priority message body is determined according to the message body and the corresponding user information to ensure that the priority message body can be processed first, and at the same time, the token bucket algorithm is used to limit the flow of other message bodies, thereby ensuring the user experience of important users and avoiding message blocking, loss and a large number of delays. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only part of the embodiments of the present invention, rather than all of the embodiments. For ordinary technicians in this field, without paying creative work, other drawings obtained based on these drawings all fall within the scope of protection of this application.
[0034] Figure 1 It is a flow chart of a method for limiting the flow of enterprise group messages provided by an embodiment of the present invention;
[0035] Figure 2 This is a schematic diagram of the overall architecture of an enterprise group message flow limiting method provided by an embodiment of the present invention;
[0036] Figure 3 It is a structural schematic diagram of an enterprise group message flow limiting device provided by an embodiment of the present invention;
[0037] Figure 4 It is a structural schematic diagram of an enterprise group message flow limiting device provided by an embodiment of the present invention;
[0038] Figure 5 It is a structural schematic diagram of a computer-readable storage medium provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0040] In order to make the description of the disclosed content more detailed and complete, the following is an illustrative description of the implementation mode and specific examples of the present invention; however, this is not the only form of implementing or applying the specific embodiments of the present invention. The implementation mode covers the features of multiple specific embodiments and the method steps and their sequence for constructing and operating these specific embodiments. However, other specific embodiments can also be used to achieve the same or equal functions and step sequences. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0041] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein.
[0042] In the description of the embodiments of the present application, "multiple" refers to two or more than two, and other quantifiers are similar and should be understood. The preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention. In addition, the embodiments of the present application and the features therein may be combined with each other if there is no conflict.
[0043] Example 1
[0044] like Figure 1 As shown, it is a flow chart of a method for limiting the flow of enterprise group messages provided by an embodiment of the present invention, which includes the following steps.
[0045] Step S101, enabling the persistent connection gateway to receive a message body sent by the client, and send the message body to a message forwarding service, wherein the message body includes a user ID and a business message body;
[0046] It should be noted that the specific forms of the above message body and the user ID and business message body therein can be set according to the specific forms of the client and the persistent connection gateway, and this embodiment may not be limited.
[0047] As an optional implementation manner, before enabling the persistent connection gateway to receive the message body sent by the client, the method further includes:
[0048] Enable the client to initiate a connection establishment request to the persistent connection gateway to establish a connection between the client and the persistent connection gateway;
[0049] The client obtains the user ID and the service message body, assembles the user ID and the service message body into the message body, and converts the message body into a binary array to obtain a binary message body;
[0050] The client sends the binarized message body to the persistent connection gateway, so that the persistent connection gateway receives the binarized message body sent by the client.
[0051] In a specific embodiment, the client initiates a connection establishment request to the 8080 port of the persistent connection gateway server to establish a connection between the client and the persistent connection gateway; the client obtains the user ID and the service message body, and assembles the user ID and the service message body into the message body. For example, the message body may be {"userId":10000, body:{}}, where userId represents the user ID or user ID identifier, and body represents the service message body. If body is empty, Indicates that the business message body is a non-business processing message; convert the above message body into a binary array, for example, the binary array can be [001010100101001011101000100110010111000001010101000011001111100010101], which can enable the above client to send the above binary message body to port 8080 of the above persistent connection gateway server, and then the persistent connection gateway forwards the above message body to the message forwarding service.
[0052] Step S102, enabling the message forwarding service to obtain user information from the user message service according to the user ID, and determining whether the message body is a priority message body according to the user information;
[0053] In a specific embodiment, after receiving the message body, the message forwarding service unpacks the message body to convert the binary message body into entity class code information. The message forwarding service pulls the user information in the user information service based on the user ID information in the message body, that is, the user ID information in the entity class code information.
[0054] As an optional implementation manner, the user information includes a user rank and a user weight. Accordingly, judging whether the message body is a priority message body according to the user information includes:
[0055] If the user's rank is greater than the preset rank, the message body is determined to be a priority message body. Otherwise, it is determined whether the user's weight is greater than the preset weight. If the user's weight is greater than the preset weight, the message body is determined to be a priority message body. If the user's weight is not greater than the preset weight, the message body is determined not to be a priority message body.
[0056] In a specific embodiment, the preset rank and preset weight can be set according to the actual situation. For example, the preset rank can be determined according to the employee organizational structure, and the preset weight can be set according to the time of joining the company. The preset rank can be T4, and the preset weight can be 600. The priority of the user rank is greater than the priority of the user weight. If the user rank in the user information is greater than the preset rank, for example, the user rank in the user information is greater than the preset rank T4, then the message body is determined to be a priority message body. Otherwise, it is determined whether the user weight is greater than the preset weight. If the user weight is not greater than the preset weight, for example, the user weight is not greater than the preset weight 600, then the message body is determined not to be a priority message body. For example, the user information table with user IDs 1 and 2 is shown in Table 1:
[0057] Table 1 User information table
[0058] userId weight jobSequence 1 200 T2.3 2 600 A4.1
[0059] Among them, weight represents the user weight, and jobSequence represents the user's job level.
[0060] Continue to Figure 1 In step S103, if the message body is a priority message body, a message processing service is called to process the entity class code information corresponding to the message body;
[0061] As an optional implementation manner, the calling message processing service processes the entity class code information corresponding to the message body, including:
[0062] According to the business message body, a group chat processing service or a single chat processing service is called to process the entity class code information corresponding to the message body.
[0063] In a specific embodiment, when the message body is a priority message body, the entity class code information corresponding to the message body is processed using a downstream business service, such as a group chat processing service or a single chat processing service.
[0064] As an optional implementation, the group chat processing service is used to process group chat red envelope messages and announcement messages, and the single chat processing service is used to process single chat red envelope messages and shake messages.
[0065] It should be noted that the functions of the above-mentioned group chat processing service and single chat processing service are only examples, and their specific implementation methods can be set according to the specific implementation scenario; the specific forms of the above-mentioned group chat red envelope messages, announcement messages, single chat red envelope messages and shake messages can be determined according to the type of instant messaging system, and this embodiment may not be limited.
[0066] Step S104: If the message body is not a priority message body, determine whether to call the message processing service to process the entity class code information corresponding to the message body according to the token bucket algorithm.
[0067] As an optional implementation manner, determining whether to call the message processing service to process the entity class code information corresponding to the message body according to the token bucket algorithm includes:
[0068] If there is a token in the current token bucket, the message processing service is called to process the entity class code information corresponding to the message body, otherwise, the message processing service is not called.
[0069] The embodiment of the present invention determines whether to call the message processing service to process the entity class code information corresponding to the above message body by judging whether there is a token in the current token bucket, thereby realizing the flow limiting of the processing of the entity class code information corresponding to the above message body and avoiding the blocking, loss and a large number of delays of the message.
[0070] In a specific embodiment, in a token bucket algorithm, tokens are added to a token bucket at a fixed speed. When the token bucket is full of tokens, the token addition stops. When the token bucket receives an upstream request, for example, a request to call a message processing service to process the entity class code information corresponding to the above message body, if there are tokens in the token bucket, a token is taken out of the token bucket, the request is accepted, and the message processing service is called to process the entity class code information corresponding to the above message body. When there are no tokens in the token bucket, the request is rejected and the message processing service is not called to process the entity class code information corresponding to the above message body.
[0071] The specific steps of calling the message processing service to process the entity class code information corresponding to the message body are the same as described above and will not be repeated here.
[0072] As an optional implementation manner, after not calling the message processing service, the method further includes:
[0073] The call rejection event is written back to the persistent connection gateway, so that the persistent connection gateway writes the call rejection event back to the client, so that the client performs page prompt rendering after perceiving the call rejection event.
[0074] In an embodiment of the present invention, the call rejection event is written back to the long connection gateway, so that the long connection gateway writes the call rejection event back to the client, so that the client renders a page prompt after perceiving the call rejection event, so as to prompt the user whose message body is delayed in processing, so as to improve the user experience.
[0075] In a specific embodiment, the above-mentioned client performs page prompt rendering after perceiving the above-mentioned call rejection event, wherein the content of the page prompt rendering can be set according to actual conditions, for example, "The current number of messages sent is too large, please try again later" or "The current messages are sent too frequently, please try again later", etc.
[0076] In a specific embodiment, a schematic diagram of the overall architecture of a method for limiting the flow of enterprise group messages is shown as follows: Figure 2 As shown, Figure 2 In the figure, the client can be a computer, mobile phone or tablet, etc., which can be the message sender; IM GATEWAY is the IM long connection gateway, which can be used as the main entrance for receiving client messages; Dispatch represents the message forwarding service, which can be used to parse the message body and pass it to the downstream business service, and the downstream business services may include message notification service, group chat processing service, and single chat processing service; Notify represents the message notification service, which can be used for SMS notification of mobile devices; Process represents the group chat processing service, which can be used to process group chat red envelope messages and announcement messages, etc.; Inbox represents the single chat processing service, which can be used to process single chat red envelope messages and shake messages, etc.; Ucenter represents the user information service, which can be used to store user information, and the user information may include at least one of the user rank, user weight and user position; the message forwarding service can be used to control and schedule the flow of enterprise group messages.
[0077] The enterprise group message flow limiting method provided by the embodiment of the present invention enables the long connection gateway to receive the message body sent by the client, and send the above message body to the message forwarding service, the above message body includes the user ID and the business message body; enables the above message forwarding service to obtain user information from the user message service according to the above user ID, and judges whether the above message body is a priority message body according to the above user information; if the above message body is a priority message body, calls the message processing service to process the entity class code information corresponding to the above message body; if the above message body is not a priority message body, determines whether to call the above message processing service to process the entity class code information corresponding to the above message body according to the token bucket algorithm; judges whether the message body is a priority message body according to the message body and the corresponding user information to ensure that the priority message body can be processed first, and at the same time uses the token bucket algorithm to limit the flow of other message bodies, which not only ensures the user experience of important users, but also effectively avoids message blocking, loss and a large number of delays.
[0078] By utilizing the enterprise group message limiting method provided in the embodiment of the present invention, it is possible to ensure that important users or VIP users, that is, users corresponding to priority message bodies, have a better user experience in the message storm caused by red envelope messages and emoticon messages, and by utilizing the token bucket algorithm to limit the flow of other message bodies, it is possible to control the speech of group members in a more fine-grained manner, avoid message blocking, loss, and a large number of delays, so that messages in an enterprise group of tens of thousands of people can still be processed normally.
[0079] The enterprise group message flow limiting method provided by the embodiment of the present invention can ensure that the number of messages sent in the same second does not exceed a preset number. It can also be applied to scenarios in which voices are given priority based on rank and weight in an enterprise group, while avoiding the problem of unavailability of the enterprise group or instant messaging system caused by a message storm in the enterprise group.
[0080] Example 2
[0081] Based on the above enterprise group message flow limiting method, an embodiment of the present invention provides an enterprise group message flow limiting device, as shown in the structural diagram. Figure 3 As shown, the enterprise group message flow limiting device 30 includes a message body forwarding module 31, a message body judgment module 32, a first information processing module 33 and a second information processing module 34;
[0082] The message body forwarding module 31 is used to enable the persistent connection gateway to receive the message body sent by the client and send the message body to the message forwarding service, wherein the message body includes the user ID and the service message body;
[0083] The message body determination module 32 is used to enable the message forwarding service to obtain user information from the user message service according to the user ID, and to determine whether the message body is a priority message body according to the user information;
[0084] The first information processing module 33 is used to call the message processing service to process the entity class code information corresponding to the message body when the message body is a priority message body;
[0085] The second information processing module 34 is used to determine whether to call the message processing service to process the entity class code information corresponding to the message body according to the token bucket algorithm when the message body is not a priority message body.
[0086] For other details about how the modules in the above-mentioned enterprise group message flow limiting device implement the above-mentioned technical solution, please refer to the description of the enterprise group message flow limiting method provided in the above-mentioned invention embodiment, which will not be repeated here.
[0087] Example 3
[0088] Based on the above enterprise group message flow limiting method, the embodiment of the present invention further provides an enterprise group message flow limiting device, as shown in its structural diagram. Figure 4 As shown, the enterprise group message flow limiting device 40 includes a processor 41 and a memory 42 coupled to the processor 41. The memory 42 stores a computer program, and when the computer program is executed by the processor 41, the processor 41 executes the steps of the enterprise group message flow limiting method in the above embodiment.
[0089] For other details about how the processor 41 in the above-mentioned enterprise group message flow limiting device implements the above-mentioned technical solution, please refer to the description of the enterprise group message flow limiting method provided in the above-mentioned invention embodiment, which will not be repeated here.
[0090] Among them, the processor 41 can also be called a CPU (Central Processing Unit), and the processor 41 may be an integrated circuit chip with signal processing capabilities; the processor 41 can also be a general-purpose processor, DSP (Digital Signal Process), ASIC (Application Specific Integrated Circuit), FPGA (Field Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, among which the general-purpose processor can be a microprocessor or the processor 41 can also be any conventional processor, etc.
[0091] Example 4
[0092] The embodiment of the present invention further provides a computer-readable storage medium, a schematic diagram of which is shown in FIG. Figure 5 As shown, a readable computer program 51 is stored on the storage medium 50; wherein, the computer program 51 can be stored in the above storage medium in the form of a software product, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the above methods in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, magnetic disk or optical disk, ROM (Read-Only Memory), RAM (Random Access Memory) and other media that can store program codes, or terminal devices such as computers, servers, mobile phones, and tablets.
[0093] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0094] The modules described above as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0095] In addition, each functional module in each embodiment of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the above-mentioned integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may be stored in a computer-readable storage medium.
[0096] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0097] The above-mentioned computer program product includes one or more computer instructions. When the above-mentioned computer program instructions are loaded and executed on a computer, the above-mentioned process or function according to the embodiment of the present application is generated in whole or in part. The above-mentioned computer may be a general-purpose computer, a special-purpose computer, a computer network or other programmable devices. The above-mentioned computer instructions may be stored in a computer-readable storage medium, or transmitted from a computer-readable storage medium to another computer-readable storage medium, for example, the above-mentioned computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The above-mentioned computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server, a data center, etc. that includes one or more available media integration. The above-mentioned available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
[0098] The technical solution provided by the present application is introduced in detail above. The principles and implementation methods of the present application are explained by using specific examples in the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
[0099] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0100] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices and computer program products according to the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0101] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0102] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0103] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for limiting the flow of enterprise group messages, characterized in that: include: Enable the persistent connection gateway to receive a message body sent by the client, and send the message body to a message forwarding service, wherein the message body includes a user ID and a business message body; enabling the message forwarding service to obtain user information from a user message service according to the user ID, and determining whether the message body is a priority message body according to the user information; If the message body is a priority message body, calling a message processing service to process the entity class code information corresponding to the message body; If the message body is not a priority message body, it is determined whether to call the message processing service to process the entity class code information corresponding to the message body according to the token bucket algorithm.
2. The enterprise group message flow limiting method according to claim 1 is characterized in that: The determining, according to the token bucket algorithm, whether to call the message processing service to process the entity class code information corresponding to the message body includes: If there is a token in the current token bucket, the message processing service is called to process the entity class code information corresponding to the message body, otherwise, the message processing service is not called.
3. The enterprise group message flow limiting method according to claim 2 is characterized in that: After not calling the message processing service, the method further includes: The call rejection event is written back to the persistent connection gateway, so that the persistent connection gateway writes the call rejection event back to the client, so that the client performs page prompt rendering after perceiving the call rejection event.
4. The enterprise group message flow limiting method according to claim 1 or 2, characterized in that: The calling message processing service processes the entity class code information corresponding to the message body, including: According to the business message body, a group chat processing service or a single chat processing service is called to process the entity class code information corresponding to the message body.
5. The enterprise group message flow limiting method according to claim 4 is characterized in that: The group chat processing service is used to process group chat red envelope messages and announcement messages, and the single chat processing service is used to process single chat red envelope messages and shake messages.
6. The enterprise group message flow limiting method according to claim 1 is characterized in that: The user information includes a user rank and a user weight. Accordingly, judging whether the message body is a priority message body according to the user information includes: If the user's rank is greater than the preset rank, the message body is determined to be a priority message body. Otherwise, it is determined whether the user's weight is greater than the preset weight. If the user's weight is greater than the preset weight, the message body is determined to be a priority message body. If the user's weight is not greater than the preset weight, the message body is determined not to be a priority message body.
7. The enterprise group message flow limiting method according to claim 1 is characterized in that: Before enabling the persistent connection gateway to receive the message body sent by the client, the method further includes: Enable the client to initiate a connection establishment request to the persistent connection gateway to establish a connection between the client and the persistent connection gateway; The client obtains the user ID and the service message body, assembles the user ID and the service message body into the message body, and converts the message body into a binary array to obtain a binary message body; The client sends the binarized message body to the persistent connection gateway, so that the persistent connection gateway receives the binarized message body sent by the client.
8. An enterprise group message flow limiting device, characterized in that: It includes a message body forwarding module, a message body judgment module, a first information processing module and a second information processing module; The message body forwarding module is used to enable the persistent connection gateway to receive the message body sent by the client and send the message body to the message forwarding service, wherein the message body includes the user ID and the business message body; The message body determination module is used to enable the message forwarding service to obtain user information from the user message service according to the user ID, and to determine whether the message body is a priority message body according to the user information; The first information processing module is used to call a message processing service to process the entity class code information corresponding to the message body when the message body is a priority message body; The second information processing module is used to determine whether to call the message processing service to process the entity class code information corresponding to the message body according to the token bucket algorithm when the message body is not a priority message body.
9. An enterprise group message flow limiting device, characterized in that: comprising a memory and a processor, wherein: The memory is used to store computer programs; The processor is used to read the computer program in the memory and execute the steps of the enterprise group message flow limiting method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A readable computer program is stored thereon, and when the program is executed by a processor, the steps of the enterprise group message flow limiting method as described in any one of claims 1 to 7 are implemented.
