CN110691146A - Method for rapidly pushing in large batch - Google Patents

Method for rapidly pushing in large batch Download PDF

Info

Publication number
CN110691146A
CN110691146A CN201911121587.0A CN201911121587A CN110691146A CN 110691146 A CN110691146 A CN 110691146A CN 201911121587 A CN201911121587 A CN 201911121587A CN 110691146 A CN110691146 A CN 110691146A
Authority
CN
China
Prior art keywords
push
token
failed
server
pack
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.)
Granted
Application number
CN201911121587.0A
Other languages
Chinese (zh)
Other versions
CN110691146B (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.)
SHENZHEN LEWEI TECHNOLOGY DEVELOPMENT Co Ltd
Original Assignee
SHENZHEN LEWEI TECHNOLOGY DEVELOPMENT Co 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 SHENZHEN LEWEI TECHNOLOGY DEVELOPMENT Co Ltd filed Critical SHENZHEN LEWEI TECHNOLOGY DEVELOPMENT Co Ltd
Priority to CN201911121587.0A priority Critical patent/CN110691146B/en
Publication of CN110691146A publication Critical patent/CN110691146A/en
Application granted granted Critical
Publication of CN110691146B publication Critical patent/CN110691146B/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
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/215Flow control; Congestion control using token-bucket

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a method for fast pushing in large batch, which sends pushed information to users, skips pushing and asynchronously sending messages to a service server if tokens are in a failed push token list, cleans up user token information corresponding to failed tokens, codes tokens and messages which are not failed correspondingly if the tokens are in the non-failed push token list, wherein the coding mode is $ msg ═ pack (', C', 1). pack (', N', serial number). pack (', N', expiration time). pack (', N', 32). pack (', H ═ str _ replace (', token) pack (', N', strlen (message)), strictly packages according to formats to guarantee the push success rate, sends coded tokens and messages which are not failed correspondingly to a push server, and the push server correspondingly sends messages to each user, if push fails, and continuously sending asynchronous messages to the service server, and cleaning the user token information corresponding to the failed token, so that repeated pushing of the failed token is avoided, and the pushing success rate and efficiency are improved.

Description

