CN112351072B - Message pushing method and terminal - Google Patents

Message pushing method and terminal Download PDF

Info

Publication number
CN112351072B
CN112351072B CN202011090568.9A CN202011090568A CN112351072B CN 112351072 B CN112351072 B CN 112351072B CN 202011090568 A CN202011090568 A CN 202011090568A CN 112351072 B CN112351072 B CN 112351072B
Authority
CN
China
Prior art keywords
current
processing time
occupancy rate
message
bandwidth occupancy
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011090568.9A
Other languages
Chinese (zh)
Other versions
CN112351072A (en
Inventor
刘德建
林伟
郭玉湖
陈宏�
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujian Tianquan Educational Technology Ltd
Original Assignee
Fujian Tianquan Educational Technology Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujian Tianquan Educational Technology Ltd filed Critical Fujian Tianquan Educational Technology Ltd
Priority to CN202011090568.9A priority Critical patent/CN112351072B/en
Publication of CN112351072A publication Critical patent/CN112351072A/en
Application granted granted Critical
Publication of CN112351072B publication Critical patent/CN112351072B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • H04L43/0894Packet rate
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a message pushing method and a terminal, which are used for acquiring the minimum processing time and the current bandwidth occupancy rate corresponding to each preset bandwidth occupancy rate range, and acquiring the current minimum processing time corresponding to the current bandwidth occupancy rate according to the preset bandwidth occupancy rate range corresponding to the current bandwidth occupancy rate; acquiring current processing time of message pushing, comparing the current processing time with the current minimum processing time, and if the current processing time is less than the current minimum processing time, performing speed-limiting processing on the message pushing according to the current minimum processing time; the invention acquires the current processing time when executing message pushing, if the current processing time is less than the current minimum processing time, the system resources occupied by the current message pushing are excessive, the speed limit processing is carried out, so that the message pushing can not be carried out without occupying the system resources by the upper limit, and the other modules of the server can also work normally under the condition of excessive message pushing.

Description

Message pushing method and terminal
Technical Field
The present invention relates to the field of message pushing, and in particular, to a message pushing method and a terminal.
Background
Today, most mobile phone APPs provide a message pushing function, such as hot news recommendation of a news client, chat message reminding of an IM (Instant Messenger) tool, e-commerce product promotion information, notification and approval process of enterprise application, and the like; the message pushing plays an important role in improving the activity of products, the utilization rate of functional modules, the viscosity of users and the retention rate of users.
In general, the main implementation flow of message pushing is as follows: the client accesses the routing address list interface of the server in advance to obtain routing addresses which can be accessed normally, and selects a server access module corresponding to one of the addresses to establish long links; after the long link is successfully established, the server and the client perform normal message communication. A common scenario is that a server needs to send a broadcast message due to a certain event or activity, and the sending object of the broadcast message may reach millions or tens of millions or more; at this time, the main flow of the push server to implement broadcast push is as follows: splitting a broadcast message into corresponding millions or tens of millions of message details, and sending the message details to corresponding clients through an access module of a server.
In the process of sending the push message by the server, because the bottom layer resources of the server where the access module is located are limited, when a large amount of push messages exist at some time, if the push processing of the messages is always performed at the fastest speed that the server can operate, the bottom layer resources are likely to be quickly consumed, and other normal services except for message push are directly influenced; the most important one of various bottom layer resources is bandwidth, the bandwidth of each server is limited to a certain extent, and if the processing of massive push data is not limited, the instant flow of message push can reach hundreds or thousands of giga, which causes the bandwidth resources to be occupied in a large amount, and further influences other services.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: a message pushing method and a terminal are provided to realize optimized allocation of bandwidth resources in message pushing.
In order to solve the technical problems, the invention adopts a technical scheme that:
a message pushing method, comprising the steps of:
s1, acquiring minimum processing time corresponding to each preset bandwidth occupancy rate range;
s2, acquiring the current bandwidth occupancy rate, and obtaining the current minimum processing time corresponding to the current bandwidth occupancy rate according to the preset bandwidth occupancy rate range corresponding to the current bandwidth occupancy rate;
and S3, acquiring the current processing time of message pushing, comparing the current processing time with the current minimum processing time, and if the current processing time is less than the current minimum processing time, performing speed limit processing on the message pushing according to the current minimum processing time.
In order to solve the technical problem, the invention adopts another technical scheme as follows:
a message push terminal comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
s1, acquiring minimum processing time corresponding to each preset bandwidth occupancy rate range;
s2, acquiring the current bandwidth occupancy rate, and obtaining the current minimum processing time corresponding to the current bandwidth occupancy rate according to the preset bandwidth occupancy rate range corresponding to the current bandwidth occupancy rate;
and S3, acquiring the current processing time of message pushing, comparing the current processing time with the current minimum processing time, and if the current processing time is less than the current minimum processing time, performing speed limit processing on the message pushing according to the current minimum processing time.
The invention has the beneficial effects that: the method comprises the steps of presetting a bandwidth occupancy rate range and a corresponding minimum processing time, acquiring current bandwidth occupancy rate in the process of executing message pushing, correspondingly acquiring corresponding current minimum processing time by using the current bandwidth occupancy rate range and the preset bandwidth occupancy rate range, acquiring current processing time when executing message pushing, and if the current processing time is less than the current minimum processing time, indicating that the system resources occupied by the current message pushing are excessive, carrying out speed-limiting processing, so that the message pushing cannot be carried out without occupying the system resources with an upper limit, and ensuring that other modules of a server can also normally work under the condition of an overlarge amount of message pushing.
Drawings
Fig. 1 is a flowchart illustrating steps of a message pushing method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a message push terminal according to an embodiment of the present invention;
description of the reference symbols:
1. a message push terminal; 2. a processor; 3. a memory.
Detailed Description
In order to explain technical contents, achieved objects, and effects of the present invention in detail, the following description is made with reference to the accompanying drawings in combination with the embodiments.
Referring to fig. 1, a message pushing method includes the steps of:
s1, acquiring minimum processing time corresponding to each preset bandwidth occupancy rate range;
s2, acquiring the current bandwidth occupancy rate, and obtaining the current minimum processing time corresponding to the current bandwidth occupancy rate according to the preset bandwidth occupancy rate range corresponding to the current bandwidth occupancy rate;
and S3, acquiring the current processing time of message pushing, comparing the current processing time with the current minimum processing time, and if the current processing time is less than the current minimum processing time, performing speed limit processing on the message pushing according to the current minimum processing time.
From the above description, the beneficial effects of the present invention are: the method comprises the steps of presetting a bandwidth occupancy rate range and a corresponding minimum processing time, obtaining a current bandwidth occupancy rate in the process of executing message pushing, correspondingly obtaining the corresponding current minimum processing time by the current bandwidth occupancy rate range and the preset bandwidth occupancy rate range, obtaining the current processing time when executing message pushing, and if the current processing time is less than the current minimum processing time, indicating that the system resources occupied by the current message pushing are excessive, carrying out speed-limiting processing, so that the message pushing cannot be carried out without occupying the system resources with an upper limit, and ensuring that other modules of a server can also work normally under the condition of an ultra-large number of message pushing.
Further, S1 specifically is:
acquiring the preset bandwidth occupancy rate ranges, and executing the following steps on each preset bandwidth occupancy rate range:
gradually increasing the message pushing amount until the real-time bandwidth occupancy rate is equal to the minimum value in the preset bandwidth occupancy rate range, stabilizing the message pushing amount at the moment and continuing for preset time, and calculating the average message processing time in the preset time;
and taking the average message processing time as the minimum processing time corresponding to the bandwidth occupancy rate range.
According to the description, the average message processing time in different preset bandwidth occupancy rates is calculated in advance, if the pushing time of a single message is obviously smaller than the average message processing time, the message is indicated to occupy too much system resources during pushing, and the average message processing time is taken as a balance value, so that the processing efficiency of message pushing is ensured not to be too slow while the system resources are ensured not to be opened to a message pushing module without upper limit; and stabilizing the message pushing amount in the preset bandwidth occupancy rate range and continuing for the preset time, thereby ensuring the accuracy of the calculated average message processing time.
Further, S2 specifically is:
after the first message is successfully pushed, inquiring to obtain the current bandwidth occupancy rate, and obtaining the current minimum processing time corresponding to the current bandwidth occupancy rate according to the preset bandwidth occupancy rate range corresponding to the current bandwidth occupancy rate;
the S3 specifically comprises the following steps:
acquiring the current processing time of the first message in the pushing process, comparing the current processing time with the current minimum processing time, and if the current processing time is less than the current minimum processing time, performing speed limit processing on the pushing of the first message according to the current minimum processing time and returning to S2 to wait for the successful pushing of the next message;
and if the current processing time is longer than the current minimum processing time, directly returning to the S2 to wait for the successful pushing of the next message.
As can be seen from the above description, after the push of a message is finished, the current bandwidth occupancy rate is obtained, the preset bandwidth occupancy rate range where the current bandwidth occupancy rate is located is obtained, the minimum processing time corresponding to the preset bandwidth occupancy rate range where the current bandwidth occupancy rate is located is obtained as the current minimum processing time, and if the processing time of the message is less than the current minimum processing time, it indicates that the system resource occupied by the push of the message exceeds the average value, and at this time, the speed limit processing is performed, so that it is ensured that the system resource is not used without an upper limit.
Further, the S2 further includes:
and acquiring the current bandwidth occupancy rate after each message pushing is finished, and if the current bandwidth occupancy rate does not correspond to the preset bandwidth occupancy rate range, not executing the step S3 on the newly finished message pushing.
As can be seen from the above description, after each message is pushed, the current bandwidth occupancy rate is obtained, and if the current bandwidth occupancy rate is not within any preset bandwidth occupancy rate range, it indicates that the system resources are rich at this time, and no speed limit processing needs to be performed on the message pushing, so that S3 does not need to be executed, and the next message is directly pushed.
Further, the speed limiting processing in S3 specifically includes:
subtracting the current processing time from the current minimum processing time to obtain sleep time;
and enabling the thread for pushing the message to sleep for the sleep time.
It can be known from the above description that the current minimum processing time is used to balance the current processing time, so that the message push thread sleeps, and the system resource can be released to be used by other modules in the sleep time, thereby realizing the limitation of using the system resource for message push.
Referring to fig. 2, a message push terminal includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the following steps:
s1, acquiring minimum processing time corresponding to each preset bandwidth occupancy rate range;
s2, acquiring the current bandwidth occupancy rate, and obtaining the current minimum processing time corresponding to the current bandwidth occupancy rate according to the preset bandwidth occupancy rate range corresponding to the current bandwidth occupancy rate;
and S3, acquiring the current processing time of message pushing, comparing the current processing time with the current minimum processing time, and if the current processing time is less than the current minimum processing time, performing speed limit processing on the message pushing according to the current minimum processing time.
The invention has the beneficial effects that: the method comprises the steps of presetting a bandwidth occupancy rate range and a corresponding minimum processing time, acquiring current bandwidth occupancy rate in the process of executing message pushing, correspondingly acquiring corresponding current minimum processing time by using the current bandwidth occupancy rate range and the preset bandwidth occupancy rate range, acquiring current processing time when executing message pushing, and if the current processing time is less than the current minimum processing time, indicating that the system resources occupied by the current message pushing are excessive, carrying out speed-limiting processing, so that the message pushing cannot be carried out without occupying the system resources with an upper limit, and ensuring that other modules of a server can also normally work under the condition of an overlarge amount of message pushing.
Further, S1 specifically is:
acquiring the preset bandwidth occupancy rate ranges, and executing the following steps on each preset bandwidth occupancy rate range:
gradually increasing the message pushing amount until the real-time bandwidth occupancy rate is equal to the minimum value in the preset bandwidth occupancy rate range, stabilizing the message pushing amount at the moment and continuing for preset time, and calculating the average message processing time in the preset time;
and taking the average message processing time as the minimum processing time corresponding to the bandwidth occupancy rate range.
According to the description, the average message processing time in different preset bandwidth occupancy rates is calculated in advance, if the pushing time of a single message is obviously smaller than the average message processing time, the message is indicated to occupy too much system resources during pushing, and the average message processing time is taken as a balance value, so that the processing efficiency of message pushing is ensured not to be too slow while the system resources are ensured not to be opened to a message pushing module without upper limit; and stabilizing the message pushing amount in the preset bandwidth occupancy rate range and continuing for the preset time, thereby ensuring the accuracy of the calculated average message processing time.
Further, S2 specifically is:
after the first message is successfully pushed, inquiring to obtain the current bandwidth occupancy rate, and obtaining the current minimum processing time corresponding to the current bandwidth occupancy rate according to the preset bandwidth occupancy rate range corresponding to the current bandwidth occupancy rate;
the S3 specifically comprises the following steps:
acquiring the current processing time of the first message in the pushing process, comparing the current processing time with the current minimum processing time, and if the current processing time is less than the current minimum processing time, performing speed limit processing on the pushing of the first message according to the current minimum processing time and returning to S2 to wait for the successful pushing of the next message;
and if the current processing time is longer than the current minimum processing time, directly returning to the S2 to wait for the successful pushing of the next message.
It can be known from the above description that, after the pushing of a message is finished, the current bandwidth occupancy rate is obtained, the preset bandwidth occupancy rate range where the current bandwidth occupancy rate is located is obtained, the minimum processing time corresponding to the preset bandwidth occupancy rate range where the current bandwidth occupancy rate is located is obtained as the current minimum processing time, and if the processing time of the message is smaller than the current minimum processing time, it indicates that the system resource occupied by the pushing of the message exceeds the average value, at this time, the speed limit processing is performed, and it is ensured that the system resource is not used without an upper limit.
Further, the S2 further includes:
and acquiring the current bandwidth occupancy rate after each message pushing is finished, and if the current bandwidth occupancy rate does not correspond to the preset bandwidth occupancy rate range, not executing the step S3 on the newly finished message pushing.
As can be seen from the above description, the current bandwidth occupancy rate is obtained after each message pushing is finished, and if the current bandwidth occupancy rate is not within any preset bandwidth occupancy rate range, it indicates that the system resources are abundant at this time, and speed-limiting processing is not required for message pushing, so that S3 is not required to be executed, and the next message is directly pushed.
Further, the speed limiting processing in S3 specifically includes:
subtracting the current processing time from the current minimum processing time to obtain sleep time;
and enabling the thread for pushing the message to sleep for the sleep time.
Referring to fig. 1, a first embodiment of the present invention is:
a message push method, comprising the steps of:
s1, acquiring minimum processing time corresponding to each preset bandwidth occupancy rate range;
the method specifically comprises the following steps: acquiring the preset bandwidth occupancy rate ranges, and executing the following steps on each preset bandwidth occupancy rate range: gradually increasing the message pushing amount until the real-time bandwidth occupancy rate is equal to the minimum value in the preset bandwidth occupancy rate range, stabilizing the message pushing amount at the moment, continuing for preset time, and calculating the average message processing time in the preset time; taking the average message processing time as the minimum processing time corresponding to the bandwidth occupancy rate range;
specifically, the average message processing time of message pushing under a certain bandwidth occupancy rate is obtained through a single-instance pressure measurement method and is used as the minimum processing time of a preset bandwidth occupancy rate range in which the bandwidth occupancy rate is located; if the preset bandwidth occupancy range is set to be 50% to less than 80% of the first bandwidth occupancy range and 80% to less than 80% of the second bandwidth occupancy range, in a physical machine environment of a 4-core 16G memory, a gigabit network card is used as a main hardware resource to perform pressure measurement of a single-instance access module: continuously increasing the message pushing quantity step by step until the bandwidth occupancy rate reaches 50%, stabilizing the message pushing quantity at the moment and continuing for preset time, and pushing the preset time/the total message pushing quantity to obtain the average message processing time of 50 milliseconds, wherein the 50 milliseconds are the minimum processing time corresponding to the first bandwidth occupancy rate range; continuously and gradually increasing the message pushing quantity until the bandwidth occupancy rate reaches 80%, stabilizing the message pushing quantity at the moment and continuing for preset time, and pushing the preset time/the total message pushing quantity to obtain the average message processing time of 100 milliseconds, wherein 100 milliseconds are the minimum processing time corresponding to the second bandwidth occupancy rate range;
s2, acquiring the current bandwidth occupancy rate, and obtaining the current minimum processing time corresponding to the current bandwidth occupancy rate according to the preset bandwidth occupancy rate range corresponding to the current bandwidth occupancy rate;
the method specifically comprises the following steps: an independent asynchronous thread task is added to an access module in the message pushing system, the bandwidth occupancy rate of a local machine is inquired at certain intervals (for example, at intervals of 5 seconds), and the inquiry result is recorded in a local memory in a key-value form (optionally in a json format), wherein the key stores the total bandwidth of a server, and the value stores the bandwidth occupancy rate at the moment; after the first message is successfully pushed, acquiring current time, inquiring according to the current time to obtain the bandwidth occupancy rate with the storage time closest to the current time as the current bandwidth occupancy rate, and obtaining the current minimum processing time corresponding to the current bandwidth occupancy rate according to the preset bandwidth occupancy rate range corresponding to the current bandwidth occupancy rate, namely the minimum processing time corresponding to the preset bandwidth occupancy rate range in which the current bandwidth occupancy rate is located is the current minimum processing time corresponding to the annual bandwidth occupancy rate;
in an optional implementation manner, the latest bandwidth occupancy query result may cover the previous bandwidth occupancy query result;
if the current bandwidth occupancy rate does not correspond to the preset bandwidth occupancy rate range, S3 is not executed on the first message;
s3, obtaining the current processing time of message pushing, comparing the current processing time with the current minimum processing time, and if the current processing time is less than the current minimum processing time, performing speed limit processing on the message pushing according to the current minimum processing time;
the method comprises the following specific steps: acquiring the current processing time of the first message in the pushing process, comparing the current processing time with the current minimum processing time, and if the current processing time is less than the current minimum processing time, performing speed limit processing on the pushing of the first message according to the current minimum processing time and returning to S2 to wait for the successful pushing of the next message; if the current processing time is longer than the current minimum processing time, directly returning to the S2 to wait for the successful pushing of the next message;
wherein, the speed limit treatment is specifically as follows: subtracting the current processing time from the current minimum processing time to obtain sleep time; and sleeping the thread which carries out message pushing for the sleep time.
The second embodiment of the invention is as follows:
the message pushing method is applied to an actual scene:
sending a message push aiming at 100 ten thousand users, wherein a server side has 2 access modules (an access module A and an access module B), the two access modules are independent of each other and respectively process 50 ten thousand message pushes, the hardware resource of each access module is the same as that of S1 in the first embodiment, a physical machine and a gigabit network card of a 4-core 16G memory are the same as those of the first embodiment, and the two access modules have the same working mode, so that the access module A is selected to perform corresponding analysis:
when the access module pushes the message, the starting time of message pushing is recorded in advance, when the message pushing fails, a message of pushing failure is sent, retry processing is carried out on the message of pushing failure, and the time interval of the retry processing is gradually increased (if the first retry is 5 minutes after the sending failure, the second retry is 30 minutes after the first retry failure, the third retry is 1 hour after the second retry failure, and if the third retry fails, the retry is not carried out any more);
when the message is successfully pushed, recording the end time of the message pushing at the moment, inquiring a bandwidth occupancy rate record of a local cache, which is closest to the end time of the message pushing at the moment, as the current bandwidth occupancy rate, if the current bandwidth occupancy rate is not in a preset bandwidth range (50% to 80% of a first bandwidth occupancy rate range, and 80% to 80% of a second bandwidth occupancy rate range), modifying the sending state of the message of the server to be sent and clear related information in the cache, not performing speed limiting processing, if the current bandwidth occupancy rate is in the first bandwidth occupancy rate range, acquiring the minimum processing time 50 milliseconds corresponding to the first bandwidth occupancy rate range as the current minimum processing time, and acquiring the processing time of the message which is successfully pushed, if the current minimum processing time is greater than the current minimum processing time, not performing processing, if the current minimum processing time is less than the current minimum processing time, enabling a main thread which performs message pushing to sleep, wherein the sleep time is a difference value between the current minimum processing time and the processing time of the message which is successfully pushed, and if the processing time of the message which is successfully pushed is 40 milliseconds, then enabling the sleep time to be 50-40 milliseconds; if the current bandwidth occupancy is in the second bandwidth occupancy range, the processing process is the same as the first bandwidth occupancy range.
Referring to fig. 2, a third embodiment of the present invention is:
a message push terminal 1 comprises a processor 2, a memory 3 and a computer program stored on the memory 3 and operable on the processor 2, wherein the processor 2 implements the steps of the first embodiment when executing the computer program.
In summary, the present invention provides a message pushing method and a terminal, where a plurality of preset bandwidth occupancy rate ranges are set, a minimum processing time corresponding to the preset bandwidth occupancy rate ranges is obtained, after pushing of a message is completed, a current bandwidth occupancy rate is obtained, the preset bandwidth occupancy rate range where the message is located is obtained, the minimum processing time corresponding to the preset bandwidth occupancy rate range is obtained as a current minimum processing time corresponding to the current bandwidth occupancy rate, and the time for completing pushing the message is compared with the current minimum processing time, if the time for completing pushing the message is smaller, speed limiting processing is performed, the capability of the message pushing module to invoke system resources is limited, occupation of bottom layer resources such as bandwidth is reduced, and influence of the message pushing module on other modules during pushing of a large amount of messages is reduced; when the time for completing the message pushing is shorter, the main thread for performing the message pushing is made to sleep by the difference value between the main thread for performing the message pushing and the current minimum processing time, the monitoring speed limit of each message is realized, the bandwidth occupancy rate is obtained every time when the message pushing is completed, the implementation monitoring of the bottom layer resource of the bandwidth is realized, when the bandwidth occupancy rate is in a preset range, the blocking waiting of the thread is performed according to certain delay time, the corresponding bottom layer resource can be released for other modules to use during the waiting time, and the control of the bandwidth resource used by the message pushing module is realized.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all equivalent changes made by using the contents of the present specification and the drawings, or applied directly or indirectly to the related technical fields, are included in the scope of the present invention.

Claims (6)

1. A message pushing method, comprising the steps of:
s1, acquiring minimum processing time corresponding to each preset bandwidth occupancy rate range;
s2, acquiring the current bandwidth occupancy rate, and obtaining the current minimum processing time corresponding to the current bandwidth occupancy rate according to the preset bandwidth occupancy rate range corresponding to the current bandwidth occupancy rate;
s3, acquiring current processing time of message pushing, comparing the current processing time with the current minimum processing time, and if the current processing time is smaller than the current minimum processing time, performing speed limit processing on the message pushing according to the current minimum processing time;
the S1 specifically comprises the following steps:
acquiring the preset bandwidth occupancy rate ranges, and executing the following steps on each preset bandwidth occupancy rate range:
gradually increasing the message pushing amount until the real-time bandwidth occupancy rate is equal to the minimum value in the preset bandwidth occupancy rate range, stabilizing the message pushing amount at the moment and continuing for preset time, and calculating the average message processing time in the preset time;
taking the average message processing time as the minimum processing time corresponding to the bandwidth occupancy rate range;
the S2 specifically comprises the following steps:
after the first message is successfully pushed, inquiring to obtain the current bandwidth occupancy rate, and obtaining the current minimum processing time corresponding to the current bandwidth occupancy rate according to the preset bandwidth occupancy rate range corresponding to the current bandwidth occupancy rate;
the S3 specifically comprises the following steps:
acquiring the current processing time of the first message in the pushing process, comparing the current processing time with the current minimum processing time, and if the current processing time is less than the current minimum processing time, performing speed limit processing on the pushing of the first message according to the current minimum processing time and returning to S2 to wait for the successful pushing of the next message;
and if the current processing time is longer than the current minimum processing time, directly returning to the S2 to wait for the successful pushing of the next message.
2. The message pushing method according to claim 1, wherein the S2 further comprises:
and acquiring the current bandwidth occupancy rate after each message pushing is finished, and if the current bandwidth occupancy rate does not correspond to the preset bandwidth occupancy rate range, not executing the step S3 on the newly finished message pushing.
3. The message pushing method according to claim 1, wherein the performing the speed limiting process in S3 specifically includes:
subtracting the current processing time from the current minimum processing time to obtain sleep time;
and enabling the thread for pushing the message to sleep for the sleep time.
4. A message push terminal comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the computer program implements the steps of:
s1, acquiring minimum processing time corresponding to each preset bandwidth occupancy rate range;
s2, acquiring the current bandwidth occupancy rate, and obtaining the current minimum processing time corresponding to the current bandwidth occupancy rate according to the preset bandwidth occupancy rate range corresponding to the current bandwidth occupancy rate;
s3, obtaining the current processing time of message pushing, comparing the current processing time with the current minimum processing time, and if the current processing time is less than the current minimum processing time, performing speed limit processing on the message pushing according to the current minimum processing time;
the S1 specifically comprises the following steps:
acquiring the preset bandwidth occupancy rate ranges, and executing the following steps on each preset bandwidth occupancy rate range:
gradually increasing the message pushing amount until the real-time bandwidth occupancy rate is equal to the minimum value in the preset bandwidth occupancy rate range, stabilizing the message pushing amount at the moment, continuing for preset time, and calculating the average message processing time in the preset time;
taking the average message processing time as the minimum processing time corresponding to the bandwidth occupancy rate range;
the S2 specifically comprises the following steps:
after the first message is successfully pushed, inquiring to obtain the current bandwidth occupancy rate, and obtaining the current minimum processing time corresponding to the current bandwidth occupancy rate according to the preset bandwidth occupancy rate range corresponding to the current bandwidth occupancy rate;
the S3 specifically comprises the following steps:
acquiring the current processing time of the first message in the pushing process, comparing the current processing time with the current minimum processing time, and if the current processing time is less than the current minimum processing time, performing speed-limiting processing on the pushing of the first message according to the current minimum processing time and returning to S2 to wait for the successful pushing of the next message;
and if the current processing time is longer than the current minimum processing time, directly returning to the S2 to wait for the successful pushing of the next message.
5. The message pushing terminal according to claim 4, wherein said S2 further comprises:
and acquiring the current bandwidth occupancy rate after each message pushing is finished, and if the current bandwidth occupancy rate does not correspond to the preset bandwidth occupancy rate range, not executing the step S3 on the newly finished message pushing.
6. The message push terminal according to claim 4, wherein the speed limiting in S3 is specifically:
subtracting the current processing time from the current minimum processing time to obtain sleep time;
and enabling the thread for pushing the message to sleep for the sleep time.
CN202011090568.9A 2020-10-13 2020-10-13 Message pushing method and terminal Active CN112351072B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011090568.9A CN112351072B (en) 2020-10-13 2020-10-13 Message pushing method and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011090568.9A CN112351072B (en) 2020-10-13 2020-10-13 Message pushing method and terminal

Publications (2)

Publication Number Publication Date
CN112351072A CN112351072A (en) 2021-02-09
CN112351072B true CN112351072B (en) 2022-10-21

Family

ID=74360727

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011090568.9A Active CN112351072B (en) 2020-10-13 2020-10-13 Message pushing method and terminal

Country Status (1)

Country Link
CN (1) CN112351072B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102638849A (en) * 2011-02-14 2012-08-15 ***通信集团公司 Method, system and device for controlling service push
CN105516994A (en) * 2014-09-25 2016-04-20 华为技术有限公司 Bandwidth distribution method and device
CN108629045A (en) * 2018-05-14 2018-10-09 平安科技(深圳)有限公司 A kind of information push method, storage medium and server
US10291730B1 (en) * 2016-05-27 2019-05-14 Symantec Corporation Throttling push notifications using predictive workload modeling
CN110266582A (en) * 2019-05-29 2019-09-20 深圳市梦网科技发展有限公司 A kind of information push method, system, server and communication terminal
CN111355663A (en) * 2018-12-20 2020-06-30 中兴通讯股份有限公司 Message processing method and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9800483B2 (en) * 2012-04-13 2017-10-24 CirrusWorks, Inc. Method and apparatus for dynamic bandwidth allocation for optimizing network utilization
CN106302090B (en) * 2015-05-25 2019-10-22 阿里巴巴集团控股有限公司 A kind of message treatment method, apparatus and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102638849A (en) * 2011-02-14 2012-08-15 ***通信集团公司 Method, system and device for controlling service push
CN105516994A (en) * 2014-09-25 2016-04-20 华为技术有限公司 Bandwidth distribution method and device
US10291730B1 (en) * 2016-05-27 2019-05-14 Symantec Corporation Throttling push notifications using predictive workload modeling
CN108629045A (en) * 2018-05-14 2018-10-09 平安科技(深圳)有限公司 A kind of information push method, storage medium and server
CN111355663A (en) * 2018-12-20 2020-06-30 中兴通讯股份有限公司 Message processing method and system
CN110266582A (en) * 2019-05-29 2019-09-20 深圳市梦网科技发展有限公司 A kind of information push method, system, server and communication terminal

Also Published As

Publication number Publication date
CN112351072A (en) 2021-02-09

Similar Documents

Publication Publication Date Title
EP2962440B1 (en) Real-time communications using a restlike api
CN108712457B (en) Method and device for adjusting dynamic load of back-end server based on Nginx reverse proxy
CN110719318B (en) Message processing method and system
CN105847447B (en) Message pushing method and device
CN111277639B (en) Method and device for maintaining data consistency
CN109933439B (en) Message transmission method, device, computer equipment and storage medium
CN111784329B (en) Service data processing method and device, storage medium and electronic device
CN110968586A (en) Distributed transaction processing method and device
CN111092934B (en) Method for updating client routing and storage medium
CN113794764A (en) Request processing method and medium for server cluster and electronic device
CN112838980B (en) Message processing method, system, device, electronic equipment and storage medium
CN112351072B (en) Message pushing method and terminal
CN112865927B (en) Message delivery verification method, device, computer equipment and storage medium
CN111935782A (en) Optimization method of client retry mechanism and storage medium
CN112565238A (en) Method for popping privacy policy, client and computer-readable storage medium
CN112100556B (en) Method and system for optimizing message pushing mode
CN111191134B (en) Intelligent pushing method and terminal
CN106899652B (en) Method and device for pushing service processing result
CN110134547B (en) Middleware-based repeated data deleting method and related device
CN113364830A (en) Cache optimization method and system for long link
CN112287236A (en) Text message pushing method and device, computer equipment and storage medium
CN112333262A (en) Data updating prompting method and device, computer equipment and readable storage medium
CN110022352B (en) Message push response method and terminal
CN112363980B (en) Data processing method and device of distributed system
CN117097801A (en) Access method and system, CDN node, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant