Invention content
To solve the above problems, this application provides a kind of information push method, device and equipment, specific technical solution is such asUnder:
In a first aspect, this application provides a kind of information push method, the method is applied to message and pushes platform, describedMethod includes:
Receive it is any wait for PUSH message, it is described to wait for that PUSH message carries targets of messages mark;
Connection is grown based on the two-way communication that corresponding terminal is established is identified with the targets of messages, PUSH message is waited for by describedPush to the terminal;Wherein, the two-way communication length connection is the connection established based on websocket protocol.
In an optional implementation manner, the connection established based on websocket protocol includes the terminal baseConnection is grown in the two-way communication that websocket protocol is initiated.
In an optional implementation manner, described to wait for that PUSH message comes from any client or any server-side.
In an optional implementation manner, the targets of messages mark includes the unique identifying information of the terminal.
In an optional implementation manner, it is described based on the targets of messages identify corresponding terminal establish it is two-wayCommunication chief connect, by it is described wait for that PUSH message pushes to the terminal after, further include:
Receive the push result information that the terminal returns, the push result information be it is described wait for PUSH message push atThe information of work(or the information for waiting for PUSH message push failure;
If the push result information is the information for waiting for PUSH message push failure, wait pushing described in push againMessage is to the terminal.
Second aspect, this application provides a kind of message pusher, described device is applied to message and pushes platform, describedDevice includes:
First receiving unit, for receive it is any wait for PUSH message, it is described to wait for that PUSH message carries targets of messages mark;
First push unit is connected for being grown based on the two-way communication for identifying corresponding terminal foundation with the targets of messagesIt connects, waits for that PUSH message pushes to the terminal by described;Wherein, the two-way communication length connection is to be based on websocket protocolThe connection of foundation.
In an optional implementation manner, the connection established based on websocket protocol includes the terminal baseConnection is grown in the two-way communication that websocket protocol is initiated.
In an optional implementation manner, described to wait for that PUSH message comes from any client or any server-side.
In an optional implementation manner, the targets of messages mark includes the unique identifying information of the terminal.
In an optional implementation manner, described device further includes:
Second receiving unit, the push result information returned for receiving the terminal, the push result information is instituteIt states and waits for that PUSH message pushes successful information or the information for waiting for PUSH message push failure;
Second push unit, if being the information for waiting for PUSH message push failure for the push result information,Wait for PUSH message to the terminal described in push again.
The third aspect, this application provides a kind of message pushing equipment, the equipment includes memory and processor,
Said program code is transferred to the processor by the memory for storing program code;
The processor is used to execute any one institute that above-mentioned first aspect provides according to the instruction in said program codeThe information push method stated.
In information push method provided by the present application, message push platform receive first it is any wait for PUSH message, this is waited forPUSH message carries targets of messages mark;Then, it is grown and is connected based on the two-way communication for identifying corresponding terminal foundation with targets of messagesIt connects, will wait for that PUSH message pushes to terminal;Wherein, the connection of two-way communication length is the connection established based on websocket protocol.It canSee, the application, which is grown using message push platform based on the two-way communication that websocket protocol and terminal are established, to be connected so that serviceEnd while improving information push efficiency, can also reduce the load of server-side, solve with active push message to terminalThe problem of inefficient existing for existing message push mode, high load.
Specific implementation mode
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, completeSite preparation describes, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.It is based onEmbodiment in the application, it is obtained by those of ordinary skill in the art without making creative efforts every otherEmbodiment shall fall in the protection scope of this application.
For the ease of understanding technical solution provided by the present application, first the application scenarios of the application in practice are carried out belowIt introduces.
Referring to Fig. 1, it illustrates the block schematic illustrations of an exemplary application scene of the embodiment of the present application, as shown in Figure 1,Information push method provided by the present application can be applied to include client 101, message push platform 102 and server-side 103In application scenarios;Wherein, client 101 is to refer to establish with message push platform 102 to connect, and for offering customers serviceProgram, such as each Mobile banking APP, browser, client 101 can carry in the terminal, can such as be mounted in smart mobile phone,Tablet computer, laptop PC, desktop personal computer, minicomputer, medium-size computer, mainframe computer etc.In terminal;Message push platform 102 is the platform device pushed for realizing message that the application is specially built, and can be canIt is communicated respectively with client 101 and server-side 103, and message is pushed to the server apparatus of client 101, in realityWhen the hardware deployment of border, it can be independent server apparatus that message, which pushes platform 102, and cluster server can also be used to realize;Server-side 103 is to refer to provide equipment of the information with service is calculated for client, may include management server cluster, businessServer cluster, public server cluster, other clusters etc., and server-side 103 can provide service for a client,Can service be provided for multiple client simultaneously.
Below by taking client 101 is certain Mobile banking APP being mounted in terminal as an example, to the practical application mistake of the applicationJourney illustrates, and in practical applications, the client 101 in terminal is attached with message push platform 102 first, to disappearBreath push platform 102 can will wait for that PUSH message pushes to client 101, such as push Investment & Financing service announcements and systemBulletin etc., wherein wait for that PUSH message carries targets of messages mark, when message push platform 102 receives any carrying messageTarget identification after PUSH message, such as receive service server collection pocket transmission accumulated point exchanging this wait for PUSH messageAfterwards, it by based on identifying the two-way communication that corresponding terminal is established with the targets of messages of PUSH message carrying is waited for and growing connection, will wait pushing awayMessage is sent to push to the client 101 in terminal;Wherein, the connection of two-way communication length is the company established based on websocket protocolIt connects.It is connected in this way, being grown based on the two-way communication that websocket protocol and terminal are established using message push platform, realizes clothesMessage can actively be pushed to the function of client by business end, while improving information push efficiency, also reduce server-sideLoad.
Based on use above scene, the embodiment of the present application provides a kind of information push method, below with reference to attached drawing pairThis method is described in detail.
Referring to Fig. 2, it illustrates a kind of flow charts of information push method provided by the embodiments of the present application, as shown in Fig. 2,This method includes:
Step 201:Receive it is any wait for PUSH message, this wait for PUSH message carry targets of messages mark.
In practical applications, each bank is according to own service growth requirement, or according to other service management demands etc., oftenIt often needs to push various message, such as the message such as push account notice or financial market notice to corresponding bank client, andAnd these wait for carrying targets of messages mark in PUSH message.
Wherein, it waits for that PUSH message can be sent to message by client to push platform, can also be to be sent out by server-sideMessage push platform is given, and then platform can be pushed by message again will to wait for that PUSH message is pushed to corresponding terminal, i.e.,It realizes client and carries out message push and server-side actively to client progress message push to client;Targets of messages markKnow the mark for the target terminal for referring to waiting for that PUSH message will be pushed to, which can be with unique mark terminal.
In the application in some possible realization methods, targets of messages mark includes the unique identifying information of terminal, whereinUnique identifying information refers to the information for embodying terminal device uniqueness, such as can be SIM pairs built in terminal deviceUnique Product sequence number SN (Serial Number) or MAC (the Media Access Control) information answered, then also may be usedAd identifier (identifierForIdentifier, IDFA), Internet protocol when being installing terminal equipment clientAddress (Internet Protocol, IP), user agent (User Agent) etc..
In order to realize that server-side will can actively wait for that PUSH message pushes to client, the application is assisted based on websocketView has built the message pushed dedicated for message and has pushed platform, becomes between client and server-side in message transmissionHeart node, as shown in figure 3, it illustrates the structural schematic diagram of system where message provided by the embodiments of the present application push platform,Wherein, message push platform 102 can be independent server apparatus, cluster server can also be used to realize, message pushesClient on platform 102 and all types of terminal devices (such as PC terminals, mobile phone, tablet computer, wisdom self-aided terminal STM etc.) itBetween two-way communication chief's connection, the client push message on each type terminals, solution established based on websocket protocolCurrent server-side of having determined is directed to the client with different operating system, needs to carry out caused by different information push modesThe problem of system coupling difference.Meanwhile server-side (such as management server cluster, service server cluster, public server collectionGroup, other clusters etc.) http protocol and message push platform progress information exchange can also be based on.
It is any after PUSH message receiving, step 202 will be continued to execute.
Step 202:Connection is grown based on the two-way communication that corresponding terminal is established is identified with targets of messages, will wait for PUSH messagePush to terminal;Wherein, the two-way communication length connection is the connection established based on websocket protocol.
In the present embodiment, by step 201, message push platform receive server-side transmission after PUSH message,Connection may further be grown based on the two-way communication that corresponding terminal is established is identified with targets of messages, will wait for that PUSH message pushes toTerminal, as shown in figure 3, server-side may include service server group, management server group and other server zones, clientIt can be located on the terminal devices such as mobile phone, tablet computer, wisdom self-aided terminal STM.
Before carrying out message push, message push platform needs to be in advance based on websocket protocol foundation pair with terminalTo communication chief's connection, in order to which message push platform and terminal actively can send message to other side.Wherein,Websocket protocol is a kind of new procotol based on TCP that HTML5 is provided, and can realize that browser is complete with serverDuplexing (full-duplex) communication, that is, allow server actively to send information to client, therefore, is assisted based on websocketView can rely on websocket technologies to realize client after message pushes and establishes two-way communication length connection between platform and terminalBidirectional real-time between end and server-side.
Referring to Fig. 4, the realization principle schematic diagram of websocket provided by the embodiments of the present application is shown, as shown in figure 4,In realizing websocket connection procedures, it is necessary first to send out websocket connection requests by browser, then serverAfter receiving connection request, response is sent out, this process commonly referred to as " is shaken hands ".In websocket API, browser kimonosBusiness device only needs to do an action shaken hands, and then, between browser and server is formed an express passway, the two itBetween mutually transferred with regard to can directly carry out data, that is, realize duplex communication.
It is understood that websocket not only may be implemented from server actively to the function of client push message,It is not need to rely on the request from client, increases initiative and the flexibility of server;And also due to websocketWhat is relied on is Transmission Control Protocol, and therefore, after a connection setup, transmitted data amount is smaller than the transmitted data amount dependent on HTTP, is improvedThe efficiency of data transmission.
In the application in some possible realization methods, the connection established based on websocket protocol is based on including terminalThe two-way communication length connection that websocket protocol is initiated.
In practical application, the connection established based on websocket protocol is initiated based on websocket protocol by terminalTwo-way communication length connection, and be completed on the basis of http protocol push platform with message and shake hands, for example, specificallyHandshake procedure is as follows:
First, the client in terminal can push platform to message and send following request:
GET/chat HTTP/1.1
Host:server.example.com
Upgrade:websocket
Connection:Upgrade
Sec-WebSocket-Key:X3JJHMbDL1EzLkh9GBhXDw==
Sec-WebSocket-Protocol:chat,superchat
Sec-WebSocket-Version:13
Origin:http://ccb.com
Wherein, Upgrade:Websocket and Connection:Upgrade is the core content of websocket, is usedWhat it is in notification message push platform initiation is to ask to be websocket protocol, mutually to be distinguished with traditional http protocol;Sec-What WebSocket-Key was indicated is the value of a Base64encode, is generated at random by browser, for inquiring that message pushesWhether platform supports websocket;What Sec_WebSocket-Protocol was indicated is a user-defined character string, is used forIt distinguishes under same uniform resource locator (Uniform Resource Locator, abbreviation URL), the required association of different servicesView;That Sec-WebSocket-Version is indicated is used protocol version (Websocket Draft);Origin is indicatedBe message push platform address.
Then, message pushes platform after receiving the request of client, can carry out processing and return to similar following field:
TTP/1.1 101SwitchingProtocols
Upgrade:websocket
Connection:Upgrade
Sec-WebSocket-Accept:HSmrc0sMlYUkAGmm5OPpG2HaGWk=
Sec-WebSocket-Protocol:chat
Here start to be exactly region that HTTP is ultimately responsible for, notice client successful switch agreement.
Wherein, Upgrade:Websocket and Connection:Upgrade is still in the core of websocketHold, be still fixed, message push platform return the value for notice client will upgrade be websocket associationView, rather than other agreements;What Sec-WebSocket-Accept was indicated is confirmed by message push platform, and encryptedSec-WebSocket-Key afterwards;What Sec-WebSocket-Protocol was indicated is the agreement finally used.
So far, HTTP has been finished, and following message push platform and client are exactly fully according to websocketAgreement carries out two-way communication.
As shown in figure 3, before carrying out message push, message push platform can be connected with client end according to above-mentionedJourney is in advance based on websocket protocol and establishes two-way communication length connection between the two, in order to which message pushes platform and terminalCan message actively be sent to other side, may further realize and actively send message to other side between server-side and terminal,In, carrying targets of messages mark can be waited for that PUSH message is sent to message and pushes platform by server-side by http protocol, intoAnd platform can be pushed by message and be based on established two-way communication length connection, this is actively waited for that PUSH message pushes to message meshMark identifies the client installed in corresponding terminal.
It should be noted that each server zone in server-side can will not only wait for that PUSH message is sent by http protocolPlatform is pushed to message, similar above-mentioned connection type can also be used, base is established between server zone and message push platformConnection is grown in the two-way communication of websocket protocol, and then each server zone can will carry targets of messages mark by the connectionThat knows waits for that PUSH message is sent to message push platform.The application is not limited this.
In the application in some possible realization methods, the application wait for PUSH message may come from any client orAny server-side.
In practical applications, a kind of optional embodiment is that the application's waits for that PUSH message may come from any visitorFamily end, and then the push of the message between client and client may be implemented.
It illustrates:Referring to Fig. 5, it illustrates message between realization client and client provided by the embodiments of the present applicationThe schematic diagram of push executes a business for needing lobby manager to carry out identity audit to operator with wisdom self-aided terminal STMFor, wherein wisdom self-aided terminal STM refers to voluntarily using to client in bank, self-service to complete the similar of required functionEquipment.STM execute one need the business that lobby manager carries out operator identity audit before, client on STM andClient on lobby manager's tablet computer be required to it is pre- first pass through websocket connections by respective request be sent to message pushConnection, and then STM are grown in platform, the two-way communication so as to be established between message push platform based on websocket protocolOn client can based on the connection to message push platform send carry lobby manager's tablet computer unique identification letterBreath (such as MAC information) needs wait for PUSH message of the lobby manager to operator's progress identity audit, and then message push is flatPlatform is receiving this after PUSH message, will grow connection based on the two-way communication established with lobby manager's tablet computer, this is waited forPUSH message pushes to the client on lobby manager's tablet computer, flat with lobby manager to realize the client on STMBetween client on plate computer message push, in order to lobby manager's tablet computer client to PUSH message content intoThe specific business datum of current identity audit can be obtained after row processing to service server collection pocket transmission transaction request, in turnService server cluster can notify lobby manager to corresponding STM to operator after carrying out analyzing processing to business datumCarry out identity audit and mandate.
Correspondingly, another optional embodiment is that the application's waits for that PUSH message may come from any server-side,And then the push of the message between server-side and client may be implemented,.
It illustrates:Referring to Fig. 6, it illustrates message between realization server-side and client provided by the embodiments of the present applicationThe schematic diagram of push has checked VIP client with server-side (being specially service server cluster) and has reached from the background, notice hall warpFor reason provides service for it, similarly, before example execution, the client on lobby manager's tablet computer needs logical in advanceWebsocket protocol is crossed, the two-way communication length established between message push platform connects.Service server cluster can be to disappearingThe needs that breath push platform sends the unique identifying information (such as product ID SN) for carrying lobby manager's tablet computer are bigHall handle the PUSH message that waits for arrived VIP offering customers services, and then message push platform disappears receiving this and wait pushingAfter breath, connection will be grown based on the two-way communication established with lobby manager's tablet computer, this is waited for that PUSH message pushes to hall's warpThe client on tablet computer is managed, to realize disappearing for client of the service server cluster on lobby manager's tablet computerBreath push, in order to which the client on lobby manager's tablet computer can be to services sets after handling PUSH message contentPocket transmission transaction request is to obtain the specific data of current VIP, and then service server cluster is analyzed to business datumAfter processing, lobby manager can be notified to provide counseling services and product in face of VIP client to corresponding cabinet.
In the application in some possible realization methods, by step 202, by after PUSH message pushes to terminal, thisApplication can also include:
Receive the push result information that terminal returns, wherein push result information is to wait for PUSH message push successfully letterCease or wait for the information of PUSH message push failure;
If push result information is the information for waiting for PUSH message push failure, push again waits for PUSH message to terminal.
In practical applications, when can also further be received after PUSH message pushes to terminal by step 202The push result information that terminal returns, wherein push result information is to wait for that PUSH message pushes successful information or waits for PUSH messagePush failure information.
One kind being optionally achieved in that after message push platform completes message push, terminal will determine that message pushesWhether request meets the preset condition of terminal itself, for example whether meeting specified data format etc., if met, to informationPush platform return waits for that PUSH message pushes successful information, if it does not meet, or other problems occur causes message to pushIt is unsuccessful, all the information for waiting for PUSH message push failure will be returned to information push platform, further, when message pushes platformAfter the information to fail after PUSH message push for receiving terminal return, it will wait for that PUSH message pushes to corresponding terminal again.
In this way, in information push method provided by the present application, message push platform receive first it is any wait for PUSH message,This waits for that PUSH message carries targets of messages mark;Then, based on the two-way communication for identifying corresponding terminal foundation with targets of messagesLong connection, will wait for that PUSH message pushes to terminal;Wherein, the connection of two-way communication length is the company established based on websocket protocolIt connects.It connects, makes as it can be seen that the application is grown using message push platform based on the two-way communication that websocket protocol and terminal are establishedObtain server-side while improving information push efficiency, can also reduce the load of server-side with active push message to terminal,Solves the problems, such as inefficient, high load existing for existing message push mode.
Based on message above method for pushing, present invention also provides a kind of message pushers, as shown in fig. 7, the deviceIncluding:
First receiving unit 701, for receive it is any wait for PUSH message, it is described to wait for that PUSH message carries targets of messages markKnow;
First push unit 702, for long based on the two-way communication that corresponding terminal is established is identified with the targets of messagesConnection, waits for that PUSH message pushes to the terminal by described;Wherein, the two-way communication length connection is assisted based on websocketDiscuss the connection established.
Optionally, the connection established based on websocket protocol includes that the terminal is sent out based on websocket protocolThe two-way communication length connection risen.
Optionally, described to wait for that PUSH message comes from any client or any server-side.
Optionally, the targets of messages mark includes the unique identifying information of the terminal.
Optionally, described device further includes:
Second receiving unit, the push result information returned for receiving the terminal, the push result information is instituteIt states and waits for that PUSH message pushes successful information or the information for waiting for PUSH message push failure;
Second push unit, if being the information for waiting for PUSH message push failure for the push result information,Wait for PUSH message to the terminal described in push again.
In this way, in message pusher provided by the present application, message push platform receive first it is any wait for PUSH message,This waits for that PUSH message carries targets of messages mark;Then, based on the two-way communication for identifying corresponding terminal foundation with targets of messagesLong connection, will wait for that PUSH message pushes to terminal;Wherein, the connection of two-way communication length is the company established based on websocket protocolIt connects.It connects, makes as it can be seen that the application is grown using message push platform based on the two-way communication that websocket protocol and terminal are establishedObtain server-side while improving information push efficiency, can also reduce the load of server-side with active push message to terminal,Solves the problems, such as inefficient, high load existing for existing message push mode.
Correspondingly, the embodiment of the present invention also provides a kind of message pushing equipment, it is shown in Figure 8, may include:
Processor 801, memory 802, input unit 803 and output device 804.Processing in typesetting document structure tree equipmentThe quantity of device 801 can be one or more, in Fig. 8 by taking a processor as an example.In some embodiments of the invention, processor801, memory 802, input unit 803 and output device 804 can be connected by bus or other means, wherein with logical in Fig. 8It crosses for bus connection.
Memory 802 can be used for storing software program and module, and processor 801 is stored in memory 802 by operationSoftware program and module, to execute various function application and the data processing of message pushing equipment.Memory 802 canInclude mainly storing program area and storage data field, wherein storing program area can storage program area, needed at least one functionApplication program etc..In addition, memory 802 may include high-speed random access memory, can also include non-volatile memoriesDevice, for example, at least a disk memory, flush memory device or other volatile solid-state parts.Input unit 803 can be usedIt is related with the user setting of message pushing equipment and function control in the number or character information that receive input, and generationSignal inputs.
Specifically in the present embodiment, processor 801 can be according to following instruction, by one or more application programThe corresponding executable file of process be loaded into memory 802, and be stored in memory 802 by processor 801 to runApplication program, to realize the various functions in above-mentioned information push method.
For device embodiments, since it corresponds essentially to embodiment of the method, so related place is referring to method realityApply the part explanation of example.The apparatus embodiments described above are merely exemplary, wherein described be used as separating componentThe unit of explanation may or may not be physically separated, and the component shown as unit can be or can alsoIt is not physical unit, you can be located at a place, or may be distributed over multiple network units.It can be according to actualIt needs that some or all of module therein is selected to achieve the purpose of the solution of this embodiment.Those of ordinary skill in the art are notIn the case of making the creative labor, you can to understand and implement.
It should be noted that herein, relational terms such as first and second and the like are used merely to a realityBody or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operationIn any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended toNon-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including thoseElement, but also include other elements that are not explicitly listed, or further include for this process, method, article or equipmentIntrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded thatThere is also other identical elements in process, method, article or equipment including the element.
A kind of information push method, device and the equipment provided above the embodiment of the present application is described in detail,Specific examples are used herein to illustrate the principle and implementation manner of the present application, and the explanation of above example is only usedUnderstand the present processes and its core concept in help;Meanwhile for those of ordinary skill in the art, according to the application'sThought, there will be changes in the specific implementation manner and application range, in conclusion the content of the present specification should not be construed asLimitation to the application.