Method for rapidly pushing in large batch
[ technical field ] A method for producing a semiconductor device
The invention relates to a method for fast large-batch pushing, in particular to a method for fast large-batch pushing, which can timely clear invalid user tokens to improve the pushing success rate.
[ background of the invention ]
Now, the human cost is on a continuous rising trend, and with the rapid development of science and technology, many works are performed through a software system, such as information pushing and calling, information contents to be sent are directly edited, and corresponding user information is imported into the system, so that a mode of batch pushing and calling can be realized.
For example, with the development of products, messages need to be pushed to an offline iphone mobile phone to guide users to activate the products, but the pushing efficiency is very low in many times, and only can be pushed one by one, if 10 ten thousand messages are to be pushed, the whole process takes a long time, and if many threads or processes are started to push, many hardware resources are occupied, unnecessary waste is caused, and information of many users fails, the system cannot automatically recognize the messages, or the messages can be repeatedly pushed, so that the efficiency is low, and a large amount of hardware and software resources are occupied.
Therefore, there is a need to design a good method for fast bulk pushing to overcome the above problems.
[ summary of the invention ]
Aiming at the problems in the background art, the invention aims to provide a method for fast large-batch pushing, which avoids repeated pushing by timely cleaning invalid user token information so as to improve the pushing success rate.
In order to achieve the purpose, the invention adopts the following technical means:
a method for pushing mass quickly, which sends the information to be pushed to each user of the system, includes the following steps: s101: when a user logs in, acquiring a push token of the user, forming an array by the push token of the user needing to be pushed, and putting pushed information into a variable; s102: connecting the corresponding push server and the push feedback server, and reading the invalid push token from the push feedback server; s103: circularly taking out the push token, recording the id of an array corresponding to the push token into a variable, constructing a failed push token list and a non-failed push token list, skipping pushing if the token is in the failed push token list, sending asynchronous messages to a service server, clearing user token information corresponding to the failed token, wherein the failed token does not exist in next pushing, and if the token is in the non-failed push token list, encoding the corresponding non-failed token and the message in a mode of $ msg ═ pack ("C", 1) · pack ("N", serial number) · pack ("N", expiration time) · pack ("N", 32) · pack ('H', str _ replay (",", token)). pack ("N", strlen (message)); s104: and sending the coded token and the message which are not invalid correspondingly to a push server, correspondingly sending the message to each user by the push server, if the push fails, continuously sending an asynchronous message to a service server, and cleaning the user token information corresponding to the invalid token from the service server.
Further, in S104, before the information is pushed by the push server, the push feedback server is connected to retrieve the failed token.
Further, in S104, if the connection is disconnected during the process of pushing the information through the push server, the push server needs to be reconnected in time, and the information is pushed again from the push position recorded in the previous time.
Further, in S103, the tokens to be pushed are bucketed according to the rule of the hardware, and are pushed together by a plurality of threads.
Compared with the prior art, the invention has the following beneficial effects:
the method for fast pushing in large batch sends the information to be pushed to each user of the system, connects the corresponding push server and the push feedback server, and reads the invalid push token from the push feedback server; circularly taking out the push token, recording the id of the array corresponding to the push token into a variable, constructing a failed push token list and a non-failed push token list, skipping pushing if the token is in the failed push token list, sending asynchronous messages to a service server, clearing user token information corresponding to the failed token, and if the token is in the non-failed push token list, encoding the corresponding non-failed token and the message in a mode of $ msg ═ pack ("C", 1) · pack ("N", serial number) · pack ("N", expiration time), pack ("N", 32) · pack ('H', str _ replay (",", token)). pack ("N", strlen (message)), and encapsulating the pushed message strictly according to a format, so that the push success rate can be ensured, and sending the coded token and the message which are not invalid correspondingly to a push server, correspondingly sending the message to each user by the push server, if the push fails, continuously sending an asynchronous message to a service server, and cleaning the user token information corresponding to the invalid token from the service server, so that the invalid token can be prevented from being repeatedly pushed, and unnecessary waste caused by occupation of too much hardware resources is avoided, thereby improving the push success rate and efficiency.
[ description of the drawings ]
Fig. 1 is a flowchart illustrating a fast mass pushing method according to the present invention by using an apple system as an example.
[ detailed description ] embodiments
For a better understanding of the objects, structure, features, and functions of the invention, reference should be made to the drawings and detailed description that follow.
Referring to fig. 1, the purpose of the present invention is how to push a large amount of messages to the user's mobile phone quickly and accurately, so as to guide the user to activate the product. The method can be applied to various app classes, such as user push for an iphone platform or user push for an android system, as long as corresponding user token information can be acquired, and fig. 1 is a flow diagram illustrated by an apple system.
Referring to fig. 1, a method for fast mass pushing information to be pushed to each user of a system includes the following steps:
s101: when a user logs in, the push token of the user is obtained, the push token of the user needs to be pushed to form an array, pushed information is put into a variable, overall planning is conducted on the user, follow-up pushing is facilitated, planning is conducted in an early stage, and pushing feedback of a system in a later stage is fast.
S102: and connecting the corresponding push server and the push feedback server, reading the failed push token from the push feedback server, wherein the push server performs a push function for subsequent information, and the information of the failed token can be acquired by the setting of the push feedback server.
S103: circularly taking out the push token, recording the id of the array corresponding to the push token into a variable, constructing a failed push token list and a non-failed push token list, skipping pushing if the token is in the failed push token list, sending asynchronous messages to a service server, clearing user token information corresponding to the failed token, wherein the failed token does not exist in next pushing, and if the token is in the non-failed push token list, encoding the corresponding non-failed token and message in a mode of $ msg ═ pack ("C", 1) · pack ("N", sequence number) · pack ("N", expiration time) · pack ("N", 32) · pack ('H', str _ replay (",", token)). pack ("N", strlen (message)). The method comprises the steps of dividing tokens to be pushed into buckets according to the rule of hardware, and pushing the tokens together through a plurality of threads, wherein in the pushing mode, when 10 ten thousand messages need to be pushed, the tokens can be pushed in 3 minutes through one host computer under the condition that 4 threads are opened, so that the user experience is very good. Meanwhile, the pushing method can form a single service module, and public calling is facilitated.
S104: and sending the coded token and the message which are not invalid correspondingly to a push server, correspondingly sending the message to each user by the push server, if the push fails, continuously sending an asynchronous message to a service server, and cleaning the user token information corresponding to the invalid token from the service server. Before information is pushed through the push server, the push feedback server is connected, the latest invalid token is obtained again, and the problem that the information is not updated timely is solved. If the connection is disconnected in the process of pushing the information through the pushing server, the pushing server needs to be reconnected in time, and the information is pushed again from the pushing position recorded at the previous time, so that repeated pushing is avoided, a user is bored, and the speed can be increased.
Referring to fig. 1, in the method for fast pushing in large batch, information to be pushed is sent to each user of the system, a corresponding push server and a push feedback server are connected, and a failed push token is read from the push feedback server; circularly taking out the push token, recording the id of the array corresponding to the push token into a variable, constructing a failed push token list and a non-failed push token list, skipping pushing if the token is in the failed push token list, sending asynchronous messages to a service server, clearing user token information corresponding to the failed token, and if the token is in the non-failed push token list, encoding the corresponding non-failed token and the message in a mode of $ msg ═ pack ("C", 1) · pack ("N", serial number) · pack ("N", expiration time), pack ("N", 32) · pack ('H', str _ replay (",", token)). pack ("N", strlen (message)), and encapsulating the pushed message strictly according to a format, so that the push success rate can be ensured, and sending the coded token and the message which are not invalid correspondingly to a push server, correspondingly sending the message to each user by the push server, if the push fails, continuously sending an asynchronous message to a service server, and cleaning the user token information corresponding to the invalid token from the service server, so that the invalid token can be prevented from being repeatedly pushed, and unnecessary waste caused by occupation of too much hardware resources is avoided, thereby improving the push success rate and efficiency.
A large-batch fast push algorithm may be applied to the example of a biting doll:
firstly, obtaining a token list of active users in the latest 30 days, forming an array, then preparing the file information to be pushed, putting the file information into a variable, then connecting a corresponding push server and a push feedback server, reading invalid push tokens by the push feedback server, circularly taking out the push tokens, skipping pushing if the invalid push tokens are invalid, sending asynchronous messages to a service server, clearing the user token information corresponding to the invalid tokens, coding the push tokens and the file information if the invalid push tokens are valid, and finally sending a request to the push server, wherein 100 ten thousand users can finish pushing in a half hour.
The above detailed description is only for the purpose of illustrating the preferred embodiments of the present invention, and not for the purpose of limiting the scope of the present invention, therefore, all technical changes that can be made by applying the present specification and drawings are included in the scope of the present invention.

