CN107196848B - Information push method and device - Google Patents

Information push method and device Download PDF

Info

Publication number
CN107196848B
CN107196848B CN201710321261.7A CN201710321261A CN107196848B CN 107196848 B CN107196848 B CN 107196848B CN 201710321261 A CN201710321261 A CN 201710321261A CN 107196848 B CN107196848 B CN 107196848B
Authority
CN
China
Prior art keywords
client
message
push
shared drive
push message
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
CN201710321261.7A
Other languages
Chinese (zh)
Other versions
CN107196848A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201710321261.7A priority Critical patent/CN107196848B/en
Publication of CN107196848A publication Critical patent/CN107196848A/en
Application granted granted Critical
Publication of CN107196848B publication Critical patent/CN107196848B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/21Monitoring or handling of messages
    • H04L51/214Monitoring or handling of messages using selective forwarding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/04Real-time or near real-time messaging, e.g. instant messaging [IM]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/48Message addressing, e.g. address format or anonymous messages, aliases
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/56Unified messaging, e.g. interactions between e-mail, instant messaging or converged IP messaging [CPM]
    • 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

Abstract

The present invention relates to field of communication technology, a kind of information push method and device are disclosed.The present invention will be stored in for the message to be sent of client in shared drive in advance, and when PUSH message, multiple processes read message from shared drive simultaneously and the message of reading is sent to corresponding client;The reading speed of shared drive is faster than database reading speed, and multiple processes read and send message simultaneously in addition, thus can promote the efficiency of message push.The present invention reads the speed of message in order to improve from shared drive, when storing message into shared drive, message is classified, each client of each process can inquire message to be sent from determining shared drive block, seeking scope can be reduced in this way, and each client is avoided to search required message in all message.

Description

Information push method and device
Technical field
The present invention relates to field of communication technology, more particularly to a kind of information push method and device.
Background technology
Message push technology comes into being with the rapid development of mobile Internet.Message push technology refers to, for Family is purposive by information active push to user to the particular demands of information.Generally use server-client mechanism, by Information is actively pushed to client by server.Therefore, push technology is actually before information is automatically sent to user plane Technology realizes " information looks for user ".
In the prior art, to realize that a certain moment pushes real-time messages different from each other, Ke Yiyong to all online users One process traverses all users, needs the information and sending sent for each user by being calculated in real time, It the message computed in advance that be sent to user and can be stored in database (Database), when transmission is directed to each user The message to be sent is read from database to be sent.
Currently existing scheme can further increase in performance, calculate need the message content that sends in real time, although can be with Remove the storage consumption for storing all user's message contents to be sent from, but need to expend the regular hour, influences user's reception To the timeliness of message.The each user of calculated in advance message content to be sent is simultaneously stored in database and can be counted to avoid real-time The time loss of message content is calculated, but increases the time for reading message content from database simultaneously, message is received for user The influence of timeliness depends on the duration for calculating the duration of message content in real time and reading message content from database.By list into Journey traverse all users when, when number of users is very big, traversal take will gradually increase, the message pushed afterwards reach user when Effect property is poorer.And terminal user has strong requirement to the accuracy and promptness of PUSH message, but in the prior art simultaneously Can not achieve it is normal to message, push in time.
Invention content
The present invention provides a kind of information push method and device, be based on shared drive and multi-process technology, by mostly into Journey reads from shared drive message and be pushed to client simultaneously, solves the problems, such as message push not in time, realize efficiently, Real-time message push.The present invention reads the speed of message in order to improve from shared drive, and message is being stored into shared drive When, message is classified, each client of each process can inquire to be sent from determining shared drive block Message can reduce seeking scope in this way, and each client is avoided to search required message in all message.
The first aspect of the present invention provides a kind of information push method, including:
Obtain PUSH message and client id;
It determines the affiliated process of client id, and PUSH message and client id is stored in shared drive corresponding with the process In block;
When reaching the message push time, each process reads PUSH message from corresponding shared drive block simultaneously, according to PUSH message is sent to client corresponding with the client id by the correspondence of PUSH message and client id.
The second aspect of the present invention provides a kind of message pusher, including:
Data capture unit, for obtaining PUSH message and client id;
Data processing unit for determining the affiliated process of client id, and by PUSH message and client id deposit and is somebody's turn to do In the corresponding shared drive block of process;
Message push unit, for when reaching the message push time, each process to be simultaneously from corresponding shared drive block PUSH message is read to be sent to PUSH message and the client id according to the correspondence of PUSH message and client id Corresponding client.
The present invention will be stored in for the message to be sent of client in shared drive in advance, when PUSH message, Duo Gejin Journey reads message from shared drive simultaneously and the message of reading is sent to corresponding client;The reading speed ratio of shared drive Database reading speed is fast, and multiple processes read and send message simultaneously in addition, thus can promote the efficiency of message push.This Outside, when storing message, it is corresponding shared interior that the message to be sent for all clients for connecting same process is stored in the process In counterfoil, it can be traversed in all message to avoid each process and search required message, reduce message seeking scope, Message can be saved and search the time, realize efficient real-time messages push.
Description of the drawings
It in order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology and advantage, below will be to implementing Example or attached drawing needed to be used in the description of the prior art are briefly described, it should be apparent that, the accompanying drawings in the following description is only Only it is some embodiments of the present invention, for those of ordinary skill in the art, without creative efforts, It can also be obtained according to these attached drawings other attached drawings.
Fig. 1 is the exemplary system architecture figure of information push method and device provided in an embodiment of the present invention;
Fig. 2 is the frame construction drawing of information push method and device provided in an embodiment of the present invention;
Fig. 3 is the flow chart of information push method provided in an embodiment of the present invention;
Fig. 4 is the flow chart of information push method provided in an embodiment of the present invention;
Fig. 5 is a kind of flow chart of the method for message push provided in an embodiment of the present invention;
Fig. 6 is the flow chart of the method for another message push provided in an embodiment of the present invention;
Fig. 7 is the structure diagram of message pusher provided in an embodiment of the present invention;
Fig. 8 is the structural schematic diagram of the server provided in an embodiment of the present invention for being used for realizing the embodiment of the present invention.
Specific implementation mode
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people The every other embodiment that member is obtained without making creative work should all belong to the model that the present invention protects It encloses.
It should be noted that term " first " in description and claims of this specification and above-mentioned attached drawing, " Two " etc. be for distinguishing similar object, without being used to describe specific sequence or precedence.It should be appreciated that using in this way Data can be interchanged in the appropriate case, so as to the embodiment of the present invention described herein can in addition to illustrating herein or Sequence other than those of description is implemented.In addition, term " comprising " and " having " and their any deformation, it is intended that cover It includes to be not necessarily limited to for example, containing the process of series of steps or unit, method, system, product or equipment to cover non-exclusive Those of clearly list step or unit, but may include not listing clearly or for these processes, method, product Or the other steps or unit that equipment is intrinsic.
Fig. 1 is the exemplary system architecture figure of information push method and device provided in an embodiment of the present invention.The system Framework may include terminal device 200, network 300 and server 100.Network 300 is in terminal device 200 and server The medium of communication link is provided between 100.Network 300 may include various connection types, for example, wired, wireless communication link or Person's fiber optic cables etc..User can be interacted by network 300 with server 100 with using terminal equipment 200, to receive or send Message etc..Various client applications can be installed on terminal device 200, for example, game class application, web browser applications, Class of doing shopping application, searching class application, instant messaging tools, mailbox client, social platform software etc..
Terminal device 200 can be the various electronic equipments for having display screen, including but not limited to smart mobile phone, tablet electricity Brain, pocket computer and desktop computer etc..Server 100 can be to provide the server of various services, for example, to terminal The application installed in equipment 200 provides the server that high in the clouds data are supported and high in the clouds is handled.Cloud server can be to corresponding whole The PUSH message at end is handled, and PUSH message is fed back to terminal device.
It should be noted that the information push method that the embodiment of the present application is provided can be set by server 100 and terminal Standby 200 in conjunction with executing.
It should be understood that the number of the terminal device, network and server in Fig. 1 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
Fig. 2 is the frame construction drawing of information push method and device provided in an embodiment of the present invention, is applicable to realize certain One moment pushed the application scenarios of real-time messages different from each other to all online users.In figure, 110 be shared drive, and 120 are The multi-process of PUSH message, 130 be subscription client, and multiple subscription clients are connected in each process, and shared drive is drawn It is divided into multiple shared drive blocks, each process configures a shared drive block, and the message of all subscription clients is all deposited in process It is stored in the corresponding shared drive block of the process, in this way, when needing to client push message, each process is in the same time Respectively message is obtained from corresponding shared drive block, the client being then sent in process saves message with this The time is pushed, information push efficiency is improved.
Embodiment 1
Fig. 3-5 is referred to, the present embodiment provides a kind of information push methods.This method includes:
S301:Obtain PUSH message and client id.
Using in the process, the message largely interacted with server can be related to, these message can be that client passes through Server is sent to the instant messaging between each client in other clients, such as game application, can also be server It is generated according to client application behaviour in service, such as the ranking ranking in game application.The present embodiment is with push server institute The PUSH message of generation illustrates, and in order to which these PUSH messages are accurately pushed to corresponding client, is pushed obtaining It needs to obtain the corresponding client id of the PUSH message, the push that server is generated according to client application while message For message, needs to obtain PUSH message and receive the client id of the PUSH message, client id is unique mark client The identifier at end can be user name.
S302:Determine the affiliated process of client id, and PUSH message and client id deposit is corresponding with the process total It enjoys in memory block.
Each process is connected with multiple client, and system is about set to each course allocation process ID, should to unique mark Process, and shared drive block ID is distributed for each shared drive block, it is basic herein to the unique mark shared drive block On, further establishing has the mapping relations of process ID and client id and the mapping relations of process ID and shared memory block ID; By the mapping relations of query procedure ID and client id, the corresponding process ID of client id can be searched, knows client id Affiliated process, and then according to the mapping relations of process ID and shared memory block ID can search to obtain process ID corresponding shared Memory block ID knows the corresponding shared drive block of process ID, and then can be by PUSH message and client id deposit and the client It holds in the corresponding shared drive block of the affiliated processes of ID.
S303:When reaching the message push time, each process reads PUSH message from corresponding shared drive block simultaneously, According to the correspondence of PUSH message and client id, PUSH message is sent to client corresponding with the client id.
When reaching the message push time, server can generate message push instruction, trigger each process simultaneously from respective PUSH message is read in corresponding shared drive block, and according to the correspondence of PUSH message and client id, by PUSH message It is sent in client corresponding with client id.The process of each process PUSH message is mutual indepedent and is carried out at the same time, under Face is specifically described the process of PUSH message by taking individual process PUSH message as an example.
It is corresponding in shared drive block to store PUSH message and client id, when PUSH message, can be with PUSH message It is leading to be pushed, can also be leading progress message push with client id.The present embodiment is leading execute with PUSH message Message pushes, including:Shared drive PUSH message in the block is read one by one, is closed according to PUSH message is corresponding with client id System, client corresponding with the client id is sent to by PUSH message, until push all in shared drive block is disappeared Breath is all pushed to corresponding client.Fig. 5 specifically is referred to, the process of individual process PUSH message includes the following steps:
S501:Read shared drive PUSH message in the block.
When reading shared drive PUSH message in the block, it can be carried out in shared drive storage location in the block according to message Sequence is read, and is read first PUSH message of position since shared drive block, is disappeared until reading the last item push Breath.
S502:According to the correspondence of PUSH message and client id, PUSH message is sent to and the client id Corresponding client.
After often reading a PUSH message, is found according to the correspondence of the PUSH message and client id and receive the push PUSH message is sent to corresponding client by the client id of the client of message according to client id.
S503:Judge whether the PUSH message of processing is the last item PUSH message, if so, illustrating that shared drive is in the block All PUSH messages all distribute completion, can terminate flow, if it is not, illustrating that there is the push not sent in shared drive block disappears Breath, then repeatedly S501-S503, continues to read and send next PUSH message, until all by what is stored in shared drive block PUSH message is all distributed one time.
Preferably, before step S301, further include:
S401:Multiple processes are established, each process connects multiple client.
S402:The client id for being connected to the client in each process is obtained, client id and the client id institute are established Mapping relations between the process ID of category process.
S403:Memory block is shared for each course allocation one.
S404:Establish the mapping between the shared drive block ID of the process ID shared drive block corresponding with the process of process Relationship.
The present embodiment will be stored in for the message to be sent of client in shared drive in advance, multiple when PUSH message Process reads message from shared drive simultaneously and the message of reading is sent to corresponding client;The reading speed of shared drive Faster than database reading speed, multiple processes read and send message simultaneously in addition, thus can promote the efficiency of message push. In addition, when storing message, it is corresponding shared that the message to be sent for all clients for connecting same process is stored in the process In memory block, it can be traversed in all message to avoid each process and search required message, reduced message and search model It encloses, message can be saved and search the time, realize efficient real-time messages push.
Embodiment 2
The present embodiment provides a kind of information push method, it is suitable for server to different real-time of each client push content Message.This method includes pretreatment process and message push flow, and wherein pretreatment process includes the following steps:
S401, multiple processes are established, each process connects multiple client.
System is the process ID of each course allocation in multi-process, to the unique mark process.Each client With client id, client id is the identifier of unique mark client, can be user name.
S402, acquisition are connected to the client id of the client in each process, establish client id and the client id institute Mapping relations between the process ID of category process.
S403, memory block is shared for each course allocation one.
Shared drive is divided into multiple shared drive blocks, and system is that each shared drive block distributes shared drive block ID, To the unique mark shared drive block.Each process corresponds to a shared drive block, the shared drive block can store this into The PUSH message of all clients connected in journey.
S404, the process ID for establishing process shared drive block corresponding with the process shared drive block ID between mapping Relationship.
Further, message push flow includes the following steps:
S301:Obtain PUSH message and client id.
Using in the process, the message largely interacted with server can be related to, these message can be that client passes through Server is sent to the instant messaging between each client in other clients, such as game application, can also be server It is generated according to client application behaviour in service, such as the ranking ranking in game application.The present embodiment is with push server institute The PUSH message of generation illustrates, and in order to which these PUSH messages are accurately pushed to corresponding client, is pushed obtaining It needs to obtain the corresponding client id of the PUSH message, the push that server is generated according to client application while message For message, needs to obtain PUSH message and receive the client id of the PUSH message.
S302:Determine the affiliated process of client id, and PUSH message and client id deposit is corresponding with the process total It enjoys in memory block.
According to the mapping relations of process ID and client id, the corresponding process ID of client id can be searched, knows client The affiliated processes of ID are held, and then according to the mapping relations of process ID and shared memory block ID, can search to obtain process ID corresponding Shared drive block ID is known the corresponding shared drive block of process ID, and then by PUSH message and client id deposit and can be somebody's turn to do In the corresponding shared drive block of the affiliated process of client id.
S303:When reaching the message push time, each process reads PUSH message from corresponding shared drive block simultaneously, According to the correspondence of PUSH message and client id, PUSH message is sent to client corresponding with the client id.
When reaching the message push time, server can generate message push instruction, trigger each process simultaneously from respective PUSH message is read in corresponding shared drive block, and according to the correspondence of PUSH message and client id, by PUSH message It is sent in client corresponding with client id.The process of each process PUSH message is mutual indepedent and is carried out at the same time, under Face is specifically described the process of PUSH message by taking individual process PUSH message as an example.
It is corresponding in shared drive block to store PUSH message and client id, when PUSH message, can be with PUSH message It is leading to be pushed, can also be leading progress message push with client id.The present embodiment with client id be dominate into Row message pushes, and includes the following steps:
S601, acquisition are connected to the client id of the client in process.
According to the client id list for the client being connected in process, from first client in client id list ID starts to obtain client id backward one by one.
S602, PUSH message corresponding with the client id is read from the corresponding shared drive block of process.
According to the client id of acquisition, lookup and client from shared drive block corresponding with the affiliated process of client id The corresponding PUSH messages of ID execute S603 if finding the corresponding PUSH message of client id, if not finding visitor The corresponding PUSH messages of family end ID, then execute S605.
S603, the PUSH message is sent to client corresponding with the client id.
S604, judge whether the client id is the last one client id in client id list, if it is not, then holding Row S605, if so, terminating flow.
S605, the client id for obtaining next client, and S602-S604 is repeated, until all clients The PUSH message of ID is all sent.
The present embodiment, according to the correspondence of client id and process ID, is found belonging to client id when storing message Process, and according to the correspondence of process ID and shared drive ID, the corresponding shared drive block of process is found, and then will connect same The message to be sent of all clients of one process is stored in the corresponding shared drive block of the process, can to avoid each process from Traversal searches required message in all message, reduces message seeking scope, can save message and search the time, realize Efficient real-time messages push.
In PUSH message, multiple processes read message from shared drive simultaneously and are sent to the message of reading corresponding Client;The reading speed of shared drive is faster than database reading speed, and multiple processes read and send simultaneously message in addition, because And the efficiency of message push can be promoted.
It should be noted that for each method embodiment above-mentioned, for simple description, therefore it is all expressed as a series of Combination of actions, but those skilled in the art should understand that, the present invention is not limited by the described action sequence because According to the present invention, certain steps can be performed in other orders or simultaneously.Secondly, those skilled in the art should also know It knows, embodiment described in this description belongs to preferred embodiment, and involved action and module are not necessarily of the invention It is necessary.
Through the above description of the embodiments, those skilled in the art can be understood that according to above-mentioned implementation The method of example can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but it is very much In the case of the former be more preferably embodiment.Based on this understanding, technical scheme of the present invention is substantially in other words to existing The part that technology contributes can be expressed in the form of software products, which is stored in a storage In medium (such as ROM/RAM, magnetic disc, CD), including some instructions are used so that a station terminal equipment (can be mobile phone, calculate Machine, server or network equipment etc.) execute method described in each embodiment of the present invention.
Embodiment 3
Referring to FIG. 7, to realize method shown in above-described embodiment 1 and embodiment 2, the present invention provides a kind of message to push away The embodiment of device is sent, the device is corresponding with Fig. 3 and embodiment of the method shown in Fig. 4.
As shown in fig. 7, the message pusher 70 of the present embodiment includes data capture unit 75,76 and of data processing unit Message push unit 77.
Data capture unit 75, for obtaining PUSH message and client id;
Data processing unit 76, for determining the affiliated process of client id, and by PUSH message and client id deposit with In the corresponding shared drive block of the process;
Message push unit 77, for making each process read PUSH message from corresponding shared drive block simultaneously, according to PUSH message is sent to client corresponding with the client id by the correspondence of PUSH message and client id.
Further, the message pusher 70 further includes that process creation unit 71, the first mapping relations establish unit 72, allocation unit 73 and the second mapping relations establish unit 74.Wherein,
Process creation unit 71, for establishing multiple processes, each process connects multiple client;
First mapping relations establish unit 72, the client id for obtaining the client being connected in each process, establish Mapping relations between client id and the process ID of the affiliated process of the client id;
Allocation unit 73, for sharing memory block for each course allocation one;
Second mapping relations establish unit 74, the shared drive block corresponding with the process of the process ID for establishing process Mapping relations between shared drive block ID.
The data processing unit 76 includes the first searching module 761, the second searching module as a preferred method, 762 and data processing module 763:
First searching module 761 searches the client id pair for the mapping relations according to client id and process ID The process ID answered;
Second searching module 762 searches the process ID for the mapping relations according to process ID and shared memory block ID Corresponding shared drive block ID;
Data processing module 763, for the PUSH message and client id deposit is corresponding with the shared drive block ID Shared drive block in.
The message push unit 77 includes first message pushing module 771 and second message as a preferred method, Pushing module 772.
First message pushing module 771, for one by one read shared drive PUSH message in the block, according to PUSH message with PUSH message is sent to client corresponding with the client id by the correspondence of client id, until by shared drive All PUSH messages are all pushed to corresponding client in block.
Second message pushing module 772, for obtaining the client id for being connected to the client in process;It is corresponded to from process Shared drive block in read corresponding with client id PUSH message, the PUSH message is sent to and the client Hold the corresponding clients of ID;Judge whether the client id is the last one client id, if so, terminating pushing away for PUSH message It send, if it is not, carrying out the push of PUSH message to next client.
Further, the second message pushing module 772 is additionally operable to:If do not had from the corresponding shared drive block of process PUSH message corresponding with the client id is read, judges whether the client id is the last one client id, If so, terminating the push of PUSH message, if it is not, carrying out the push of PUSH message to next client.
In the present embodiment, it will be stored in shared drive for the message to be sent of client in advance, it is more when PUSH message A process reads message from shared drive simultaneously and the message of reading is sent to corresponding client;The reading speed of shared drive Degree is faster than database reading speed, and multiple processes read and send message simultaneously in addition, thus can promote the effect of message push Rate.In addition, when storing message, it is corresponding total that the message to be sent for all clients for connecting same process is stored in the process It enjoys in memory block, can be traversed in all message to avoid each process and search required message, reduce message lookup Range can save message and search the time, realize efficient real-time messages push.It solves and works as the more situation of client terminal quantity Under, the problem of giving each client push real-time messages different from each other as soon as possible.
Embodiment 4
Below with reference to Fig. 8, it illustrates the calculating suitable for terminal device or server to realize the embodiment of the present invention The structural schematic diagram of machine system.
As shown in figure 8, computer system 900 includes central processing unit (CPU) 901, it can be read-only according to being stored in Program in memory (ROM) 902 or be loaded into the program in random access storage device (RAM) 903 from storage section 908 and Execute various actions appropriate and processing.In RAM903, also it is stored with system 900 and operates required various programs and data. CPU901, ROM902 and RAM903 are connected with each other by bus 904.Input/output (I/O) interface 905 is also connected to bus 904。
It is connected to I/O interfaces 905 with lower component:Importation 906 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 907 of spool (CRT), liquid crystal display (LCD) etc. and loud speaker etc.;Storage section 908 including hard disk etc.; And the communications portion 909 of the network interface card including LAN card, modem etc..Communications portion 909 via such as because The network of spy's net executes communication process.Driver 910 is also according to needing to be connected to I/O interfaces 905.Detachable media 911, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on driver 910, as needed in order to be read from thereon Computer program be mounted into storage section 908 as needed.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be tangibly embodied in machine readable Computer program on medium, the computer program include the program code for method shown in execution flow chart.At this In the embodiment of sample, which can be downloaded and installed by communications portion 909 from network, and/or from removable Medium 911 is unloaded to be mounted.
Flow chart in attached drawing and block diagram, it is illustrated that according to the system of the various embodiments of the application, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part for a part for one module, program segment, or code of table, the module, program segment, or code includes one or more Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical On can be basically executed in parallel, they can also be executed in the opposite order sometimes, this is depended on the functions involved.Also it wants It is noted that the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart, Ke Yiyong The dedicated hardware based system of defined functions or operations is executed to realize, or can be referred to specialized hardware and computer The combination of order is realized.
Being described in unit involved in the embodiment of the present application can be realized by way of software, can also be by hard The mode of part is realized.Described unit can also be arranged in the processor, for example, can be described as:A kind of processor packet Include receiving module, detection module and processing module.Wherein, the title of these modules is not constituted under certain conditions to the module The restriction of itself.
As on the other hand, present invention also provides a kind of nonvolatile computer storage media, the non-volatile calculating Machine storage medium can be nonvolatile computer storage media included in device described in above-described embodiment;Can also be Individualism, without the nonvolatile computer storage media in supplying terminal.Above-mentioned nonvolatile computer storage media is deposited One or more program is contained, when one or more of programs are executed by an equipment so that the equipment executes Operational order below:
Obtain PUSH message and client id;
It determines the affiliated process of client id, and PUSH message and client id is stored in shared drive corresponding with the process In block;
When reaching the message push time, each process reads PUSH message from corresponding shared drive block simultaneously, according to PUSH message is sent to client corresponding with the client id by the correspondence of PUSH message and client id.
Further, before the acquisition PUSH message and client id, further include:
Multiple processes are established, each process connects multiple client;
The client id for being connected to the client in each process is obtained, client id and the affiliated process of the client id are established Process ID between mapping relations;
Memory block is shared for each course allocation one;
Establish the mapping relations between the shared drive block ID of the process ID shared drive block corresponding with the process of process.
Further, the affiliated process of determining client id, and PUSH message and client id are stored in and the process In corresponding shared drive block, including:
According to the mapping relations of client id and process ID, the corresponding process ID of the client id is searched;
According to the mapping relations of process ID and shared memory block ID, the corresponding shared drive block ID of the process ID is searched, The PUSH message and client id are stored in shared drive block corresponding with the shared drive block ID.
Optionally, the process reads PUSH message from corresponding shared drive block, according to PUSH message and client PUSH message is sent to client corresponding with the client id by the correspondence of ID, including:
Reading shared drive PUSH message in the block one by one will push away according to the correspondence of PUSH message and client id Message is sent to be sent to client corresponding with the client id, until PUSH message all in shared drive block is all pushed To corresponding client.
Optionally, the process reads PUSH message from corresponding shared drive block, according to PUSH message and client PUSH message is sent to client corresponding with the client id by the correspondence of ID, including:
Obtain the client id for being connected to the client in process;
PUSH message corresponding with the client id is read from the corresponding shared drive block of process,
The PUSH message is sent to client corresponding with the client id;
Judge whether the client id is the last one client id,
If so, terminating the push of PUSH message, if it is not, carrying out the push of PUSH message to next client.
Further, further include:If do not read and the client id from the corresponding shared drive block of process Corresponding PUSH message then judges whether the client id is the last one client id, if so, terminating pushing away for PUSH message It send, if it is not, carrying out the push of PUSH message to next client.
The present embodiment is based on shared drive and multi-process technology, reads message from shared drive simultaneously by multi-process and pushes away Client is given, solves the problems, such as message push not in time, realizes efficient, real-time message push.
Above description is only the preferred embodiment of the application and the explanation to institute's application technology principle.People in the art Member should be appreciated that invention scope involved in the application, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic Scheme, while should also cover in the case where not departing from the inventive concept, it is carried out by above-mentioned technical characteristic or its equivalent feature Other technical solutions of arbitrary combination and formation.Such as features described above has similar work(with (but not limited to) disclosed herein Can technical characteristic replaced mutually and the technical solution that is formed.

Claims (10)

1. a kind of information push method, which is characterized in that including:
Multiple processes are established, each process connects multiple client;
Obtain the client id for being connected to client in each process, establish client id and the affiliated process of the client id into Mapping relations between journey ID;
Memory block is shared for each course allocation one;
Establish the mapping relations between the shared drive block ID of the process ID shared drive block corresponding with the process of process;
Obtain PUSH message and client id;
It determines the affiliated process of client id, and PUSH message and client id is stored in shared drive block corresponding with the process In;
When reaching the message push time, each process reads PUSH message from corresponding shared drive block simultaneously, according to push PUSH message is sent to client corresponding with the client id by the correspondence of message and client id.
2. according to the method described in claim 1, it is characterized in that, the affiliated process of determining client id, and push is disappeared Breath and client id are stored in shared drive block corresponding with the process, including:
According to the mapping relations of client id and process ID, the corresponding process ID of the client id is searched;
According to the mapping relations of process ID and shared memory block ID, the corresponding shared drive block ID of the process ID is searched, by institute It states PUSH message and client id is stored in shared drive block corresponding with the shared drive block ID.
3. according to the method described in claim 1, it is characterized in that, the process reads push from corresponding shared drive block PUSH message is sent to visitor corresponding with the client id by message according to the correspondence of PUSH message and client id Family end, including:
Shared drive PUSH message in the block is read one by one push is disappeared according to the correspondence of PUSH message and client id Breath is sent to client corresponding with the client id, until PUSH message all in shared drive block is all pushed to phase The client answered.
4. according to the method described in claim 1, it is characterized in that, the process reads push from corresponding shared drive block PUSH message is sent to visitor corresponding with the client id by message according to the correspondence of PUSH message and client id Family end, including:
Obtain the client id for being connected to the client in process;
PUSH message corresponding with the client id is read from the corresponding shared drive block of process,
The PUSH message is sent to client corresponding with the client id;
Judge whether the client id is the last one client id,
If so, terminating the push of PUSH message, if it is not, carrying out the push of PUSH message to next client.
5. according to the method described in claim 4, it is characterized in that, the method further includes:
If not reading PUSH message corresponding with the client id from the corresponding shared drive block of process, judge Whether the client id is the last one client id,
If so, terminating the push of PUSH message, if it is not, carrying out the push of PUSH message to next client.
6. a kind of message pusher, which is characterized in that including:
Process creation unit, for establishing multiple processes, each process connects multiple client;
First mapping relations establish unit, and the client id for obtaining the client being connected in each process establishes client Mapping relations between ID and the process ID of the affiliated process of the client id;
Allocation unit, for sharing memory block for each course allocation one;
Second mapping relations establish unit, and sharing for the shared drive block corresponding with the process of the process ID for establishing process is interior Mapping relations between counterfoil ID;
Data capture unit, for obtaining PUSH message and client id;
Data processing unit is stored in and the process for determining the affiliated process of client id, and by PUSH message and client id In corresponding shared drive block;
Message push unit, for when reaching the message push time, each process to be read from corresponding shared drive block simultaneously PUSH message is sent to corresponding with the client id by PUSH message according to the correspondence of PUSH message and client id Client.
7. device according to claim 6, which is characterized in that the data processing unit includes:
First searching module, for according to the mapping relations of client id and process ID, search the client id it is corresponding into Journey ID;
It is corresponding to search the process ID for the mapping relations according to process ID and shared memory block ID for second searching module Shared drive block ID;
Data processing module, for the PUSH message and client id deposit is corresponding with the shared drive block ID shared interior In counterfoil.
8. device according to claim 6, which is characterized in that the message push unit includes:
First message pushing module, for reading shared drive PUSH message in the block one by one, according to PUSH message and client PUSH message is sent to client corresponding with the client id by the correspondence of ID, until by institute in shared drive block Some PUSH messages are all pushed to corresponding client.
9. device according to claim 6, which is characterized in that the message push unit includes:
Second message pushing module, for obtaining the client id for being connected to the client in process;It is corresponding shared from process PUSH message corresponding with the client id is read in memory block, and the PUSH message is sent to and the client id pair The client answered;Judge whether the client id is the last one client id, if so, terminate the push of PUSH message, if It is no, the push of PUSH message is carried out to next client.
10. device according to claim 9, which is characterized in that the second message pushing module is additionally operable to:If from into PUSH message corresponding with the client id is not read in the corresponding shared drive block of journey, judges that the client id is No is the last one client id, if so, terminating the push of PUSH message, if it is not, carrying out PUSH message to next client Push.
CN201710321261.7A 2017-05-09 2017-05-09 Information push method and device Active CN107196848B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710321261.7A CN107196848B (en) 2017-05-09 2017-05-09 Information push method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710321261.7A CN107196848B (en) 2017-05-09 2017-05-09 Information push method and device

