An information forwarding method, device, apparatus, and computer-readable storage medium
By acquiring the client-side rate limiting model and storing it in a remote dictionary service, and by optimizing information forwarding using algorithms such as the funnel algorithm, the congestion problem in SMS message sending under high concurrency was solved, thereby improving stability and security.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA MOBILEHANGZHOUINFORMATION TECH CO LTD
- Filing Date
- 2022-10-18
- Publication Date
- 2026-08-04
AI Technical Summary
Existing technologies cannot effectively manage the traffic of IT system clients accessing the system under high-concurrency scenarios, leading to congestion or failure in sending SMS messages, and the security and accuracy of relying on public messaging services cannot be guaranteed.
By acquiring rate limiting models from multiple clients, storing rate limiting parameters in a remote dictionary service, and forwarding client information based on these rate limiting parameters, targeted rate limiting and traffic control are achieved. Information forwarding is optimized using models such as funnel algorithms and token bucket algorithms.
It effectively avoids information forwarding congestion, improves success rate, saves network bandwidth resources, and enhances the stability and security of information forwarding, supporting message forwarding in high-concurrency scenarios.
Smart Images

Figure CN116916259B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet Technology (IT) technology, and includes, but is not limited to, an information forwarding method, apparatus, device, and computer-readable storage medium. Background Technology
[0002] Currently, IT systems send SMS messages primarily in two ways. One method relies on various SMS channel providers, where each system individually calls the provider's Application Program Interface (API) to customize the request parameters and sending interface for SMS messages. The second method involves integrating multiple SMS channel providers and message middleware such as Redis and Kafka to provide message forwarding services. Each IT system connects to this public message forwarding service, and the accuracy and security of SMS message delivery depend entirely on this shared messaging service, placing high demands on its capabilities.
[0003] None of the aforementioned technologies offer efficient solutions for high-concurrency scenarios. They cannot effectively manage the traffic of connected IT system clients based on the Transaction Per Second (TPS) of SMS channel providers, leading to message sending congestion or even failure. Summary of the Invention
[0004] In view of the above, embodiments of this application provide an information forwarding method, apparatus, device, and computer-readable storage medium.
[0005] The technical solution of this application embodiment is implemented as follows:
[0006] This application provides an information forwarding method, the method comprising:
[0007] Obtain the rate limiting models for multiple clients and store the rate limiting parameters of each model in a remote dictionary service;
[0008] Receive forwarding information sent by various clients;
[0009] The rate limiting parameters of the rate limiting model for each client are obtained from the remote dictionary service, and the information to be forwarded for each client is forwarded based on the rate limiting parameters of the rate limiting model for each client.
[0010] This application embodiment provides an information forwarding device, the information forwarding device comprising:
[0011] The first acquisition module is used to acquire the rate limiting models of multiple clients and store the rate limiting parameters of each rate limiting model in a remote dictionary service;
[0012] The receiving module is used to receive forwarding information sent by various clients;
[0013] The first forwarding module is used to obtain the rate limiting parameters of the rate limiting model of each client from the remote dictionary service, and forward the information to be forwarded of each client based on the rate limiting parameters of the rate limiting model of each client.
[0014] This application embodiment provides an information forwarding device, the information forwarding device comprising:
[0015] Processor; and
[0016] Memory for storing computer programs that can run on the processor;
[0017] The computer program, when executed by the processor, implements the aforementioned information forwarding method.
[0018] This application provides a computer-readable storage medium storing computer-executable instructions configured to execute the aforementioned information forwarding method.
[0019] This application provides an information forwarding method, apparatus, device, and computer-readable storage medium. The information forwarding method includes: first, obtaining rate limiting models for multiple clients; then, storing the rate limiting parameters of each rate limiting model in a remote dictionary service; next, receiving messages to be forwarded sent by each client; then, obtaining the rate limiting parameters of each client's rate limiting model from the remote dictionary service; and finally, forwarding the messages to be forwarded from each client based on the rate limiting parameters of each client's rate limiting model. In this way, each client has a corresponding rate limiting model, enabling targeted rate limiting of the messages to be forwarded sent by each client based on their respective rate limiting models. This effectively manages the traffic of each client, avoids congestion during information forwarding, and improves the success rate of information forwarding. Targeted and reasonable rate limiting for each client also saves network bandwidth resources. Attached Figure Description
[0020] In the accompanying drawings (which are not necessarily drawn to scale), similar reference numerals may describe similar parts in different views. The drawings illustrate, by way of example and not limitation, the various embodiments discussed herein.
[0021] Figure 1 This is a schematic diagram of the first implementation flow of the information forwarding method provided in the embodiments of this application;
[0022] Figure 2 This is a schematic diagram illustrating an implementation process for constructing a rate limiting model provided in an embodiment of this application;
[0023] Figure 3 This is a schematic diagram of a second implementation process of the information forwarding method provided in the embodiments of this application;
[0024] Figure 4 This is a schematic diagram of a third implementation process of the information forwarding method provided in the embodiments of this application;
[0025] Figure 5 This is a schematic diagram illustrating one implementation process of mass messaging provided in an embodiment of this application;
[0026] Figure 6 This is a schematic diagram illustrating an implementation process of the application service side using the message forwarding service, as provided in an embodiment of this application.
[0027] Figure 7 A schematic diagram illustrating an implementation process of permission verification provided in an embodiment of this application;
[0028] Figure 8 A schematic diagram illustrating a message processing implementation flow for a message service side provided in this application embodiment;
[0029] Figure 9 A schematic diagram illustrating an implementation process for replacing a new SMS gateway under the template mode provided in this application embodiment;
[0030] Figure 10 This is a schematic diagram illustrating an implementation process of the configuration message forwarding service provided in an embodiment of this application;
[0031] Figure 11 This is a schematic diagram illustrating an implementation process for flow control on the client using a funnel algorithm, provided in an embodiment of this application.
[0032] Figure 12 This is a schematic diagram illustrating an implementation process of a strategy for mass SMS messaging under different channels provided in an embodiment of this application.
[0033] Figure 13 This is a schematic diagram illustrating an implementation process of SMS uplink operation provided in an embodiment of this application;
[0034] Figure 14 A schematic diagram of the composition structure of an information forwarding device provided in an embodiment of this application;
[0035] Figure 15 This is a schematic diagram of the composition structure of an information forwarding device provided in an embodiment of this application. Detailed Implementation
[0036] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0037] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0038] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0039] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0040] To better understand the information forwarding method provided in the embodiments of this application, the following two related technologies and their shortcomings will be explained first.
[0041] In the first related technology, multiple SMS platform calls are implemented through configuration. For developers, this approach leverages various SMS platforms and uses database configuration to call these platforms, thereby improving the robustness of the SMS service. First, the SMS platform call address and method are determined. Then, parameters and calling methods are configured through the database. Finally, the order in which SMS platforms are called is determined based on priority. This method of implementing multiple SMS platform calls through configuration not only enables calls to multiple third-party SMS platforms through simple database configuration, reducing code modification and workload, but also integrates multiple SMS platforms, configures priorities, and controls the order in which platforms are used, thus ensuring the accuracy and stability of the SMS service. However, this method does not provide an efficient solution for high-concurrency scenarios.
[0042] In the second related technology, configuration document data corresponding to various network SMS platforms is obtained, a data analysis algorithm is established, and calculations are performed on the configuration document data according to the data analysis algorithm. The calculation results are used as document analysis data, and configuration document templates corresponding to each network SMS platform are generated based on the document analysis data. The network SMS platform is determined according to the application service instructions, and the corresponding configuration document template is selected according to the network SMS platform. The network SMS platform is then configured using the configuration document template. The SMS to be sent is sent to the SMS platform, and the sending result is recorded. This invention analyzes the configuration documents corresponding to various SMS platforms on the market and generates configuration document templates for different network SMS platforms based on the analysis results. Through this configuration document template, technicians can quickly connect to the SMS platform. However, this method still suffers from the aforementioned inability to effectively manage the traffic of accessing clients.
[0043] To address the problems existing in related technologies, this application provides an information forwarding method. This method can be implemented by a computer program, which, when executed, performs the information forwarding method provided in this application. In some embodiments, the computer program can be executed by a processor in an information forwarding device, which can be a server, and the server may include multiple gateways. Figure 1 An implementation flow of the information forwarding method provided in the embodiments of this application is as follows: Figure 1 As shown, the information forwarding method includes:
[0044] Step S101: Obtain the rate limiting models for multiple clients and store the rate limiting parameters of each rate limiting model in a remote dictionary service (REmote DIctionary Server, Redis).
[0045] Here, each client has its own rate limiting model, which is pre-built by the server. When forwarding information, a model retrieval command can be triggered, and the pre-built rate limiting models for each client can be retrieved based on this command.
[0046] In this embodiment, the number of clients is generally at least two, meaning the server is connected to at least two clients to forward information sent by those clients. For example, the number of clients can be 17, 18, 19, etc.
[0047] In practice, rate limiting models can be based on the Leaky Bucket algorithm, the token bucket algorithm, or other similar methods.
[0048] In this embodiment, the rate limiting model includes rate limiting parameters. The server forwards information according to the rate limiting parameters in the rate limiting model. In order to improve the access speed, this embodiment stores the rate limiting parameters of each rate limiting model in Redis.
[0049] Step S102: Receive the forwarding information sent by each client.
[0050] Here, a communication connection is established between the server and each client. Based on this, the server can receive the information to be forwarded sent by each client based on the established communication connection.
[0051] In practice, the information to be forwarded can be character-based, image-based, audio-based, etc.
[0052] In some embodiments, each client also completes association configuration with a gateway in the server, wherein a client can be associated with one gateway or multiple gateways.
[0053] Step S103: Obtain the rate limiting parameters of the rate limiting model for each client from the remote dictionary service, and forward the information to be forwarded for each client based on the rate limiting parameters of the rate limiting model for each client.
[0054] Here, the key-value pairs in the remote dictionary service correspond one-to-one with each client. The key-value pairs corresponding to each client can be determined first, and then the rate limiting parameters of the rate limiting model for each client can be obtained based on the key-value pairs.
[0055] In this embodiment of the application, the rate limiting parameter may include the forwarding rate. Based on this, when the server actually forwards the information to be forwarded from each client, it forwards the information to be forwarded from each client based on the forwarding rate of the rate limiting model of each client.
[0056] For example, assuming the forwarding rate of the rate limiting model corresponding to client A is 10 packets / second and the forwarding rate of the rate limiting model corresponding to client B is 12 packets / second, then for the information to be forwarded sent by client A, the server forwards the information to be forwarded at a rate of 10 packets / second; while for the information to be forwarded sent by client B, the server forwards the information to be forwarded at a rate of 12 packets / second.
[0057] In practice, the server can forward the information to be forwarded from each client in parallel.
[0058] This application provides an information forwarding method, which includes: first, obtaining rate limiting models for multiple clients, and then storing the rate limiting parameters of each rate limiting model in a remote dictionary service; next, receiving messages to be forwarded sent by each client; then, obtaining the rate limiting parameters of the rate limiting models for each client from the remote dictionary service; and finally, forwarding the messages to be forwarded from each client based on the rate limiting parameters of the rate limiting models for each client. In this way, each client has a corresponding rate limiting model, enabling targeted rate limiting of the messages to be forwarded sent by each client based on their respective rate limiting models. This effectively manages the traffic of each client, avoids congestion during information forwarding, and improves the success rate of information forwarding. Targeted and reasonable rate limiting for each client also saves network bandwidth resources.
[0059] In some embodiments, the rate limiting parameters also include total capacity and initial forwarding rate. Before performing step S101 above, "obtaining rate limiting models for multiple clients and storing the rate limiting parameters of each rate limiting model in a remote dictionary service", the server will construct the rate limiting model for each client in advance based on the rate limiting parameters. Figure 2 An implementation process for constructing a rate limiting model provided in this application embodiment, such as... Figure 2 As shown, constructing the current limiting model includes the following steps S001 to S003:
[0060] Step S001: Initialize the total capacity of each client.
[0061] Here, the total capacity of each client can be selected from the preset total capacity by combining the performance indicators of the client and the performance indicators of the gateway associated with the client. For example, the total capacity can be 200, 300, etc.
[0062] In the embodiments of this application, total capacity refers to the maximum capacity that the current limiting model can accommodate.
[0063] Step S002: Obtain the historical operation information of each client, and determine the initial forwarding rate of each client based on the historical operation information of each client.
[0064] Here, the historical operation information of each client can be obtained from the operation logs of each client. This historical operation information can include the historical type and rate of information sent by the client. In other words, this historical operation information can reflect the actual operation status of the client in a historical period.
[0065] In this embodiment, the maximum historical rate can be determined from the historical rates and then used as the initial forwarding rate; the average rate corresponding to the historical rate can also be used as the initial forwarding rate; or the product of the maximum historical rate and a first preset coefficient can be used as the initial forwarding rate.
[0066] In some embodiments, when determining the initial forwarding rate for each client, the forwarding performance of the gateway associated with the client may also be considered, so that the gateway can support the initial forwarding rate.
[0067] Step S003: Based on the total capacity of each client and the initial forwarding rate of each client, construct the rate limiting model for each client.
[0068] Here, the total capacity of each client after initialization is assigned to the total capacity of the rate limiting model corresponding to each client, and the initial forwarding rate of each client is assigned to the forwarding rate of the rate limiting model corresponding to each client. In this way, the rate limiting model for each client is constructed.
[0069] In this embodiment, through steps S001 to S003, the total capacity of each client can be initialized, and the initial forwarding rate of each client can be determined based on the historical operating information of each client, thereby completing the construction of a rate limiting model for each client. This allows rate limiting for each client to be implemented based on the rate limiting model for each client.
[0070] Based on the above embodiments, the rate limiting parameters also include the last forwarding time for each client, when the server forwards information, such as... Figure 3 As shown, information forwarding can be performed based on the following steps S1031 to S1039. That is, the "forwarding of information to be forwarded by each client based on the rate limiting parameters of the rate limiting model of each client" in step S103 can be achieved through the following steps S1031 to S1039.
[0071] Step S1031: Obtain the current time and the last forwarding time of each client.
[0072] Here, the server includes a clock device from which the current time can be obtained. Additionally, the last forwarding time for each client can be obtained from the server's operation logs; that is, the time when the server last forwarded information corresponding to each client.
[0073] Step S1032: Determine the time interval between the current time and each previous forwarding time.
[0074] Here, the difference between the current time and each of the previous forwarding times is calculated to obtain the time interval between the current time and each forwarding time, that is, the time elapsed since the last forwarding.
[0075] Step S1033: Determine the interval threshold for each client based on the initial forwarding rate of each client.
[0076] Here, the unit time and each initial forwarding rate can be divided to obtain the interval threshold of each client, which is the time interval between two information forwardings by each client, or the time taken for each client to forward information once.
[0077] For example, assuming that the forwarding rate of the rate limiting model corresponding to client A is 10 packets / second and the forwarding rate of the rate limiting model corresponding to client B is 12 packets / second, then the interval threshold for client A is 1 / 12 second and the interval threshold for client B is 0.1 seconds.
[0078] Step S1034: When the time interval of the first target client reaches the interval threshold corresponding to the first target client, forward the information to be forwarded of the first target client based on the initial forwarding rate of the first target client.
[0079] Here, the relationship between the time interval of each client and the corresponding client's interval threshold is determined. If it is determined that the time interval of the first target client reaches the interval threshold corresponding to the first target client, it indicates that the information of the first target client can be forwarded. That is, the information to be forwarded sent by the first target client can be forwarded at this time.
[0080] In this embodiment, the forwarding of information sent by the first target client is based on the initial forwarding rate of the first target client. That is, information is forwarded by maintaining a constant initial forwarding rate of the first target client, thereby achieving information flow limiting for the first target client.
[0081] Step S1035: Update the current remaining capacity of the first target client in the remote dictionary service.
[0082] In this embodiment of the application, since forwarding involves forwarding the information to be forwarded from the storage queue or storage pool in the rate limiting model, it will cause a change in the current remaining capacity in the rate limiting model. The changed current remaining capacity will then be used in a timely manner to update the current remaining capacity corresponding to the first target client in the remote dictionary service.
[0083] Step S1036: Obtain the current remaining capacity from the remote dictionary service.
[0084] Here, the current remaining capacity of each client can be read in real time from the remote dictionary service.
[0085] Step S1037: Determine the single forwarding amount of each client based on the initial forwarding rate of each client.
[0086] Here, the initial forwarding rate and the preset number of forwardings for each client can be divided to obtain the single forwarding amount for each client.
[0087] For example, assuming that client A's initial forwarding rate is 10 per second and client A forwards 5 times per second, then it can be determined that client A's single forwarding quantity is 2.
[0088] Step S1038: When there is a target single forwarding volume greater than the current remaining capacity, determine the second target client corresponding to the target single forwarding volume.
[0089] Here, the current remaining capacity of each client can be compared with the corresponding single forwarding volume of each client. If there is a target single forwarding volume greater than the current remaining capacity, it indicates that the space of the storage queue or storage pool in the rate limiting model is about to be fully filled with information, and then the second target client corresponding to the target single forwarding volume is determined.
[0090] Step S1039: Send an over-limit reminder message to the second target client.
[0091] At this point, the remaining capacity of the second target client is greater than the target single forwarding capacity of the second target client. This indicates that if the second target client continues to send information to be forwarded, the information in the storage queue (or storage pool) of the rate limiting model of the second target client will overflow. Therefore, an over-limit reminder message is sent to the second target client so that the second target client can be informed of the server's forwarding status in a timely manner, so that the second target client can slow down or delay sending information to be forwarded, thereby avoiding the overflow of information to be forwarded.
[0092] In this embodiment, through steps S1031 to S1039, the time interval between the current time and each previous forwarding time can be determined. When the time interval of the first target client reaches the first target client's interval threshold, the information to be forwarded sent by the first target client is forwarded based on the initial forwarding rate of the first target client, and the current remaining capacity of the first target client in the remote dictionary service is updated in real time. In addition, the single forwarding amount of each client is determined. When the current remaining capacity of the second target client is less than the target single forwarding amount of the second target client, it indicates that the second target client is sending the information to be forwarded at a high speed, which is about to cause information overflow. In this case, an over-limit reminder message is sent to the second target client in a timely manner so that the second target client can know the forwarding status of the server in a timely manner, so that the second target client can slow down or delay sending the information to be forwarded, thereby avoiding the overflow of the information to be forwarded.
[0093] In some embodiments, the overflow of information to be forwarded can also be avoided by increasing the forwarding rate. That is, after step S1038 above, "when there is a target single forwarding amount greater than the current remaining capacity, determine the second target client corresponding to the target single forwarding amount", such as Figure 4 As shown, the following steps S1039' to S10311' can also be performed:
[0094] Step S1039': When the initial forwarding rate of the second target client is less than the rate threshold, a rate adjustment instruction is generated based on the current remaining capacity and the target single forwarding volume.
[0095] Here, the rate threshold is the upper limit of the forwarding rate, which can be determined by the server's performance parameters.
[0096] In this embodiment of the application, the initial forwarding rate of the second target client and the rate threshold can be compared first by a size comparison method. If the initial forwarding rate of the second target client is less than the rate threshold, a rate adjustment command can be generated.
[0097] When generating the rate adjustment command, the difference between the target single forwarding amount of the second target client and the current remaining capacity of the second target client is determined. The product of the difference and the second preset coefficient is then used as the increment corresponding to the initial forwarding rate of the second target client. Finally, an adjustment command carrying the increment corresponding to the initial forwarding rate of the second target client is generated.
[0098] In some embodiments, if the initial forwarding rate of the second target client is equal to the rate threshold, it indicates that the initial forwarding rate of the second target client has reached the upper limit of the forwarding rate and cannot be increased further, so the process ends directly.
[0099] Step S10310': Adjust the initial forwarding rate of the second target client based on the adjustment instruction to obtain the updated forwarding rate of the second target client.
[0100] Here, the increment corresponding to the initial forwarding rate of the second target client can be obtained by parsing the adjustment command. Then, the initial forwarding rate of the second target client is increased based on the increment, thereby obtaining the increased forwarding rate of the second target client, which is also the updated forwarding rate of the second target client.
[0101] Step S10311': Update the remote dictionary service using the updated forwarding rate of the second target client.
[0102] Here, when the forwarding rate corresponding to any client changes or is updated, the information in the remote dictionary service will be updated using the changed or updated forwarding rate to ensure that the information in the remote dictionary service remains up-to-date.
[0103] In this embodiment of the application, through the above steps S1039' to S10311', when the target single forwarding volume of the second target client is greater than the current remaining capacity of the second target client and the initial forwarding rate of the second target client is less than the rate threshold, the initial forwarding rate of the second target client can be increased to obtain the updated forwarding rate of the second target client, thereby avoiding the overflow of the information to be forwarded and ensuring the smooth and efficient forwarding of the information to be forwarded.
[0104] In some embodiments, the information forwarding method also supports forwarding mass messages. Based on this, when the message to be forwarded is a message sent to at least two destination addresses, i.e., when the message to be forwarded is a mass message, such as... Figure 5 As shown, steps S501 to S504 can be performed:
[0105] Step S501: When the information to be forwarded is information sent to at least two destination addresses, obtain the number of at least two destination addresses.
[0106] Here, the message to be forwarded carries a destination address, which can be obtained by parsing the message; then, the number of destination addresses is determined.
[0107] Step S502: Determine whether the number of at least two destination addresses is greater than the number threshold.
[0108] Here, the quantity threshold can be a default value or a custom setting value. For example, the quantity threshold can be 100, 200, 300, etc., and the setting range of the quantity threshold can be from 100 to 500.
[0109] In this embodiment of the application, the relationship between the number of at least two destination addresses and the number threshold can be determined by a size comparison method. If the number of at least two destination addresses is less than or equal to the number threshold, it indicates that the number of group messages is within the set value, and the process proceeds to step S503; if the number of at least two destination addresses is greater than the number threshold, it indicates that the number of group messages exceeds the set value, and the process proceeds to step S504.
[0110] Step S503: Forward the information to be forwarded to the destination address.
[0111] Here, if the number of at least two destination addresses is less than or equal to the number threshold, the information to be forwarded is forwarded to all destination addresses.
[0112] Step S504: Determine the selected destination address from the destination addresses, and forward the information to be forwarded to the selected destination address.
[0113] Here, if the number of at least two destination addresses is greater than the quantity threshold, it is not supported to forward the information to be forwarded to all destination addresses. In this case, the selected destination address can be randomly selected from the destination addresses, or the first number of destination addresses with the quantity threshold can be determined as the selected destination addresses in sequence. The number of selected destination addresses is equal to the quantity threshold.
[0114] In some embodiments, the server may also split the selected destination address into multiple groups and forward it according to the grouping results.
[0115] In this embodiment of the application, through the above steps S501 to S504, the forwarding of mass information can be supported. When the number of two destination addresses is less than or equal to the number threshold, the information to be forwarded is directly forwarded to all destination addresses; otherwise, the selected destination addresses whose number is equal to the number threshold are first determined, and then the information to be forwarded is forwarded to the selected destination addresses, thereby improving the flexibility of forwarding.
[0116] In some embodiments, while receiving the information to be forwarded sent by each client in step S102, permission verification and preset field filtering are also performed on all information sent by each client. Information that passes the permission verification and does not contain the preset fields is determined as information to be forwarded, while other information is determined as information not to be forwarded. Therefore, while performing step S102 or before performing step S102, there is also information identification. In actual implementation, information identification can be achieved through the following steps S01 to S03:
[0117] Step S01: Obtain the information sent by each client.
[0118] This refers to receiving all information sent by various clients.
[0119] Step S02: Perform permission verification and preset field filtering on the information in sequence to obtain information that passes the verification and does not contain the preset fields.
[0120] Here, each piece of information undergoes permission verification and preset field filtering. Permission verification can include whitelist filtering, address filtering, authentication information filtering, input parameter interception filtering, and client traffic verification. Preset fields can be preset sensitive fields.
[0121] In this embodiment of the application, after the information passes the permission verification, the information can be filtered by preset fields. If the information does not contain preset fields, the information that has passed the verification and does not contain preset fields is obtained, and then the process proceeds to step S03.
[0122] In some embodiments, if the information fails the permission verification or includes preset fields indicating that the information does not conform to the rules, the process ends directly.
[0123] Step S03: Information that passes verification and does not contain preset fields is identified as information to be forwarded.
[0124] Here, information that passes the verification and does not contain the preset fields is considered to meet the rules and can be forwarded. Based on this, it is determined to be information to be forwarded.
[0125] In this embodiment, through steps S01 to S03, the information sent by each client undergoes permission verification and preset field filtering. Information that fails permission verification or includes preset fields is discarded; while information that passes verification and does not contain preset fields is identified as information to be forwarded and forwarded. This improves the security of the system.
[0126] Based on the above embodiments, this application further provides an information forwarding method. This method can be implemented using a message forwarding microservice model that combines the message queue (RabbitMQ) middleware with the Leaky Bucket algorithm and utilizes the template pattern. Taking SMS messages as an example, this method, combined with the template pattern in the development model, structurally decouples the SMS integration code. It allows for SMS gateway replacement without affecting the original code, solving the problem of needing to replace a large amount of message forwarding platform code to adapt to the new SMS channel when the SMS channel provider changes. This message forwarding model not only implements server-side peak-shaving flow control for message services under high traffic, but also adds a client-side flow control algorithm based on Leaky Bucket. Utilizing Redis caching middleware, it achieves traffic control for the client calling the "message forwarding" service, avoiding anomalies caused by exceeding user request limits and preventing users from being unaware when SMS or emails fail to send. This improves the stability of the "message service" and provides a solution for providing message forwarding services in high-concurrency scenarios.
[0127] The model provided in this application also introduces template SMS sending and email forwarding services, realizing the forwarding function of multiple types of messages, improving code reusability, and reducing labor costs. At the same time, the model provides SMS uplink capability, adds virtual (Mock) account sending method, adds client signature management and template file management, and systems accessing this message service can query all message sending records and message sending status through administrator account, making message sending status traceable and greatly improving the security of message sending.
[0128] The information forwarding method in this application embodiment is based on the message middleware RabbitMQ and Leaky Bucket. The basic process of sending SMS messages on the application server side is described below. Figure 6 and Figure 7 The process of the application server using the message sending interface and the message processing process of the server are described separately. The application server corresponds to the client mentioned above, and the server corresponds to the server mentioned above.
[0129] Figure 6 The flowchart describes the application service side using the message forwarding service. This embodiment uses the RabbitMQ message queue to achieve asynchronous request processing, thereby accelerating response speed and improving interface request response performance. Figure 6 This includes the following steps S601 to S606:
[0130] Step S601, message sending request.
[0131] Step S602: Request the message forwarding service interface.
[0132] Here, the application service calls the message sending interface in the message forwarding service to send the message. Taking SMS as an example, the application service needs to provide a security verification code, as well as the mobile phone number, SMS content, and the system signature that has been registered.
[0133] Step S603, Permission verification.
[0134] Here, after the application service request information arrives at the service side, the service side needs to verify the security of the request based on the security verification information provided by the application service side. In this embodiment, the service request header needs to carry the allocated application identification (AppId), a universally unique identifier (UUID), the current time, and a message digest algorithm (MD5). If the verification fails, the request is returned to the application service side, i.e., proceeding to step S606; if the verification succeeds, subsequent operations continue, i.e., proceeding to step S604. The UUID is valid only once, and the MD5 hash is the allocated 32-bit token + UUID + the first 8 digits of the time.
[0135] In the embodiments of this application, Figure 7This document describes the access control process for requesting the message service in this embodiment, including verification of the requesting client's Internet Protocol (IP) address, verification of the request address, verification of the presence or absence of authentication information, verification of the request header parameters as described above, and TPS verification. Only after all the above verifications are successful can the client normally request the service API for sending messages and send messages. Specifically, the IP verification of the requesting client is equivalent to whitelist filtering in step S6032; the verification of the request address is equivalent to address filtering in step S6033; the verification of the presence or absence of authentication information is equivalent to authentication information filtering in step S6034; the verification of the request header parameters is equivalent to input parameter interception verification in step S6035; and the TPS verification is equivalent to client flow control in step S6036. Furthermore, the access control process also includes: step S6031, where the client sends a message request, and step S6037, where processing ends.
[0136] Step S604, Sensitive field filtering.
[0137] Here, the message forwarding service provides a sensitive field filtering function to filter sensitive fields in the message content sent by the application service, thereby improving the security of the message content. If a sensitive field is detected in the message content, it is returned to the application service. These sensitive fields correspond to the preset fields mentioned above. In this way, sensitive information filtering, blacklist / whitelist filtering, and access control are implemented, enhancing security.
[0138] In this embodiment of the application, if the request message does not contain sensitive fields, that is, it is filtered by sensitive fields, then proceed to step S605; otherwise proceed to step S606.
[0139] Step S605: Store in the message queue.
[0140] Here, the message forwarding service pushes the request content from the application service into the corresponding message queue. This embodiment uses four message queues to handle ordinary verification code SMS messages, ordinary non-verification code SMS messages, uplink SMS messages, and emails, respectively, achieving asynchronous decoupling of requests and improving interface response speed. The message forwarding service corresponds to the aforementioned server.
[0141] In some embodiments, multiple message queues may be used, and the number of message queues may be 6, 7, 8, etc., which is determined according to the actual business situation.
[0142] Step S606, return to end.
[0143] This refers to returning to the application service side and ending the process.
[0144] In this embodiment of the application, through the above steps S601 to S606, the message queue middleware RabbitMQ is introduced to achieve decoupling of processing, and setting up multiple message queues improves the interface response efficiency.
[0145] Figure 8 The flowchart for message processing provided in this application embodiment includes the following steps S801 to S806:
[0146] Step S801: The message queue captures the contents of the request queue.
[0147] Here, the program monitors the status of the message queue in real time. If there are unprocessed queue elements in the message queue, it will start this processing flow.
[0148] Step S802: Multi-threaded processing of queue contents.
[0149] To improve the efficiency of concurrent message processing, multi-threading is used here. The number of threads can be dynamically adjusted according to server performance to improve message processing speed.
[0150] Step S803: Obtain application service message configuration information.
[0151] Here, the message configuration information of the application service side is obtained based on the security verification code provided by the application service side, which is the message configuration information configured by the application service side in the second step.
[0152] Step S804: Process information according to configuration information.
[0153] Here, message sending is configured based on the configuration information obtained in step S803. Taking SMS sending as an example, if the user has a "Test Message Gateway" configuration, the corresponding configuration class name "smsTestService" in the t_message_config_sm table is obtained based on the relevant dependencies. The message service side uses "smsTestService" to obtain a dynamically instantiated message sending implementation class SmsTestService, and calls the sendShortMessage() method in the SmsTestService class to send the message. If message sending fails, it can try sending through other SMS gateways configured in the application service.
[0154] Step S805: Record the sending result.
[0155] This section records the history of successful or failed message sending, enabling querying and other data analysis. After statistical analysis, a visual display interface can be generated.
[0156] Step S806, processing complete.
[0157] In this embodiment, through steps S801 to S806 above, multi-threading technology is used to improve the parallel processing capability of the message forwarding service during message processing, proposing an efficient solution for high-concurrency scenarios in the Internet model. It also supports querying message sending records, providing unified security for message sending in business systems.
[0158] This application embodiment highly integrates the template pattern and microservice capabilities in software development, proposing a message forwarding service capability platform based on the template pattern. The following describes the operation of implementing lightweight SMS integration and application service message configuration. This application embodiment uses the template pattern to abstract the SMS sending configuration class, enabling lightweight integration with SMS gateway vendors. Figure 9 The main process for replacing the SMS gateway in template mode is demonstrated, including:
[0159] Step S901: Add a new SMS gateway.
[0160] Step S902: Write a Service class that implements the SmBaseService interface.
[0161] Here, the SmBaseService interface defines the basic methods for sending general SMS messages. To add an SMS channel vendor interface configuration implementation class, you need to write an interface class and implement the basic methods of the SmBaseService interface.
[0162] Step S903: Implement the sendShortMessage() interface.
[0163] Here, the implementation class that implements the SmBaseService interface needs to implement the sendShortMessage() method. The input parameter of this method is of type HashMap, which includes information such as the mobile phone number to be sent the SMS and the content. The newly added interface implementation class needs to implement the interface connection according to the requirements of the manufacturer's interface and implement the sendShortMessage method to send SMS messages.
[0164] Step S904: Add database SMS gateway configuration.
[0165] In this embodiment of the application, it is necessary to add the SMS gateway vendor type to the t_message_config_sm table in the database, including the SMS vendor name and the implementation class name, etc., where smClassName is the newly added implementation class name, with the first letter lowercase. This field is used to realize the association with the interface implementation class in the program.
[0166] Step S905, End.
[0167] In the application embodiment, the SMS integration code is decoupled in a structured manner by combining the template pattern in the development mode, which can realize the integration of lightweight SMS gateways and realize the addition and replacement of SMS gateways without affecting the original code.
[0168] In some embodiments, application services need to perform operational steps when using a message gateway. Figure 10 The main process for configuring the message forwarding service includes:
[0169] Step S1001: Customer personalizes the message gateway configuration.
[0170] Step S1002: Locate available SMS gateway configurations.
[0171] Here, we look up the t_message_config_sm table to find out how many SMS gateways are available for the application service to choose from.
[0172] Step S1003: Perform association configuration.
[0173] Here, for the selected gateway, you can fill in the account and password provided by the service provider to achieve self-settlement, or you can choose not to fill in the account and password and achieve settlement through the message forwarding service platform; you can select multiple SMS gateways to configure; each SMS gateway can be configured with priority to achieve priority in sending SMS messages.
[0174] Step S1004: Configure email information.
[0175] Here, the message forwarding service can also provide an email sending interface. The application service needs to fill in the relevant configuration for sending emails, such as the sending email account, password, protocol, etc.
[0176] Step S1005, End.
[0177] This application's embodiments introduce email forwarding services and template message sending services. The message content is obtained based on the template uploaded by the client. In the future, other types of message forwarding can also be introduced, realizing the forwarding function of multiple types of messages, improving code reusability, and reducing manual labor.
[0178] This application's embodiments implement a message forwarding service model under high concurrency conditions based on the message middleware RabbitMQ and Leaky Bucket. Figure 11 This describes the algorithm flow for client-side flow control in Leaky Bucket. It includes the following steps S1101 to S1106:
[0179] Step S1101: Implement the funnel using Java code.
[0180] Here, the following parameters are defined: funnel capacity, funnel flow rate, funnel remaining space, leftQuota, and last funnel flow time, leakingTs, to implement Leaky Bucket.
[0181] Step S1102, Redis parameter storage and retrieval.
[0182] Here, to accurately record the funnel parameters for each client and set reasonable rate limits, we retrieve leftQuota and leakingT from Redis. After processing the remaining space, we put the parameter values back into Redis.
[0183] Step S1103: Processing remaining space.
[0184] Here, the current system time is obtained, the time interval is obtained by subtracting the learningTs from Redis, the space freed up in the funnel is obtained according to the flow rate, and boundary value processing is performed.
[0185] Step S1104, flow settings.
[0186] Here, the remaining space is processed based on the client key in Redis. If the remaining space is greater than the transaction amount for each transaction, the remaining space is reduced by the transaction amount for each transaction, and the client is returned a true flag, indicating that the traffic is normal and requests can be made. Otherwise, the client is prompted that the call traffic has exceeded the limit.
[0187] Step S1105: Define the isActionAllowed method.
[0188] Here, the `isActionAllowed` method is defined in the Funnel, using the client's `AppId` as the key, along with the parameters `capability` and `leakingRate`, to limit client requests.
[0189] Step S1106, client makes the call.
[0190] This application embodiment sets different TPS (Transactions Per Second) based on the SMS sending requirements of different clients, and implements client flow control limits by setting database parameter sizes and Redis cache reads. Using this implemented algorithm, client traffic control can be achieved; when the limit is exceeded, the client will be notified to avoid problems caused by traffic exceeding limits. By implementing the LeakyBucket algorithm, and combining the Redis caching middleware and database to set different TPS sizes for different clients, traffic control for clients requesting message services is achieved.
[0191] In some embodiments, based on the message middleware RabbitMQ and Leaky Bucket, multiple SMS channel providers can be configured, and different bulk SMS sending methods and control strategies can be implemented. Figure 12 The implementation strategies for mass SMS messaging under different channels provided in the embodiments of this application include:
[0192] Step S1201: Send a mass SMS request.
[0193] Step S1202: Obtain the SMS channel type.
[0194] Here, the current channel type is first obtained through reflection based on the SMS channels configured in the database and their priority.
[0195] Step S1203: The internal channel limits the number of messages sent in a single batch.
[0196] Here, taking the company's internal SMS channel as an example, internal mobile numbers can send messages to no more than 100 people at a time; messages exceeding this limit cannot be sent.
[0197] Step S1204: External channel split number transmission.
[0198] Here, taking the advantages of external SMS channel linkage as an example, if the number of group messages is limited to 10 people at a time, then the group messages of this type will be split into 10 people each time and sent sequentially. That is, the number of people exceeding 10 will be split into multiple groups of 10 people each time and sent sequentially.
[0199] Step S1205: Mass messaging ends.
[0200] In this embodiment of the application, through the above steps S1201 to S1205, different SMS channels can implement different SMS mass sending strategies through specific algorithms.
[0201] In some embodiments, this method supports SMS uplink functionality to meet the needs of mobile approval and other functions in specific scenarios. Figure 13 A flowchart of SMS uplink operation provided for embodiments of this application includes:
[0202] Step S1301, uplink request.
[0203] Here, an uplink request refers to a request sent from the application service side to the service side.
[0204] Step S1302: Send SMS downlink request code.
[0205] Here, the prerequisite for sending an uplink reply SMS is that the downlink SMS has sent an uplink request code. The corresponding 4-digit random code is generated through the downlink interface of this invention and sent to the user's mobile phone. After processing, it is stored in the uplink intermediate table up_middle for subsequent processing.
[0206] Step S1303, reply from above.
[0207] Here, the user replies to the corresponding SMS message via their mobile phone, requesting the message service's delivery interface to handle subsequent logic.
[0208] Step S1304: Determine whether it is a special response.
[0209] Here, the special reply table up_special is queried based on the reply content. If a record can be found, it is determined to be a special reply from the upstream. Then, a request and message are sent according to the retrieved callback address, which is to proceed to step S1305. If no special record content is found, it is determined to be a non-special reply. A request and message are sent according to the callback address stored in the upstream intermediate table up_middle, which is to proceed to step S1306.
[0210] Step S1305: Send an SMS message using a special callback address.
[0211] Step S1306: Send SMS using the callback address of the upstream intermediate table.
[0212] Step S1307: Save the sending record.
[0213] Here, the sent message record is saved immediately after the request ends, and the corresponding callback status in the message uplink intermediate table up_middle is updated at the same time. 0 is initialization, 1 is callback success, and 2 is callback failure. At the same time, the time information is updated to complete the uplink processing.
[0214] Step S1308, uplink ends.
[0215] In this way, it can support SMS uplink and file management, and provide unified security for message sending in business systems.
[0216] Based on the foregoing embodiments, this application provides an information forwarding device. The modules and units included in the device can be implemented by a processor in a computer device; of course, they can also be implemented by corresponding logic circuits. In the implementation process, the processor can be a central processing unit (CPU), a microprocessor unit (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA), etc.
[0217] This application embodiment further provides an information forwarding device, Figure 14 This is a schematic diagram of the composition structure of the information forwarding device provided in the embodiments of this application, as shown below. Figure 14 As shown, the information forwarding device 1400 includes:
[0218] The first acquisition module 1401 is used to acquire the rate limiting models of multiple clients and store the rate limiting parameters of each rate limiting model in a remote dictionary service;
[0219] The receiving module 1402 is used to receive forwarding information sent by each client;
[0220] The first forwarding module 1403 is used to obtain the rate limiting parameters of the rate limiting model of each client from the remote dictionary service, and forward the information to be forwarded of each client based on the rate limiting parameters of the rate limiting model of each client.
[0221] In some embodiments, the rate limiting parameters include total capacity and initial forwarding rate, and the information forwarding device 1400 further includes:
[0222] An initialization module is used to initialize the total capacity of each client.
[0223] The second acquisition module is used to acquire the historical operation information of each client and determine the initial forwarding rate of each client based on the historical operation information of each client.
[0224] The module is used to construct a rate limiting model for each client based on the total capacity of each client and the initial forwarding rate of each client.
[0225] In some embodiments, the rate limiting parameter further includes the last forwarding time, and the first forwarding module 1403 includes:
[0226] The first acquisition submodule is used to acquire the current time and the last forwarding time of each client;
[0227] The first determining submodule is used to determine the time interval between the current time and each of the previous forwarding times;
[0228] The second determining submodule is used to determine the interval threshold of each client based on the initial forwarding rate of each client;
[0229] The first forwarding submodule is used to forward the information to be forwarded of the first target client based on the initial forwarding rate of the first target client when the time interval of the first target client reaches the interval threshold corresponding to the first target client.
[0230] In some embodiments, the rate limiting parameter further includes remaining capacity, and the first forwarding module 1403 further includes:
[0231] The second acquisition submodule is used to acquire the current remaining capacity from the remote dictionary service;
[0232] The third determining submodule is used to determine the single forwarding amount of each client based on the initial forwarding rate of each client;
[0233] The fourth determination submodule is used to determine the second target client corresponding to the target single forwarding volume when there is a target single forwarding volume greater than the current remaining capacity;
[0234] The sending submodule is used to send an over-limit reminder message to the second target client.
[0235] In some embodiments, the first forwarding module 1403 further includes:
[0236] A generation submodule is used to generate a rate adjustment instruction based on the current remaining capacity and the target single forwarding amount when the initial forwarding rate of the second target client is less than the rate threshold.
[0237] The adjustment submodule is used to adjust the initial forwarding rate of the second target client based on the adjustment instruction, so as to obtain the updated forwarding rate of the second target client;
[0238] An update submodule is used to update the remote dictionary service using the updated forwarding rate of the second target client.
[0239] In some embodiments, the information forwarding device 1400 further includes:
[0240] The third acquisition module is used to acquire the number of the at least two destination addresses when the information to be forwarded is information sent to at least two destination addresses;
[0241] The second forwarding module is used to forward the information to be forwarded to the destination address when the number of the at least two destination addresses is less than or equal to the number threshold.
[0242] The third forwarding module is used to determine a selected destination address from the destination addresses when the number of destination addresses is greater than the number threshold, and forward the information to be forwarded to the selected destination address, wherein the number of selected destination addresses is equal to the number threshold.
[0243] In some embodiments, the information forwarding device 1400 further includes
[0244] The fourth acquisition module is used to acquire information sent by each client;
[0245] The verification module is used to sequentially perform permission verification and preset field filtering on the information to obtain information that passes the verification and does not contain the preset fields.
[0246] The determination module is used to determine the information that passes the verification and does not contain a preset field as the information to be forwarded.
[0247] It should be noted that the description of the information forwarding device in this application is similar to the description of the method embodiment described above, and has similar beneficial effects. For technical details not disclosed in this device embodiment, please refer to the description of the method embodiment in this application for understanding.
[0248] It should be noted that, in the embodiments of this application, if the above-described information forwarding method is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to the related technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware and software combination.
[0249] Accordingly, embodiments of this application provide a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the information forwarding method provided in the above embodiments.
[0250] This application provides an information forwarding device. Figure 15This is a schematic diagram of the composition structure of the information forwarding device provided in the embodiments of this application, such as... Figure 15 As shown, the information forwarding device 1500 includes: a processor 1501, at least one communication bus 1502, a user interface 1503, at least one external communication interface 1504, and a memory 1505. The communication bus 1502 is configured to enable communication between these components. The user interface 1503 may include a display screen, and the external communication interface 1504 may include standard wired and wireless interfaces. The processor 1501 is configured to execute a program of an information forwarding method stored in the memory to implement the information forwarding method provided in the above embodiment.
[0251] The descriptions of the above information forwarding device and storage medium embodiments are similar to those of the above method embodiments, and have similar beneficial effects. For technical details not disclosed in the information forwarding device and storage medium embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0252] It should be noted that the descriptions of the above embodiments of the storage medium and information forwarding device are similar to those of the above method embodiments, and have similar beneficial effects. For technical details not disclosed in the embodiments of the storage medium and information forwarding device of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0253] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0254] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0255] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.
[0256] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of the embodiments of this application, depending on actual needs.
[0257] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0258] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0259] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an AC to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0260] The above description is merely an embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. An information forwarding method characterized by comprising: The method includes: Initialize the total capacity for each client; Obtain the historical operation information of each client, and determine the initial forwarding rate of each client based on the historical operation information of each client; Based on the total capacity of each client and the initial forwarding rate of each client, a rate limiting model is constructed for each client; wherein, the rate limiting model is a funnel algorithm-based model, and the rate limiting model is implemented by defining funnel capacity, funnel flow rate, funnel remaining space and the last funnel flow time; The rate limiting parameters of each rate limiting model are stored in a remote dictionary service; wherein, the rate limiting parameters include total capacity, initial forwarding rate and last forwarding time; the remaining funnel space and the last funnel flow time are obtained from the remote dictionary service; after the remaining funnel space is processed, the updated remaining funnel space and the updated last funnel flow time are placed back into the remote dictionary service. Receive forwarding information sent by various clients; The system obtains the rate limiting parameters of the rate limiting model for each client from the remote dictionary service, and forwards the information to be forwarded for each client based on the rate limiting parameters of the rate limiting model for each client; wherein, the system obtains the current time and the last forwarding time of each client; determines the time interval between the current time and each last forwarding time; determines the interval threshold for each client based on the initial forwarding rate of each client; when the time interval of the first target client reaches the interval threshold corresponding to the first target client, forwards the information to be forwarded for the first target client based on the initial forwarding rate of the first target client; Obtain the current system time, calculate the time interval by subtracting the last funnel flow time obtained from the remote dictionary service, then calculate the space freed up in the funnel based on the funnel flow rate, and perform boundary value processing; based on the client key value in the remote dictionary service, if the remaining space in the funnel after the boundary value processing is greater than the flow amount of each time, then remove the flow amount of each time from the remaining space in the funnel and return the client identifier; otherwise, prompt the client that the call traffic exceeds the limit.
2. The method of claim 1, wherein, The current limiting parameter also includes remaining capacity, and the method further includes: Obtain the current remaining capacity from the remote dictionary service; The single forwarding amount of each client is determined based on the initial forwarding rate of each client. When there is a target single forwarding volume greater than the current remaining capacity, determine the second target client corresponding to the target single forwarding volume; Send an over-limit reminder message to the second target client.
3. The method of claim 2, wherein, When there is a target single forwarding volume greater than the current remaining capacity, the method further includes: When the initial forwarding rate of the second target client is less than the rate threshold, a rate adjustment instruction is generated based on the current remaining capacity and the target single forwarding amount; The initial forwarding rate of the second target client is adjusted based on the adjustment instruction to obtain the updated forwarding rate of the second target client; The remote dictionary service is updated using the updated forwarding rate of the second target client.
4. The method according to any one of claims 1 to 3, characterized in that, The method further includes: When the information to be forwarded is information sent to at least two destination addresses, obtain the number of the at least two destination addresses; When the number of the at least two destination addresses is less than or equal to the number threshold, the information to be forwarded is forwarded to the destination address. When the number of destination addresses is greater than the number threshold, a selected destination address is determined from the destination addresses, and the information to be forwarded is forwarded to the selected destination address, wherein the number of selected destination addresses is equal to the number threshold.
5. The method according to any one of claims 1 to 3, characterized in that, The method further includes: Obtain the information sent by each client; The information is sequentially subjected to permission verification and preset field filtering to obtain information that passes the verification and does not contain the preset fields; The information that passes the verification and does not contain the preset fields is identified as the information to be forwarded.
6. An information forwarding apparatus characterized by comprising: The information forwarding device includes: The initialization module is used to initialize the total capacity of each client. The second acquisition module is used to acquire the historical operation information of each client and determine the initial forwarding rate of each client based on the historical operation information of each client. A construction module is used to construct a rate limiting model for each client based on the total capacity of each client and the initial forwarding rate of each client; wherein, the rate limiting model is a funnel algorithm-based model, and the rate limiting model is implemented by defining funnel capacity, funnel flow rate, funnel remaining space and the last funnel flow time; The first acquisition module is used to store the rate limiting parameters of each rate limiting model in a remote dictionary service; wherein, the rate limiting parameters include total capacity, initial forwarding rate and last forwarding time; the module obtains the remaining funnel space and the last funnel flow time from the remote dictionary service; after the remaining funnel space is processed, the updated remaining funnel space and the updated last funnel flow time are placed back into the remote dictionary service. The receiving module is used to receive forwarding information sent by various clients; The first forwarding module is used to obtain the rate limiting parameters of the rate limiting model of each client from the remote dictionary service, and forward the information to be forwarded of each client based on the rate limiting parameters of the rate limiting model of each client; wherein, the module obtains the current time and the last forwarding time of each client; determines the time interval between the current time and each last forwarding time; determines the interval threshold of each client based on the initial forwarding rate of each client; and when the time interval of the first target client reaches the interval threshold corresponding to the first target client, forwards the information to be forwarded of the first target client based on the initial forwarding rate of the first target client. The first forwarding module is also used to obtain the current system time, calculate the time interval by subtracting the last funnel flow time obtained from the remote dictionary service, obtain the space freed up by the funnel according to the funnel flow rate, and perform boundary value processing; according to the client key value in the remote dictionary service, if the remaining space of the funnel after the above boundary value processing is greater than the flow amount of each time, the remaining space of the funnel is reduced by the flow amount of each time, and the client identifier is returned; otherwise, the client is prompted that the call traffic exceeds the limit.
7. An information forwarding apparatus characterized by comprising: The information forwarding device includes: Processor; and Memory for storing computer programs that can run on the processor; When the computer program is executed by the processor, it implements the information forwarding method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions configured to perform the information forwarding method according to any one of claims 1 to 5.