Claims (4)

1. A method for pushing mass quickly, which sends the information to be pushed to each user of the system, is characterized in that the method comprises the following steps:
s101: when a user logs in, acquiring a push token of the user, forming an array by the push token of the user needing to be pushed, and putting pushed information into a variable;
s102: connecting the corresponding push server and the push feedback server, and reading the invalid push token from the push feedback server;
s103: circularly taking out the push token, recording the id of an array corresponding to the push token into a variable, constructing a failed push token list and a non-failed push token list, skipping pushing if the token is in the failed push token list, sending asynchronous messages to a service server, clearing user token information corresponding to the failed token, wherein the failed token does not exist in next pushing, and if the token is in the non-failed push token list, encoding the corresponding non-failed token and the message in a mode of $ msg ═ pack ("C", 1) · pack ("N", serial number) · pack ("N", expiration time) · pack ("N", 32) · pack ('H', str _ replay (",", token)). pack ("N", strlen (message));
s104: and sending the coded token and the message which are not invalid correspondingly to a push server, correspondingly sending the message to each user by the push server, if the push fails, continuously sending an asynchronous message to a service server, and cleaning the user token information corresponding to the invalid token from the service server.
2. A method of fast bulk pushing according to claim 1 wherein: and S104, before the information is pushed through the push server, connecting the push feedback server, and reacquiring the failed token.
3. A method of fast bulk pushing according to claim 1 wherein: in S104, if the connection is disconnected during the process of pushing the information through the push server, the push server needs to be reconnected in time, and the information is pushed again from the push position recorded in the previous time.
4. A method of fast bulk pushing according to claim 1 wherein: in S103, the tokens to be pushed are bucketized according to the rule of the hardware, and are pushed together through a plurality of threads.
CN201911121587.0A 2019-11-15 2019-11-15 Method for rapidly pushing in large batch Active CN110691146B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911121587.0A CN110691146B (en) 2019-11-15 2019-11-15 Method for rapidly pushing in large batch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911121587.0A CN110691146B (en) 2019-11-15 2019-11-15 Method for rapidly pushing in large batch

Publications (2)

Publication Number Publication Date
CN110691146A true CN110691146A (en) 2020-01-14
CN110691146B CN110691146B (en) 2022-09-06

Family

ID=69116869

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911121587.0A Active CN110691146B (en) 2019-11-15 2019-11-15 Method for rapidly pushing in large batch

Country Status (1)

Country Link
CN (1) CN110691146B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112954018A (en) * 2021-01-28 2021-06-11 北京奇艺世纪科技有限公司 Information processing method and device, electronic equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102299955A (en) * 2010-06-28 2011-12-28 三星电子株式会社 Image device, receiving method of contents, server and providing method of contents
CN103516588A (en) * 2012-06-30 2014-01-15 北京神州泰岳软件股份有限公司 Method and system of background processing of client-side
CN107086954A (en) * 2017-05-23 2017-08-22 北京奇虎科技有限公司 Information push method and device
CN109658065A (en) * 2018-12-19 2019-04-19 河南牧业经济学院 A kind of Human Resource Management System
CN109905312A (en) * 2017-12-08 2019-06-18 北京新媒传信科技有限公司 Information push method, apparatus and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102299955A (en) * 2010-06-28 2011-12-28 三星电子株式会社 Image device, receiving method of contents, server and providing method of contents
CN103516588A (en) * 2012-06-30 2014-01-15 北京神州泰岳软件股份有限公司 Method and system of background processing of client-side
CN107086954A (en) * 2017-05-23 2017-08-22 北京奇虎科技有限公司 Information push method and device
CN109905312A (en) * 2017-12-08 2019-06-18 北京新媒传信科技有限公司 Information push method, apparatus and system
CN109658065A (en) * 2018-12-19 2019-04-19 河南牧业经济学院 A kind of Human Resource Management System

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
FEMINER: "基于Codeigniter框架实现的APNS批量推送", 《博客园》 *
WEIXIN_30911809: "基于Codeigniter框架实现的APNS批量推送", 《CSDN》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112954018A (en) * 2021-01-28 2021-06-11 北京奇艺世纪科技有限公司 Information processing method and device, electronic equipment and readable storage medium

Also Published As

Publication number Publication date
CN110691146B (en) 2022-09-06

Similar Documents

Publication Publication Date Title
US9282443B2 (en) Short message service (SMS) message segmentation
CN110691146B (en) Method for rapidly pushing in large batch
CN104580310A (en) Log processing method and server
CN112785408A (en) Account checking method and device based on Hash
TW201733312A (en) Automatic fusing-based message sending method, device and system
CN114092252A (en) Block chain transaction execution method, device, equipment and readable storage medium
CN114189818B (en) Message sending method, device, server and storage medium
CN111314737B (en) Video transcoding method and device
CN114676205A (en) Event information processing method and device
CN113485952A (en) Data batch transmission method and device
CN104731564A (en) Generation method and device for system interface call records
CN105468443A (en) User matching method and device for social application software
CN110069533B (en) Event subscription method and device based on blockchain
CN111161072A (en) Block chain-based random number generation method, equipment and storage medium
CN113079387B (en) Remote video recording method, device, equipment and storage medium
CN114884936A (en) Data processing method, device, equipment and medium for terminal equipment
CN114942781A (en) Data format adaptation method and device for data reading
CN111949901A (en) Method and system for acquiring marketing records based on dynamic two-dimensional codes
CN113342811A (en) HBase table data processing method and device
CN112732660A (en) Intervention type file transmission method, device and system
CN110970038B (en) Voice decoding method and device
CN115174578B (en) Kubernetes-based on-demand parallel transcoding method, device and storage medium
CN117527833B (en) Data synchronization method
CN103905519B (en) Method for reading data and electronic equipment
CN117435128A (en) Cloud CAD file storage method, device, equipment and medium based on command stream

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