Publications (2)

Publication Number Publication Date
CN107196848A CN107196848A (en) 2017-09-22
CN107196848B true CN107196848B (en) 2018-09-04

Family

ID=59873189

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710321261.7A Active CN107196848B (en) 2017-05-09 2017-05-09 Information push method and device

Country Status (1)

Country Link
CN (1) CN107196848B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110019671B (en) * 2017-11-07 2022-04-12 北京京东尚科信息技术有限公司 Method and system for processing real-time message
CN108536544B (en) * 2018-03-21 2021-06-25 微梦创科网络科技(中国)有限公司 Consumption method, device, server and medium based on database message queue
CN109508246A (en) * 2018-06-25 2019-03-22 广州多益网络股份有限公司 Log recording method, system and computer readable storage medium
CN110928702B (en) * 2018-09-20 2023-03-21 北京君正集成电路股份有限公司 Multi-process message communication system
CN111447205B (en) * 2020-03-24 2022-11-22 深信服科技股份有限公司 Data processing method, system and related equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014108030A1 (en) * 2013-01-09 2014-07-17 北京奇虎科技有限公司 Web polling method, device and system
CN105893073A (en) * 2015-12-11 2016-08-24 乐视网信息技术(北京)股份有限公司 Update method and system used for application program, and business server and pushing server used for updating application program
CN105915587A (en) * 2016-04-05 2016-08-31 网宿科技股份有限公司 Content push method, content push system and buffer memory server

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9003294B1 (en) * 2014-12-23 2015-04-07 FanActivate, LLC Scalable systems for change detection of statistic data feeds across multiple servers using shared memory with configurable messaging triggers

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014108030A1 (en) * 2013-01-09 2014-07-17 北京奇虎科技有限公司 Web polling method, device and system
CN105893073A (en) * 2015-12-11 2016-08-24 乐视网信息技术(北京)股份有限公司 Update method and system used for application program, and business server and pushing server used for updating application program
CN105915587A (en) * 2016-04-05 2016-08-31 网宿科技股份有限公司 Content push method, content push system and buffer memory server

