CN107196848A - Information push method and device - Google Patents
Information push method and device Download PDFInfo
- Publication number
- CN107196848A CN107196848A CN201710321261.7A CN201710321261A CN107196848A CN 107196848 A CN107196848 A CN 107196848A CN 201710321261 A CN201710321261 A CN 201710321261A CN 107196848 A CN107196848 A CN 107196848A
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L51/00—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
- H04L51/21—Monitoring or handling of messages
- H04L51/214—Monitoring or handling of messages using selective forwarding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L51/00—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
- H04L51/04—Real-time or near real-time messaging, e.g. instant messaging [IM]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L51/00—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
- H04L51/48—Message addressing, e.g. address format or anonymous messages, aliases
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L51/00—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
- H04L51/56—Unified messaging, e.g. interactions between e-mail, instant messaging or converged IP messaging [CPM]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/55—Push-based network services
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The present invention relates to communication technical field, a kind of information push method and device are disclosed.Message to be sent for client is stored in shared drive by the present invention in advance, during PUSH message, and multiple processes read message from shared drive simultaneously and send the message of reading to corresponding client;The reading speed of shared drive is faster than database reading speed, and multiple processes read and sent simultaneously message in addition, thus can lift the efficiency of message push.The present invention reads the speed of message in order to improve from shared drive, when toward storage message in shared drive, message is classified, each client of each process can inquire about message to be sent from the shared drive block of determination, seeking scope can so be reduced, it is to avoid each client searches required message in all message.
Description
Technical field
The present invention relates to communication technical field, more particularly to a kind of information push method and device.
Background technology
Message push technology arises at the historic moment with developing rapidly for mobile Internet.Message push technology refers to, for
Family is purposive by information active push to user to the particular demands of information.Server-client mechanism is generally used, by
Information is actively pushed to client by server.Therefore, push technology is actually and information is automatically sent to before user plane
Technology, that is, realize " 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 is traveled through to all users, obtains needing the information and sending of transmission for each user by calculating in real time,
It can be sent to user message with computed in advance and be stored in database (Database), each user is directed to during transmission
The message to be sent is read from database to be transmitted.
Currently existing scheme can be improved further in performance, the message content for needing to send be calculated in real time, although can be with
Remove the storage consumption for storing all users message content to be sent from, but need to expend the regular hour, influence user receives
To the ageing of message.The each user of calculated in advance message content to be sent and being stored in database can avoid meter in real time
The time loss of message content is calculated, but adds the time that message content is read from database simultaneously, message is received for user
Ageing influence depends on the duration for calculating the duration of message content in real time and message content being read from database.By singly entering
When journey travels through all users, when number of users is very big, traversal will be time-consuming gradually to be increased, 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 realize it is normal to message, push in time.
The content of the invention
The invention provides a kind of information push method and device, based on shared drive and multi-process technology, by entering more
Journey reads from shared drive and message and is pushed to client simultaneously, solves the problem of message is pushed not in time, realize efficiently,
Real-time message is pushed.The present invention reads the speed of message in order to improve from shared drive, toward storing message in shared drive
When, message is classified, each client of each process can inquire about to be sent from the shared drive block of determination
Message, can so reduce seeking scope, it is to avoid each client searches 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;
The affiliated process of client id is determined, and PUSH message and client id are 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
The corresponding relation of PUSH message and client id, PUSH message is sent to client corresponding with the 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 with being 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
Read PUSH message, according to PUSH message and the corresponding relation of client id, by PUSH message send to the client id
Corresponding client.
Message to be sent for client is stored in shared drive by the present invention in advance, during PUSH message, Duo Gejin
Journey reads message from shared drive simultaneously and sends the message of reading to corresponding client;The reading speed ratio of shared drive
Database reading speed is fast, and multiple processes read and sent simultaneously message in addition, thus can lift the efficiency of message push.This
Outside, when storing message, the message to be sent of all clients that same process will be connected be stored in the process it is corresponding it is shared in
In counterfoil, each process can be avoided to travel through the message required for searching in all message, message seeking scope is reduced,
Message can be saved and search the time, realize that efficient real-time messages are pushed.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art and advantage, below will be to implementing
The accompanying drawing used required in example or description of the prior art is briefly described, it should be apparent that, drawings in the following description are only
Only it is some embodiments of the present invention, for those of ordinary skill in the art, on the premise of not paying creative work,
Other accompanying drawings can also be obtained according to these accompanying drawings.
Fig. 1 is the exemplary system architecture figure of information push method provided in an embodiment of the present invention and device;
Fig. 2 is the frame construction drawing of information push method provided in an embodiment of the present invention and device;
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 the flow chart for the method that a kind of message provided in an embodiment of the present invention is pushed;
Fig. 6 is the flow chart for the method that another message provided in an embodiment of the present invention is pushed;
Fig. 7 is the structured flowchart of message pusher provided in an embodiment of the present invention;
Fig. 8 is the structural representation provided in an embodiment of the present invention for being used for realizing the server of the embodiment of the present invention.
Embodiment
In order that those skilled in the art more fully understand the present invention program, below in conjunction with the embodiment of the present invention
Accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is only
The embodiment of a part of the invention, rather than whole embodiments.Based on the embodiment in the present invention, ordinary skill people
The every other embodiment that member is obtained under the premise of creative work is not made, should all belong to the model that the present invention is protected
Enclose.
It should be noted that term " first " in description and claims of this specification and above-mentioned accompanying drawing, "
Two " etc. be for distinguishing similar object, without for describing specific order or precedence.It should be appreciated that so using
Data can exchange in the appropriate case, so as to embodiments of the invention described herein can with except illustrating herein or
Order beyond those of description is implemented.In addition, term " comprising " and " having " and their any deformation, it is intended that cover
Lid is non-exclusive to be included, for example, the process, method, system, product or the equipment that contain series of steps or unit are not necessarily limited to
Those steps or unit clearly listed, but may include not list clearly or for these processes, method, product
Or the intrinsic other steps of equipment or unit.
Fig. 1 is the exemplary system architecture figure of information push method provided in an embodiment of the present invention and device.The system
Framework can 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 can include various connection types, such as wired, wireless communication link or
Person's fiber optic cables etc..User can be interacted with using terminal equipment 200 by network 300 with server 100, 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, JICQ, mailbox client, social platform software etc..
Terminal device 200 can be the various electronic equipments with display screen, including but not limited to smart mobile phone, flat board 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 correspondence eventually
The PUSH message at end is handled, and PUSH message is fed back into 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 combine to perform.
It should be understood that the number of the terminal device, network and server in Fig. 1 is only schematical.According to realizing need
Will, can have any number of terminal device, network and server.
Fig. 2 is the frame construction drawing of information push method provided in an embodiment of the present invention and device, it is adaptable 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 with each process, and shared drive is drawn
It is divided into multiple shared drive blocks, the message that each process configures all subscription clients in a shared drive block, process is all deposited
It is stored in the corresponding shared drive block of the process, so, when needing to client push message, each process is in the same time
Message is obtained from each self-corresponding shared drive block respectively, the client in process is then sent to, message is saved with this
The push time, improve information push efficiency.
Embodiment 1
Fig. 3-5 are referred to, the present embodiment provides a kind of information push method.This method includes:
S301:Obtain PUSH message and client id.
During use, the message largely with server interaction can be related to, these message can be that client passes through
Server is sent to instant messaging or server in other clients, such as game application between each client
Produced 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 is illustrated, in order to which these PUSH messages are accurately pushed into corresponding client, is pushed obtaining
Need to obtain the corresponding client id of the PUSH message, the push produced according to client application for server while message
, it is necessary to obtain PUSH message and receive the client id of the PUSH message, client id is unique mark client for message
The identifier at end, can be user name.
S302:The affiliated process of client id is determined, and PUSH message and client id deposit is corresponding with the process common
Enjoy 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 setting up has the mapping relations and process ID of process ID and client id and shared memory block ID mapping relations;
By query procedure ID and the mapping relations of client id, the corresponding process ID of client id can be searched, client id is known
Affiliated process, and then according to process ID and shared memory block ID mapping relations, can search that 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
Hold 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 PUSH message and the corresponding relation of client id, PUSH message is sent to client corresponding with the client id.
When reaching the message push time, server can generate message and push instruction, trigger each process simultaneously from respective
PUSH message is read in corresponding shared drive block, and according to PUSH message and the corresponding relation of client id, by PUSH message
Send into client corresponding with client id.The process of each process PUSH message is separate and while carry out, under
The process of PUSH message is specifically described by taking individual process PUSH message as an example for face.
In shared drive block correspondence store PUSH message and client id, during PUSH message, can using PUSH message as
It is leading to be pushed, message push can also be carried out using client id to be leading.The present embodiment is using PUSH message as leading execution
Message is pushed, including:The PUSH message in shared drive block is read one by one, is closed according to PUSH message is corresponding with client id
System, PUSH message is sent to client corresponding with the client id, 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 comprises the following steps:
S501:Read the PUSH message in shared drive block.
When reading the PUSH message in shared drive block, it can be carried out according to storage location of the message in shared drive block
Order is read, and is read since shared drive block first PUSH message of position, is disappeared until reading the last item and pushing
Breath.
S502:According to PUSH message and the corresponding relation of client id, by PUSH message send to the client id
Corresponding client.
Often read after a PUSH message, found according to the corresponding relation of the PUSH message and client id and receive the push
The client id of the client of message, corresponding client is sent to according to client id by PUSH message.
S503:Whether the PUSH message for judging processing is the last item PUSH message, if so, in explanation shared drive block
All PUSH messages all distribute completion, can terminate flow, disappear if it is not, there is the push not sent in explanation shared drive block
Breath, then repeatedly S501-S503 continues to read and simultaneously sends next PUSH message, until all by what is stored in shared drive block
PUSH message is all distributed one time.
Preferably, before step S301, in addition to:
S401:Multiple processes are set up, each process connects multiple client.
S402:The client id for the client being connected in each process is obtained, client id and the client id institute is set up
Mapping relations between the process ID of category process.
S403:Memory block is shared for each course allocation one.
S404:Mapping between the shared drive block ID for the process ID shared drive block corresponding with the process for setting up process
Relation.
Message to be sent for client is stored in shared drive by the present embodiment in advance, multiple during PUSH message
Process reads message from shared drive simultaneously and sends the message of reading to corresponding client;The reading speed of shared drive
Faster than database reading speed, multiple processes read and sent simultaneously message in addition, thus can lift the efficiency of message push.
In addition, when storing message, it is corresponding shared that the message to be sent of all clients that will connect same process is stored in the process
In memory block, each process can be avoided to travel through the message required for searching in all message, reduce message and search model
Enclose, message can be saved and search the time, realize that efficient real-time messages are pushed.
Embodiment 2
The present embodiment provides a kind of information push method, it is adaptable to which server is to different real-time of each client push content
Message.This method includes pretreatment process and message pushes flow, and wherein pretreatment process comprises the following steps:
S401, set up multiple processes, each process connects multiple client.
System is each course allocation process ID 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, set up client id and the client id institute
Mapping relations between the process ID of category process.
S403, share memory block 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.One shared drive block of each process correspondence, the shared drive block can store this and enter
The PUSH message of all clients connected in journey.
Mapping between S404, the shared drive block ID of the process ID for setting up process shared drive block corresponding with the process
Relation.
Further, message pushes flow and comprised the following steps:
S301:Obtain PUSH message and client id.
During use, the message largely with server interaction can be related to, these message can be that client passes through
Server is sent to instant messaging or server in other clients, such as game application between each client
Produced 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 is illustrated, in order to which these PUSH messages are accurately pushed into corresponding client, is pushed obtaining
Need to obtain the corresponding client id of the PUSH message, the push produced according to client application for server while message
, it is necessary to obtain PUSH message and receive the client id of the PUSH message for message.
S302:The affiliated process of client id is determined, and PUSH message and client id deposit is corresponding with the process common
Enjoy in memory block.
According to process ID and the mapping relations of client id, the corresponding process ID of client id can be searched, client is known
The affiliated processes of ID are held, and then according to process ID and shared memory block ID mapping relations, can search that to obtain process ID corresponding
Shared drive block ID, knows the corresponding shared drive block of process ID, and then can be by PUSH message and client id deposit with being 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 PUSH message and the corresponding relation of client id, PUSH message is sent to client corresponding with the client id.
When reaching the message push time, server can generate message and push instruction, trigger each process simultaneously from respective
PUSH message is read in corresponding shared drive block, and according to PUSH message and the corresponding relation of client id, by PUSH message
Send into client corresponding with client id.The process of each process PUSH message is separate and while carry out, under
The process of PUSH message is specifically described by taking individual process PUSH message as an example for face.
In shared drive block correspondence store PUSH message and client id, during PUSH message, can using PUSH message as
It is leading to be pushed, message push can also be carried out using client id to be leading.The present embodiment using using client id as dominate into
Row message is pushed, and is comprised 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, the reading PUSH message corresponding with the client id from process corresponding shared drive block.
According to the client id of acquisition, searched and client from shared drive block corresponding with the affiliated process of client id
The corresponding PUSH messages of ID, if finding the corresponding PUSH message of client id, perform S603, if not finding visitor
The corresponding PUSH messages of family end ID, then perform S605.
S603, the PUSH message sent to client corresponding with the client id.
S604, judge whether the client id is last client id in client id list, if it is not, then holding
Row S605, if so, then terminating flow.
S605, the client id for obtaining next client, and S602-S604 is repeated, until all clients
ID PUSH message is all sent.
The present embodiment, according to client id and the corresponding relation of process ID, is found belonging to client id when storing message
Process, and according to process ID and shared drive ID corresponding relation, 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 avoid each process from
The message required for lookup is traveled through in all message, message seeking scope is reduced, message can be saved and search the time, realized
Efficient real-time messages are pushed.
In PUSH message, multiple processes read message from shared drive simultaneously and send the message of reading to corresponding
Client;The reading speed of shared drive is faster than database reading speed, and multiple processes read and sent simultaneously message in addition, because
And the efficiency of message push can be lifted.
It should be noted that for foregoing each method embodiment, in order to be briefly described, therefore it is all expressed as a series of
Combination of actions, but those skilled in the art should know, the present invention is not limited by described sequence of movement because
According to the present invention, some steps can be carried out sequentially or simultaneously using other.Secondly, those skilled in the art should also know
Know, embodiment described in this description belongs to preferred embodiment, involved action and module is 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 a lot
In the case of the former be more preferably embodiment.Understood based on such, technical scheme is substantially in other words to existing
The part that technology contributes can be embodied in the form of software product, and the computer software product is stored in a storage
In medium (such as ROM/RAM, magnetic disc, CD), including some instructions are to cause a station terminal equipment (can be mobile phone, calculate
Machine, server, or network equipment etc.) perform method described in each of the invention embodiment.
Embodiment 3
Fig. 7 is refer to, to realize above-described embodiment 1 and the method shown in embodiment 2, is pushed away the invention provides a kind of message
The embodiment of device is sent, the device is corresponding with the embodiment of the method shown in Fig. 3 and Fig. 4.
As shown in fig. 7, the message pusher 70 of the present embodiment includes data capture unit 75, the and of data processing unit 76
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
The corresponding relation of PUSH message and client id, PUSH message is sent to client corresponding with the client id.
Further, the message pusher 70 also sets up unit including process creation unit 71, the first mapping relations
72nd, the mapping relations of allocation unit 73 and second set up unit 74.Wherein,
Process creation unit 71, for setting up multiple processes, each process connects multiple client;
First mapping relations set up unit 72, the client id for obtaining the client being connected in each process, set up
Mapping relations between the process ID of client id and the affiliated process of the client id;
Allocation unit 73, for sharing memory block for each course allocation one;
Second mapping relations set up unit 74, the shared drive block corresponding with the process of the process ID for setting up process
Mapping relations between shared drive block ID.
As a kind of preferred embodiment, the data processing unit 76 includes the first searching modul 761, the second searching modul
762 and data processing module 763:
First searching modul 761, for the mapping relations according to client id and process ID, searches the client id pair
The process ID answered;
Second searching modul 762, for the mapping relations according to process ID and shared memory block ID, searches the process ID
Corresponding shared drive block ID;
Data processing module 763, for the PUSH message and client id deposit is corresponding with shared drive block ID
Shared drive block in.
As a kind of preferred embodiment, the message push unit 77 includes the message of first message pushing module 771 and second
Pushing module 772.
First message pushing module 771, for reading the PUSH message in shared drive block one by one, according to PUSH message with
The corresponding relation of client id, PUSH message is sent to client corresponding with the client id, until by shared drive
All PUSH messages are all pushed to corresponding client in block.
Second message pushing module 772, the client id for obtaining the client being connected in process;From process correspondence
Shared drive block in read corresponding with client id PUSH message, by the PUSH message send to the client
Hold the corresponding clients of ID;Whether be last client id, if so, terminating pushing away for PUSH message if judging the client id
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, whether judge the client id is last 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, the message to be sent for client is stored in shared drive in advance, it is many during PUSH message
Individual process reads message from shared drive simultaneously and sends the message of reading to corresponding client;The reading speed of shared drive
Degree is faster than database reading speed, and multiple processes read and sent simultaneously message in addition, thus can lift the effect of message push
Rate.In addition, when storing message, it is corresponding common that the message to be sent of all clients that will connect same process is stored in the process
Enjoy in memory block, each process can be avoided to travel through the message required for searching in all message, reduce message lookup
Scope, can save message and search the time, realize that efficient real-time messages are pushed.Solve when the more situation of client terminal quantity
Under, as soon as possible the problem of the real-time messages different from each other to each client push.
Embodiment 4
Below with reference to Fig. 8, it illustrates suitable for come the calculating of the terminal device or server of realizing the embodiment of the present invention
The structural representation of machine system.
As shown in figure 8, computer system 900 includes CPU (CPU) 901, it can be read-only according to being stored in
Program in memory (ROM) 902 or be loaded into program in random access storage device (RAM) 903 from storage part 908 and
Perform various appropriate actions and processing.In RAM903, the system that is also stored with 900 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。
I/O interfaces 905 are connected to lower component:Importation 906 including keyboard, mouse etc.;Penetrated including such as negative electrode
The output par, c 907 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage part 908 including hard disk etc.;
And the communications portion 909 of the NIC including LAN card, modem etc..Communications portion 909 via such as because
The network of spy's net performs 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 arranged on driver 910, in order to read from it as needed
Computer program be mounted into as needed storage part 908.
Especially, in accordance with an embodiment of the present disclosure, the process described above with reference to flow chart may be implemented as computer
Software program.For example, embodiment of the disclosure includes a kind of computer program product, it includes being tangibly embodied in machine readable
Computer program on medium, the computer program, which is included, is used for the program code of the method shown in execution flow chart.At this
In the embodiment of sample, the computer program can be downloaded and installed by communications portion 909 from network, and/or from removable
Medium 911 is unloaded to be mounted.
Flow chart and block diagram in accompanying drawing, it is illustrated that according to the system of the various embodiments of the application, method and computer journey
Architectural framework in the cards, function and the operation of sequence product.At this point, each square frame in flow chart or block diagram can generation
The part of one module of table, program segment or code, a part for the module, program segment or code is comprising one or more
Executable instruction for realizing defined logic function.It should also be noted that in some realizations as replacement, institute in square frame
The function of mark can also be with different from the order marked in accompanying drawing generation.For example, two square frames succeedingly represented are actual
On can perform substantially in parallel, they can also be performed in the opposite order sometimes, and this is depending on involved function.Also
It is noted that the combination of each square frame in block diagram and/or flow chart and the square frame in block diagram and/or flow chart, Ke Yiyong
Perform the special hardware based system of defined function or operation to realize, or can be referred to specialized hardware with 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 set within a processor, for example, can be described as:A kind of processor bag
Include receiving module, detection module and processing module.Wherein, the title of these modules is not constituted to the module under certain conditions
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 the 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 performed by an equipment so that the equipment is performed
Following operational order:
Obtain PUSH message and client id;
The affiliated process of client id is determined, and PUSH message and client id are 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
The corresponding relation of PUSH message and client id, PUSH message is sent to client corresponding with the client id.
Further, before the acquisition PUSH message and client id, in addition to:
Multiple processes are set up, each process connects multiple client;
The client id for the client being connected in each process is obtained, client id and the affiliated process of the client id is set up
Process ID between mapping relations;
Memory block is shared for each course allocation one;
Mapping relations between the shared drive block ID for the process ID shared drive block corresponding with the process for setting up process.
Further, the determination affiliated process of client id, and PUSH message and client id are stored in and the process
In corresponding shared drive block, including:
According to client id and the mapping relations of 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 shared drive block ID.
Alternatively, the process reads PUSH message from corresponding shared drive block, according to PUSH message and client
ID corresponding relation, PUSH message is sent to client corresponding with the client id, including:
The PUSH message in shared drive block is read one by one, according to PUSH message and the corresponding relation of client id, will be pushed away
Message is sent to send to client corresponding with the client id, until PUSH message all in shared drive block is all pushed
To corresponding client.
Alternatively, the process reads PUSH message from corresponding shared drive block, according to PUSH message and client
ID corresponding relation, PUSH message is sent to client corresponding with the client id, including:
Obtain the client id for the client being connected 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;
Whether judge the client id is last 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, in addition to:If do not read and the client id from the corresponding shared drive block of process
Corresponding PUSH message, then whether be last client id, if so, terminating pushing away for PUSH message if judging the client id
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, the problem of message is pushed not in time is solved, efficient, real-time message is realized and pushes.
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 the technology of the particular combination of above-mentioned technical characteristic
Scheme, while should also cover in the case where not departing from the inventive concept, is carried out by above-mentioned technical characteristic or its equivalent feature
Other technical schemes formed by any combination.Such as features described above has similar work(with (but not limited to) disclosed herein
The technical characteristic of energy carries out technical scheme formed by replacement mutually.
Claims (12)
1. a kind of information push method, it is characterised in that including:
Obtain PUSH message and client id;
The affiliated process of client id is determined, and PUSH message and client id are 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
The corresponding relation of message and client id, PUSH message is sent to client corresponding with the client id.
2. according to the method described in claim 1, it is characterised in that before the acquisition PUSH message and client id, also
Including:
Multiple processes are set up, each process connects multiple client;
The client id for being connected to client in each process is obtained, entering for client id and the affiliated process of the client id is set up
Mapping relations between journey ID;
Memory block is shared for each course allocation one;
Mapping relations between the shared drive block ID for the process ID shared drive block corresponding with the process for setting up process.
3. method according to claim 1 or 2, it is characterised in that the affiliated process of determination client id, and will push
Message and client id are stored in shared drive block corresponding with the process, including:
According to client id and the mapping relations of 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
State PUSH message and client id is stored in shared drive block corresponding with shared drive block ID.
4. according to the method described in claim 1, it is characterised in that the process reads push from corresponding shared drive block
Message, according to PUSH message and the corresponding relation of client id, PUSH message is sent to visitor corresponding with the client id
Family end, including:
The PUSH message in shared drive block is read one by one, and according to PUSH message and the corresponding relation of client id, push is disappeared
Breath is sent to client corresponding with the client id, until PUSH message all in shared drive block is all pushed into phase
The client answered.
5. according to the method described in claim 1, it is characterised in that the process reads push from corresponding shared drive block
Message, according to PUSH message and the corresponding relation of client id, PUSH message is sent to visitor corresponding with the client id
Family end, including:
Obtain the client id for the client being connected 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;
Whether judge the client id is last 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. method according to claim 5, it is characterised in that methods described also 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 last client id,
If so, terminating the push of PUSH message, if it is not, carrying out the push of PUSH message to next client.
7. a kind of message pusher, it is characterised in that including:
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 simultaneously when reaching the message push time, each process is read from corresponding shared drive block
PUSH message, according to PUSH message and the corresponding relation of client id, PUSH message is sent to corresponding with the client id
Client.
8. device according to claim 7, it is characterised in that described device also includes:
Process creation unit, for setting up multiple processes, each process connects multiple client;
First mapping relations set up unit, the client id for obtaining the client being connected in each process, set up 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 set up unit, and sharing for the shared drive block corresponding with the process of the process ID for setting up process is interior
Mapping relations between counterfoil ID.
9. the device according to claim 7 or 8, it is characterised in that the data processing unit includes:
First searching modul, for the mapping relations according to client id and process ID, search the client id it is corresponding enter
Journey ID;
Second searching modul, for the mapping relations according to process ID and shared memory block ID, searches the process ID corresponding
Shared drive block ID;
Data processing module, for the PUSH message and client id deposit is corresponding with shared drive block ID shared interior
In counterfoil.
10. device according to claim 7, it is characterised in that the message push unit includes:
First message pushing module, for reading the PUSH message in shared drive block one by one, according to PUSH message and client
ID corresponding relation, PUSH message is sent to client corresponding with the client id, until by institute in shared drive block
Some PUSH messages are all pushed to corresponding client.
11. device according to claim 7, it is characterised in that the message push unit includes:
Second message pushing module, the client id for obtaining the client being connected in process;It is corresponding shared from process
Corresponding with client id PUSH message is read in memory block, by the PUSH message send to the client id pair
The client answered;Whether judge the client id is last 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.
12. device according to claim 11, it is characterised in that the second message pushing module is additionally operable to:If from
PUSH message corresponding with the client id is not read in the corresponding shared drive block of process, the client id is judged
Whether it is last client id, if so, terminating the push of PUSH message, disappears if it is not, carrying out push to next client
The push of breath.
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 true CN107196848A (en) | 2017-09-22 |
CN107196848B 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) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108536544A (en) * | 2018-03-21 | 2018-09-14 | 微梦创科网络科技(中国)有限公司 | Consuming method, device, server based on database message queue and medium |
CN109508246A (en) * | 2018-06-25 | 2019-03-22 | 广州多益网络股份有限公司 | Log recording method, system and computer readable storage medium |
CN110019671A (en) * | 2017-11-07 | 2019-07-16 | 北京京东尚科信息技术有限公司 | A kind of method and system handling real-time messages |
CN110928702A (en) * | 2018-09-20 | 2020-03-27 | 北京君正集成电路股份有限公司 | Multi-process message communication system |
CN111447205A (en) * | 2020-03-24 | 2020-07-24 | 深信服科技股份有限公司 | Data processing method, system and related equipment |
CN113760569A (en) * | 2021-01-06 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Multi-account management method and system |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2014108030A1 (en) * | 2013-01-09 | 2014-07-17 | 北京奇虎科技有限公司 | Web polling method, device and system |
US20160182415A1 (en) * | 2014-12-23 | 2016-06-23 | FanActivate, LLC | Scalable systems for change detection of statistic data feeds across multiple servers using shared memory with configurable messaging triggers |
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 |
-
2017
- 2017-05-09 CN CN201710321261.7A patent/CN107196848B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2014108030A1 (en) * | 2013-01-09 | 2014-07-17 | 北京奇虎科技有限公司 | Web polling method, device and system |
US20160182415A1 (en) * | 2014-12-23 | 2016-06-23 | FanActivate, LLC | Scalable systems for change detection of statistic data feeds across multiple servers using shared memory with configurable messaging triggers |
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 |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110019671A (en) * | 2017-11-07 | 2019-07-16 | 北京京东尚科信息技术有限公司 | A kind of method and system handling real-time messages |
CN110019671B (en) * | 2017-11-07 | 2022-04-12 | 北京京东尚科信息技术有限公司 | Method and system for processing real-time message |
CN108536544A (en) * | 2018-03-21 | 2018-09-14 | 微梦创科网络科技(中国)有限公司 | Consuming method, device, server based on database message queue and medium |
CN109508246A (en) * | 2018-06-25 | 2019-03-22 | 广州多益网络股份有限公司 | Log recording method, system and computer readable storage medium |
CN110928702A (en) * | 2018-09-20 | 2020-03-27 | 北京君正集成电路股份有限公司 | Multi-process message communication system |
CN110928702B (en) * | 2018-09-20 | 2023-03-21 | 北京君正集成电路股份有限公司 | Multi-process message communication system |
CN111447205A (en) * | 2020-03-24 | 2020-07-24 | 深信服科技股份有限公司 | Data processing method, system and related equipment |
CN111447205B (en) * | 2020-03-24 | 2022-11-22 | 深信服科技股份有限公司 | Data processing method, system and related equipment |
CN113760569A (en) * | 2021-01-06 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Multi-account management method and system |
CN113760569B (en) * | 2021-01-06 | 2024-04-05 | 北京沃东天骏信息技术有限公司 | Multi-account management method and system |
Also Published As
Publication number | Publication date |
---|---|
CN107196848B (en) | 2018-09-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107196848A (en) | Information push method and device | |
Feng et al. | Joint service pricing and cooperative relay communication for federated learning | |
CN107908690B (en) | Data processing method based on big data operation analysis | |
CN103761309B (en) | Operation data processing method and system | |
US9342532B2 (en) | System and method for real-time map-based lost and found | |
CN104283926B (en) | A kind of method of data synchronization, device and server | |
CN107094165A (en) | Distribution capacity is determined, dispatching task obtains, dispenses resource regulating method and equipment | |
CN108009028A (en) | Message treatment method, device, equipment and computer-readable recording medium | |
CN109995877A (en) | Information-pushing method and device | |
CN105337843A (en) | Interaction system and method, client, and background server | |
CN108429701A (en) | network acceleration system | |
CN109040298A (en) | Data processing method and device based on edge calculations technology | |
CN109146446B (en) | Virtual article issuing method, device and system | |
Vargaftik et al. | LSQ: Load balancing in large-scale heterogeneous systems with multiple dispatchers | |
WO2009035763A1 (en) | Determining quality of communication | |
CN108874946A (en) | A kind of ID management method and device | |
CN108206742A (en) | A kind of message method, device, server and system | |
CN107729570A (en) | Data migration method and device for server | |
CN108418768A (en) | Recognition methods, device, terminal and the storage medium of business datum | |
CN103326925A (en) | Message push method and device | |
CN109600240A (en) | Group Communications method and device | |
CN108966316A (en) | Show the method, device and equipment of multimedia resource, prediction connection waiting time | |
CN107807922A (en) | Method and apparatus for determining party venue | |
CN110442334A (en) | A kind of multi-person synergy graphic configuration method, electronic equipment and server | |
Kim et al. | Collaborative policy learning for dynamic scheduling tasks in cloud-edge-terminal IoT networks using federated reinforcement learning |
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 |