Also Published As

Publication number Publication date
CN107196848A (en) 2017-09-22

Similar Documents

Publication Publication Date Title
CN107196848B (en) Information push method and device
CN104283926B (en) A kind of method of data synchronization, device and server
CN103634382B (en) A kind of system and method for realizing real-time, interactive on webpage
CN104243598B (en) A kind of information recommendation method and device
CN104836719A (en) Method and system for synchronizing instant communication unread messages
CN103095684B (en) Obtain and pay close attention to the method for user's aggregation information, Apparatus and system
CN101163117B (en) Packet management method, packet resource sharing method and instant communication equipment
CN107919971B (en) Method, apparatus and system for audio/video communication connection disaster tolerance
CN104821956B (en) Localization method and device based on electronic equipment or application
US11381463B2 (en) System and method for a generic key performance indicator platform
CN111970188B (en) Capability forwarding method and device
CN105100002B (en) The operating method and device of attribute
CN113110800A (en) Data processing method and device, electronic equipment and storage medium
CN114500633B (en) Data forwarding method, related device, program product and data transmission system
CN110019539A (en) A kind of method and apparatus that the data of data warehouse are synchronous
CN110391969A (en) Based on multimedia chat method and device, storage medium, electronic device
CN104168174A (en) Method and apparatus for information transmission
CN108540302B (en) Big data processing method and equipment
US20060020708A1 (en) System and method for peer-to-peer communication
CN104838624B (en) The method, apparatus and system that a kind of control business data forward in virtual network
CN109428774B (en) Data processing method of DPI equipment and related DPI equipment
CN109614603A (en) Method and apparatus for generating information
CN106408793B (en) A kind of Service Component sharing method and system suitable for ATM business
Yang et al. Replica placement in content delivery networks with stochastic demands and M/M/1 servers
CN105306337A (en) Method, device and system for sharing multi-people session file based on instant messaging

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