CN107800585A - The method and apparatus of network service, the method and apparatus of PUSH message - Google Patents

The method and apparatus of network service, the method and apparatus of PUSH message Download PDF

Info

Publication number
CN107800585A
CN107800585A CN201610807978.8A CN201610807978A CN107800585A CN 107800585 A CN107800585 A CN 107800585A CN 201610807978 A CN201610807978 A CN 201610807978A CN 107800585 A CN107800585 A CN 107800585A
Authority
CN
China
Prior art keywords
length
server
connection
client
established
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201610807978.8A
Other languages
Chinese (zh)
Other versions
CN107800585B (en
Inventor
陈威
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Yayue Technology 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 CN201610807978.8A priority Critical patent/CN107800585B/en
Publication of CN107800585A publication Critical patent/CN107800585A/en
Application granted granted Critical
Publication of CN107800585B publication Critical patent/CN107800585B/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
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
    • 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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The embodiment of the invention discloses a kind of method and apparatus of network service, the method and apparatus of PUSH message.Present invention method includes:Whether first length connection has been established between detection and server;When detecting that foundation has the first length to be connected between server, the state of the described first length connection is monitored;When monitoring that the first length connection disconnects, establish the second length with the server and link.

Description

The method and apparatus of network service, the method and apparatus of PUSH message
Technical field
The present invention relates to communication technical field, more particularly to a kind of method and apparatus of network service, the side of PUSH message Method and device.
Background technology
Push (push) business is the mechanism of a content distribution, and the mechanism uses the work of customer end/server mode Mode, server do not need client to send request can actively by the content distribution required for client to client. Push paths refer to that server is used for the network path used in client push data, establish real used in push paths Existing technical basis is in specific application scenarios.
The characteristics of long connection is the one of which of push paths, and the length connects be client during operation all the time with service Device maintains a connection, so that server is connected to client push message using the length at any time.Using the benefit of long connection It is that instantaneity is good, server is relatively low to the management difficulty of client.In the prior art, only being established between client and server has One long connection, if some reasons cause the length, connection disconnects, and the real-time of data cannot ensure, cause push paths Reliability is relatively low.
The content of the invention
, can the embodiments of the invention provide a kind of method and apparatus of network service, the method and apparatus of PUSH message Improve the reliability of push paths.
In a first aspect, the embodiment of the present invention provides a kind of method of network service, including:
Whether first length connection has been established between detection and server;
When detecting that foundation has the first length to be connected between server, the state of the described first length connection is monitored;
When monitoring that the first length connection disconnects, establish the second length with the server and link.
Second aspect, the embodiment of the present invention provide a kind of method of PUSH message, including:
When the first length connection established with client disconnects and received the foundation request that the client is sent, and institute State client and establish the connection of the second length;
Connected by the described second length to the client push message.
The third aspect, the embodiment of the present invention provide a kind of device of network service, including:
Detection module, for whether having established the connection of the first length between detection and server;
Monitoring modular, for when detecting that foundation has the first length to be connected between server, being connected to the described first length State is monitored;
Module is established, for when monitoring that the first length connection disconnects, establishing the second length with the server and linking.
Fourth aspect, the embodiment of the present invention provide a kind of device of PUSH message, including:
Module is established, for being disconnected in the first length connection established with client and receiving building for the client transmission During vertical request, establish the second length with the client and connect;
Pushing module, for being connected by the described second length to the client push message.
As can be seen from the above technical solutions, the embodiment of the present invention has advantages below:
In the present invention, when the first length connection between detecting client and server disconnects, and server establishes second Long connection so that at least one long connection is maintained between client and server, has ensured the real-time of data, push is improved and leads to The reliability on road.
Brief description of the drawings
Fig. 1 is the schematic flow sheet of one embodiment of the method for the network service of the present invention;
Fig. 2 is the schematic flow sheet of one embodiment of the method for the network service of the present invention;
Fig. 3 is the structural representation of one embodiment of the PUSH message architecture of the present invention;
Fig. 4 is the structural representation of one embodiment of the device of the network service of the present invention;
Fig. 5 is the structural representation of one embodiment of the device of the PUSH message of the present invention;
Fig. 6 is the structural representation of one embodiment of the terminal of the present invention;
Fig. 7 is the structural representation of one embodiment of the server of the present invention.
Embodiment
Referring to Fig. 1, Fig. 1 is the schematic flow sheet of one embodiment of the method for the network service of the present invention.This implementation In example, the method for network service includes:
101st, the connection of the first length whether has been established between detection and server.
102nd, when detecting that foundation has the first length to be connected between server, the state of the described first length connection is supervised Survey.
103rd, when monitoring that the first length connection disconnects, establish the second length with the server and link.
In the present embodiment, the first length connection is the first process in client and server is established long connection, the length It is connected to the message that the reception server is pushed to client.For example, server is connected to using windows7 versions by long Operating system one operating system update of client push prompting message.Establish that the first length is connected with server first Process is usually that default setting is good, and the first length connection is generally the first process and just established on startup with server It is good.
The second process in client detects to the state of the first length connection.Specifically, the second process can lead to Cross IPC come with the first process communication, with obtain this first length connection state.In the present embodiment, the first process and the second process Have respectively a variety of.Optionally, the first process is system service in client, and the second process is desktop application in client.Wherein, System service refers to the process for execution system function, and system service is typically run in client background, is not in journey Sequence window or dialog box, only in task manager just it is observed that;Desktop application has referred to program window or dialogue Frame, with the process interacted with user.Due to system service, the time-to-live is relatively long typically during client is run, and The long connection that server creates is also relatively stable, therefore the first process is preferably system service.
Or first process or the second process can also be an independent process in client, without interface, starting It is special afterwards to create long connection, push operations are performed, this is not restricted.
The method being monitored to the first length connection has a variety of.For example, the first process is when establishing the connection of the first length Also creating has target label position, and value of the target label position when creating is default initial values (such as 0 or FALSE), when When first length connection disconnects, the value of the target label position is changed to desired value (such as 1 or TRUE) by the first process.Second Process passes through interprocess communication (English full name:Inter-Process Communication, english abbreviation:IPC) is obtained The current value of target label position in one process come detect the first length connection state.Wherein, IPC method has a variety of, example Such as by sharing the method for content, or the method sent by pipeline, these methods are prior art, be will not be repeated here.
When the currency of the second monitoring the process to target label position is the desired value, confirm that the first length connection is disconnected Open, then the second process is established the second length with server and connected.Wherein, the method for creating long connection generally creates socket (socket), by socket and to server communication, whether the network port for then monitoring client is received from this The response data of server, if so, the response data is parsed and handled, and confirm that growing connection is successfully established.The establishment The method of long connection is prior art, be will not be repeated here.
Second process and server are established after the second length connects, and pass through that the second length connection the reception server pushes disappears Breath.
Wherein, the process for establishing long connection in client with server is transparent to server, namely server is not Know and establish what process is the process of long connection be with it.Server is by long connection to including in the message of client push For the mark for the target process for performing the message.By taking the second length connection as an example, pass through institute when the second process receives server When stating the message of the second length connection push, the second process obtains the mark of the target process in the message, and by IPC by described in Message is sent to the target process.
In the present embodiment, when the first length connection between detecting client and server disconnects, and server establishes the Two length connections so that at least one long connection is maintained between client and server, the real-time of data has been ensured, has improved push The reliability of path.
Optionally, in the present embodiment, the second process and established with the server after the second length links, also periodically to clothes Business device sends heartbeat data packets, and the heartbeat data packets include the mark of client.For example, client is identified as client GUID (English full name:Globally Unique Identifier, english abbreviation:GUID).Specifically, the heart The essential informations such as version, the digit of client current operation system can also be included by jumping packet, and this is not restricted.
When the second process receive that the server sends to the response data packets of the heartbeat data packets when, determine institute The state for stating the connection of the second length is normal.Specifically, a special field is included in the response data packet, so that client is receiving It is the response to heartbeat data packets that the packet is determined during to the response data packet.Certainly, the first length is connected to when not disconnecting, the One process can also monitor the state of the first length connection using this method, not connect after the first process is sending heartbeat data packets When receiving the response data packet of server transmission, you can determine that the connection of the first length disconnects.
In embodiment illustrated in fig. 1, the second process is when monitoring that the connection of the first length disconnects, and just establishes second with server Long connection.Optionally, in the present invention, when the first length connection does not disconnect, the second process can also establish the second length with server Connection.
In some possible implementations of the present invention, when the first length connection does not disconnect, the second process determines preset Numerical value, the default value are used to indicating that client can be with the transformation of simultaneous long connection, and the default value can be with Be default setting in client, can also be stored in by receiving the setting of user in client, this is not restricted.When When the default value is more than or equal to 2, the second process is established second length with the server and connected.
In the present invention, the first process and the second process can also be same process.But break in the first length connection During situation about opening, the first process and server path it is usually problematic, therefore preferably change a process and come and service Device establishes long connection, namely the first process and the second process are different processes.Or first process and the second process be same Process, wherein, when the second process detection disconnects to the first length connection, second is established with the server after wait preset time period Long connection.
The method of the network service from client-side to the present invention is described above, below will be from server-side The method of the PUSH message of the present invention is described.
Referring to Fig. 2, Fig. 2 is the schematic flow sheet of one embodiment of the method for the PUSH message of the present invention.This implementation In example, the method for PUSH message includes:
201st, when the first length connection established with client disconnects and received the foundation request that the client is sent, The second length is established with the client to connect.
202nd, connected by the described second length to the client push message.
Being established between server and client side has the connection of the first length.When the first length connection disconnects, client is to service The connection of the second length is established in device request.When server receives foundation request, establish the second length with the client and connect.Needing During to client push message, pass through the second long linkup transmit message.
In the present embodiment, when the first length connection disconnects, server and client side establishes the connection of the second length so that client At least one long connection is maintained between server, the real-time of data has been ensured, has improved the reliability of push paths.
Optionally, in the present embodiment, when the described first length connection does not disconnect, if the foundation for receiving client transmission please Ask, establishing the second length with the client connects.So, being established between server and client side has two long connections.Servicing When device is to client push message, wherein one long connection may be selected and carry out PUSH message, or alternately use two long connections PUSH message.
Optionally, in the present embodiment, server and client side establish have two long connections in the case of, server to During client push message, the load of the first length connection and the described second length connection is obtained;Connected using the described first length Connected with less length is loaded in the described second length connection to the client push message.Wherein, the load of long connection is obtained Method have it is a variety of.For example, confirm the load of length connection by obtaining the current transmission amount of long connection.Certainly, it is above-mentioned only For citing, it is not restricted.
Optionally, in the present embodiment, two modules of status service and logical services are included in server, the wherein state takes It is engaged in for safeguarding the long connection between server and each client, logical services are used to extract the long connection at status service Status information, and according to the status information to client push message.Specifically, the status service in server periodically connects The heartbeat data packets that client is sent are received, when server receives the heartbeat data packets, are shown and the length between the client Connection status is normal, and returns to response data packet to client, so that client confirms long connection shape according to the response data packet State is normal.If the long connection status is normal, server is connected to client push by the length and disappeared when performing PUSH message Breath.
Understand the present invention for aspect, to the method for network service of the invention and pushed away with reference to a practical application scene The method of message is sent to carry out citing description.As shown in figure 3, Fig. 3 is one embodiment of the PUSH message architecture of the present invention Structural representation.
In the present embodiment, include the first process and the second process in client 30, between first process and the second process It can be communicated by IPC, wherein, the first process is system service, and the second process is desktop application.Include shape in server 40 State service module and logical services module.
The first process in client 30 is created that socket on startup, is communicated by the socket and server 40, When listen at the network port receive the response data from server 40 when, it is determined that with server 40 establish the first length connect Connect, the message pushed by the second length connection the reception server 40.First process also creates target label position, by the target mark The value of note position is set to TRUE.
The second process and the first process in client 30 monitor the current value of the target label position by IPC, When it is TRUE that the second process, which confirms the value of the target label position, determine that the first length connects normal work.
In the operating time of the first length connection, status service mould of first process every preset time into server 40 Block sends heartbeat data packets, and the heartbeat data packets include the mark of client 30.When the status service module in server 40 connects When receiving the heartbeat data packets, confirmation is normal with the long connection status of client 30, and returns to response data packet to the client.The One process determines that the first long connection status is normal when receiving the response data packet.When the first process is not received by heartbeat During the response data packet of packet, determine that the connection of the first length disconnects, and the value for marking marker bit is changed to FALSE.
When it is FALSE that the second process, which confirms the value of the target label position, socket is created, passes through the socket kimonos Business device 40 communicate, when listen at the network port receive the response data from server 40 when, it is determined that being built with server 40 Vertical second length connection, the message pushed by the second length connection the reception server 40.Or in some special circumstances, the Two processes needs are established the second length with server 40 and connected, then and the second process is actively established the second length with server 40 and connected, So, the long connection of at least two and server foundation in client 30 simultaneously be present.Optionally, the second process and server 40 establish before the connection of the second length, also obtain default value, and the default value is used to indicate that client can be with simultaneous length The transformation of connection;When the default value is more than or equal to 2, establishes second length with the server and connect.
In the operating time of the second length connection, status service mould of second process every preset time into server 40 Block sends heartbeat data packets, and the heartbeat data packets include the mark of client 30.When the status service module in server 40 connects When receiving the heartbeat data packets, confirmation is normal with the long connection status of client 30, and returns to response data packet to the client.The Two processes determine that the second long connection status is normal when receiving the response data packet.When the second process is not received by heartbeat During the response data packet of packet, determine that the connection of the second length disconnects.
Logical services module timing in server 40 obtains and the long connection of client 30 at status service module Status information.If the long connection status is normal, then logical services module is according to specific rules to the PUSH message of client 30. Server 40 and client 30 have at least two long connections simultaneously when, logical services module can also be at status service module The status information of each long connection is obtained, if each long connection all states are normal, then logical services module obtains each The load of bar length connection, and the minimum one long connection of load is selected according to specific rules to the PUSH message of client 30.
Wherein, instruction is also included in the message that server 40 pushes to client 30 for handling the target of the message to enter Journey.The message is sent to by target process by IPC according to the message by the long process for connecting reception message in client 30, So that target process handles the message.
The method of network service and the method for PUSH message of the present invention are described above, below will be to the present invention The device of network service and the device of PUSH message be described.
Referring to Fig. 4, Fig. 4 is the structural representation of one embodiment of the device of the network service of the present invention.This implementation In example, the device 400 of network service includes:
Detection module 401, for whether having established the connection of the first length between detection and server;
Monitoring modular 402, for when detecting that foundation has the first length to be connected between server, being connected to the described first length State be monitored;
Module 403 is established, for when monitoring that the first length connection disconnects, the second long-chain to be established with the server Connect.
In the present embodiment, when the first length connection between detecting client and server disconnects, and server establishes the Two length connections so that at least one long connection is maintained between client and server, the real-time of data has been ensured, has improved push The reliability of path.
Optionally, the device 400 of the network service also includes:
Communication module 404, for being established in module 403 and the server established after the second length links, receive The server connects the message of push by the described second length, and the message includes the target that instruction is used to handle the message Process;The target process is sent the message to by interprocess communication IPC.
Optionally, the monitoring modular 402 is specifically used for when monitoring that the first length connection disconnects, to target label The value of position is monitored, wherein, the value of the target label position is changed to target when the described first length connection disconnects Value;When the currency for monitoring the target label position is the desired value, confirm that the first length connection disconnects.
Optionally, first length is connected as what system service and the server in the device of the network service were established Long connection;
And/or
Second length is connected as the long connection that desktop application and the server in the network service are established.
Optionally, the device 400 of the network service also includes:
Maintenance module 405, for being established in module and the server established after the second length links, periodically to clothes Business device sends heartbeat data packets, and the heartbeat data packets include the mark of the network service;Sent out when receiving the server Send to the response data packets of the heartbeat data packets when, determine that the state of the second length connection is normal.
Optionally, the module 403 of establishing is additionally operable to:
Default value is determined when the described first length connection does not disconnect, the default value is used to indicate the network service Can be with the transformation of simultaneous long connection;
When the default value is more than or equal to 2, establishes second length with the server and connect.
Referring to Fig. 5, Fig. 5 is the structural representation of one embodiment of the device of the PUSH message of the present invention.This implementation In example, the device 500 of PUSH message includes:
Module 501 is established, is sent for disconnecting in the first length connection established with client and receiving the client Foundation request when, establish the second length with the client and connect;
Pushing module 502, for being connected by the described second length to the client push message.
In the present embodiment, when the first length connection disconnects, device and the client of PUSH message are established the second length and connected, and make Maintain at least one long connection between the device of client and PUSH message, ensured the real-time of data, improved push and lead to The reliability on road.
Optionally, the module 501 of establishing is additionally operable to when the described first length connection does not disconnect, if receiving client hair The foundation request sent, establishes the second length with the client and connects.
Optionally, the pushing module 502 is used for:
Obtain the load of the first length connection and the described second length connection;
Connected using less length is loaded in the described first length connection and the described second length connection to the client push Message.
The embodiment of the present invention additionally provides another terminal, as shown in fig. 6, for convenience of description, illustrate only and this hair The related part of bright embodiment, particular technique details do not disclose, refer to present invention method part.The terminal can be with It is to include mobile phone, tablet personal computer, PDA (Personal DigitalAssistant, personal digital assistant), POS (Point of Sales, point-of-sale terminal), any terminal device such as vehicle-mounted computer, so that terminal is mobile phone as an example:
Fig. 6 is illustrated that the block diagram of the part-structure of the mobile phone related to terminal provided in an embodiment of the present invention.Reference chart 6, mobile phone includes:Radio frequency (Radio Frequency, RF) circuit 1010, memory 1020, input block 1030, display unit 1040th, sensor 1050, voicefrequency circuit 1060, Wireless Fidelity (wireless fidelity, WiFi) module 1070, processor The part such as 1080 and power supply 1090.It will be understood by those skilled in the art that the handset structure shown in Fig. 6 is not formed pair The restriction of mobile phone, it can include than illustrating more or less parts, either combine some parts or different part cloth Put.
Each component parts of mobile phone is specifically introduced with reference to Fig. 6:
RF circuits 1010 can be used for receive and send messages or communication process in, the reception and transmission of signal, especially, by base station After downlink information receives, handled to processor 1080;In addition, it is sent to base station by up data are designed.Generally, RF circuits 1010 include but is not limited to antenna, at least one amplifier, transceiver, coupler, low-noise amplifier (Low Noise Amplifier, LNA), duplexer etc..In addition, RF circuits 1010 can also be led to by radio communication and network and other equipment Letter.Above-mentioned radio communication can use any communication standard or agreement, including but not limited to global system for mobile communications (Global System of Mobile communication, GSM), general packet radio service (General Packet Radio Service, GPRS), CDMA (Code Division Multiple Access, CDMA), WCDMA (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE), Email, Short Message Service (Short Messaging Service, SMS) etc..
Memory 1020 can be used for storage software program and module, and processor 1080 is stored in memory by operation 1020 software program and module, so as to perform the various function application of mobile phone and data processing.Memory 1020 can be led To include storing program area and storage data field, wherein, storing program area can storage program area, needed at least one function Application program (such as sound-playing function, image player function etc.) etc.;Storage data field can store uses institute according to mobile phone Data (such as voice data, phone directory etc.) of establishment etc..Stored in addition, memory 1020 can include high random access Device, nonvolatile memory can also be included, a for example, at least disk memory, flush memory device or other volatibility are consolidated State memory device.
Input block 1030 can be used for the numeral or character information for receiving input, and produce with the user of mobile phone set with And the key signals input that function control is relevant.Specifically, input block 1030 may include contact panel 1031 and other inputs Equipment 1032.Contact panel 1031, also referred to as touch-screen, collect touch operation (such as user of the user on or near it Use the behaviour of any suitable object such as finger, stylus or annex on contact panel 1031 or near contact panel 1031 Make), and corresponding attachment means are driven according to formula set in advance.Optionally, contact panel 1031 may include touch detection Two parts of device and touch controller.Wherein, the touch orientation of touch detecting apparatus detection user, and detect touch operation band The signal come, transmits a signal to touch controller;Touch controller receives touch information from touch detecting apparatus, and by it Contact coordinate is converted into, then gives processor 1080, and the order sent of reception processing device 1080 and can be performed.In addition, The polytypes such as resistance-type, condenser type, infrared ray and surface acoustic wave can be used to realize contact panel 1031.Except touch surface Plate 1031, input block 1030 can also include other input equipments 1032.Specifically, other input equipments 1032 can include But it is not limited in physical keyboard, function key (such as volume control button, switch key etc.), trace ball, mouse, action bars etc. It is one or more.
Display unit 1040 can be used for display by user input information or be supplied to user information and mobile phone it is each Kind menu.Display unit 1040 may include display panel 1041, optionally, can use liquid crystal display (Liquid Crystal Display, LCD), the form such as Organic Light Emitting Diode (Organic Light-Emitting Diode, OLED) To configure display panel 1041.Further, contact panel 1031 can cover display panel 1041, when contact panel 1031 detects To after the touch operation on or near it, processor 1080 is sent to determine the type of touch event, is followed by subsequent processing device 1080 provide corresponding visual output according to the type of touch event on display panel 1041.Although in figure 6, contact panel 1031 and display panel 1041 are the parts independent as two to realize the input of mobile phone and input function, but in some realities Apply in example, contact panel 1031 and display panel 1041 can be integrated and realize input and the output function of mobile phone.
Mobile phone may also include at least one sensor 1050, such as optical sensor, motion sensor and other sensors. Specifically, optical sensor may include ambient light sensor and proximity transducer, wherein, ambient light sensor can be according to ambient light Light and shade adjust the brightness of display panel 1041, proximity transducer can close display panel when mobile phone is moved in one's ear 1041 and/or backlight.As one kind of motion sensor, accelerometer sensor can detect in all directions (generally three axles) and add The size of speed, size and the direction of gravity are can detect that when static, application (such as the horizontal/vertical screen available for identification mobile phone posture Switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, tap) etc.;As for mobile phone also The other sensors such as configurable gyroscope, barometer, hygrometer, thermometer, infrared ray sensor, will not be repeated here.
Voicefrequency circuit 1060, loudspeaker 1061, microphone 1062 can provide the COBBAIF between user and mobile phone.Audio Electric signal after the voice data received conversion can be transferred to loudspeaker 1061, is changed by loudspeaker 1061 by circuit 1060 Exported for voice signal;On the other hand, the voice signal of collection is converted to electric signal by microphone 1062, by voicefrequency circuit 1060 Voice data is converted to after reception, then after voice data output processor 1080 is handled, through RF circuits 1010 to be sent to ratio Such as another mobile phone, or voice data is exported to memory 1020 further to handle.
WiFi belongs to short range wireless transmission technology, and mobile phone can help user's transceiver electronicses postal by WiFi module 1070 Part, browse webpage and access streaming video etc., it has provided the user wireless broadband internet and accessed.Although Fig. 6 is shown WiFi module 1070, but it is understood that, it is simultaneously not belonging to must be configured into for mobile phone, can not change as needed completely Become in the essential scope of invention and omit.
Processor 1080 is the control centre of mobile phone, using various interfaces and the various pieces of connection whole mobile phone, By running or performing the software program and/or module that are stored in memory 1020, and call and be stored in memory 1020 Interior data, the various functions and processing data of mobile phone are performed, so as to carry out integral monitoring to mobile phone.Optionally, processor 1080 may include one or more processing units;Preferably, processor 1080 can integrate application processor and modulation /demodulation processing Device, wherein, application processor mainly handles operating system, user interface and application program etc., and modem processor is mainly located Manage radio communication.It is understood that above-mentioned modem processor can not also be integrated into processor 1080.
Mobile phone also includes the power supply 1090 (such as battery) to all parts power supply, it is preferred that power supply can pass through power supply Management system and processor 1080 are logically contiguous, so as to realize management charging, electric discharge and power consumption pipe by power-supply management system The functions such as reason.
Although being not shown, mobile phone can also include camera, bluetooth module etc., will not be repeated here.
In embodiments of the present invention, the processor 1080 included by the terminal also there is control to perform above by network service Device or client executing method flow.
Fig. 7 is a kind of server architecture schematic diagram provided in an embodiment of the present invention, and the server 1100 can be because of configuration or property Energy is different and produces bigger difference, can include one or more central processing units (central processing Units, CPU) 1122 (for example, one or more processors) and memory 1132, one or more storage applications The storage medium 1130 of program 1142 or data 1144 (such as one or more mass memory units).Wherein, memory 1132 and storage medium 1130 can be it is of short duration storage or persistently storage.One can be included by being stored in the program of storage medium 1130 Individual or more than one module (diagram does not mark), each module can include operating the series of instructions in server.More enter One step, central processing unit 1122 be could be arranged to communicate with storage medium 1130, and storage medium is performed on server 1100 Series of instructions operation in 1130.
Server 1100 can also include one or more power supplys 1126, one or more wired or wireless nets Network interface 1150, one or more input/output interfaces 1158, and/or, one or more operating systems 1141, example Such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM etc..
In above-described embodiment as shown in the step performed by the device of server or PUSH message can be based on the Fig. 7 Server architecture.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, the corresponding process in preceding method embodiment is may be referred to, will not be repeated here.
In several embodiments provided herein, it should be understood that disclosed system, apparatus and method can be with Realize by another way.For example, device embodiment described above is only schematical, for example, the unit Division, only a kind of division of logic function, can there is other dividing mode, such as multiple units or component when actually realizing Another system can be combined or be desirably integrated into, or some features can be ignored, or do not perform.It is another, it is shown or The mutual coupling discussed or direct-coupling or communication connection can be the indirect couplings by some interfaces, device or unit Close or communicate to connect, can be electrical, mechanical or other forms.
The unit illustrated as separating component can be or may not be physically separate, show as unit The part shown can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple On NE.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs 's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, can also That unit is individually physically present, can also two or more units it is integrated in a unit.Above-mentioned integrated list Member can both be realized in the form of hardware, can also be realized in the form of SFU software functional unit.
If the integrated unit is realized in the form of SFU software functional unit and is used as independent production marketing or use When, it can be stored in a computer read/write memory medium.Based on such understanding, technical scheme is substantially The part to be contributed in other words to prior art or all or part of the technical scheme can be in the form of software products Embody, the computer software product is stored in a storage medium, including some instructions are causing a computer Equipment (can be personal computer, server, or network equipment etc.) performs the complete of each embodiment methods described of the present invention Portion or part steps.And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disc or CD etc. are various can store journey The medium of sequence code.
Described above, the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although with reference to before Embodiment is stated the present invention is described in detail, it will be understood by those within the art that:It still can be to preceding State the technical scheme described in each embodiment to modify, or equivalent substitution is carried out to which part technical characteristic;And these Modification is replaced, and the essence of appropriate technical solution is departed from the spirit and scope of various embodiments of the present invention technical scheme.

Claims (18)

  1. A kind of 1. method of network service, it is characterised in that including:
    Whether first length connection has been established between detection and server;
    When detecting that foundation has the first length to be connected between the server, the state of the described first length connection is monitored;
    When monitoring that the first length connection disconnects, establish the second length with the server and link.
  2. 2. the method for network service according to claim 1, it is characterised in that described to establish the second length with the server Link, also includes afterwards:
    The message that the server connects push by the described second length is received, the message includes instruction and is used to handle described disappear The target process of breath;
    The target process is sent the message to by interprocess communication IPC.
  3. 3. the method for network service according to claim 1, it is characterised in that described to monitor the first length connection During disconnection, including:
    The value of target label position is monitored, wherein, the value of the target label position disconnects in the described first length connection When be changed to desired value;
    When the currency for monitoring the target label position is the desired value, confirm that the first length connection disconnects.
  4. 4. the method for network service according to claim 1, it is characterised in that it is described first length be connected as in client be The long connection that system service and the server are established;
    And/or
    Second length is connected as the long connection that desktop application and the server in client are established.
  5. 5. the method for network service according to claim 1, it is characterised in that described to establish the second length with the server Link, also includes afterwards:
    Heartbeat data packets periodically are sent to server, the heartbeat data packets include the mark of client;
    When receiving that the server sends to the response data packets of the heartbeat data packets, the second length connection is determined State it is normal.
  6. 6. the method for network service according to claim 1, it is characterised in that when the described first length connection does not disconnect, Methods described also includes:
    Default value is determined, the default value is used to indicate that client can be with the transformation of simultaneous long connection;
    When the default value is more than or equal to 2, establishes second length with the server and connect.
  7. A kind of 7. method of PUSH message, it is characterised in that including:
    When the first length connection established with client disconnects and received the foundation request that the client is sent, and the visitor The connection of the second length is established at family end;
    Connected by the described second length to the client push message.
  8. 8. the method for PUSH message according to claim 7, it is characterised in that methods described also includes:
    When the first length connection does not disconnect, if the foundation request of client transmission is received, and the client establishes second Long connection.
  9. 9. the method for PUSH message according to claim 8, it is characterised in that methods described also includes:
    Obtain the load of the first length connection and the described second length connection;
    Connected using less length is loaded in the described first length connection and the described second length connection to the client push message.
  10. A kind of 10. device of network service, it is characterised in that including:
    Detection module, for whether having established the connection of the first length between detection and server;
    Monitoring modular, for the state when detecting that foundation has the first length to be connected between server, connected to the described first length It is monitored;
    Module is established, for when monitoring that the first length connection disconnects, establishing the second length with the server and linking.
  11. 11. the device of network service according to claim 10, it is characterised in that described device also includes:
    Communication module, for being established in module and the server established after the second length links, receive the server By the message of the described second length connection push, the message includes the target process that instruction is used to handle the message;Pass through Interprocess communication IPC sends the message to the target process.
  12. 12. the device of network service according to claim 10, it is characterised in that the monitoring modular is specifically used for when prison When measuring the first length connection disconnection, the value of target label position is monitored, wherein, the value of the target label position Desired value is changed to when the described first length connection disconnects;When the currency for monitoring the target label position is the target During value, confirm that the first length connection disconnects.
  13. 13. the device of network service according to claim 10, it is characterised in that first length is connected as the network The long connection that system service and the server are established in the device of communication;
    And/or
    Second length is connected as the long connection that desktop application and the server in the network service are established.
  14. 14. the device of network service according to claim 10, it is characterised in that described device also includes:
    Maintenance module, for being established in module and the server established after the second length links, periodically sent out to server Heartbeat data packets are sent, the heartbeat data packets include the mark of the network service;When pair for receiving the server transmission During the response data packet of the heartbeat data packets, determine that the state of the second length connection is normal.
  15. 15. the device of network service according to claim 10, it is characterised in that the module of establishing is additionally operable to:
    Default value is determined when the described first length connection does not disconnect, and the default value is used to indicating that the network service can be with The transformation of simultaneous long connection;
    When the default value is more than or equal to 2, establishes second length with the server and connect.
  16. A kind of 16. device of PUSH message, it is characterised in that including:
    Module is established, please for disconnecting and receiving the foundation that the client is sent in the first length connection established with client When asking, establish the second length with the client and connect;
    Pushing module, for being connected by the described second length to the client push message.
  17. 17. the device of PUSH message according to claim 16, it is characterised in that the module of establishing is additionally operable to described When first length connection does not disconnect, if receiving the foundation request of client transmission, establish the second length with the client and connect.
  18. 18. the device of PUSH message according to claim 17, it is characterised in that the pushing module is used for:
    Obtain the load of the first length connection and the described second length connection;
    Connected using less length is loaded in the described first length connection and the described second length connection to the client push message.
CN201610807978.8A 2016-09-07 2016-09-07 Network communication method and device, and message pushing method and device Active CN107800585B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610807978.8A CN107800585B (en) 2016-09-07 2016-09-07 Network communication method and device, and message pushing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610807978.8A CN107800585B (en) 2016-09-07 2016-09-07 Network communication method and device, and message pushing method and device

Publications (2)

Publication Number Publication Date
CN107800585A true CN107800585A (en) 2018-03-13
CN107800585B CN107800585B (en) 2021-01-12

Family

ID=61530854

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610807978.8A Active CN107800585B (en) 2016-09-07 2016-09-07 Network communication method and device, and message pushing method and device

Country Status (1)

Country Link
CN (1) CN107800585B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109600444A (en) * 2018-12-14 2019-04-09 北京向上心科技有限公司 Data push method, server, terminal, electronic equipment and readable storage medium storing program for executing
CN110958162A (en) * 2019-12-06 2020-04-03 广东博智林机器人有限公司 BLE cascade network, link detection method, equipment and terminal thereof
CN111726413A (en) * 2020-06-28 2020-09-29 北京百度网讯科技有限公司 Equipment connection method and device
CN112437329A (en) * 2020-11-05 2021-03-02 上海幻电信息科技有限公司 Method, device and equipment for playing video and readable storage medium
CN113162956A (en) * 2020-01-22 2021-07-23 华为技术有限公司 Method, device and network equipment for establishing communication connection
CN115297162A (en) * 2022-06-27 2022-11-04 青岛海尔科技有限公司 Message sending method and device, storage medium and electronic device

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102291808A (en) * 2011-06-03 2011-12-21 莫雅静 Network communication method, communication equipment and middleware of communication equipment
CN103024043A (en) * 2012-12-14 2013-04-03 腾讯科技(深圳)有限公司 Method, server and system for sharing data
CN103532943A (en) * 2013-10-08 2014-01-22 北京神州绿盟信息安全科技股份有限公司 Web application firewall device and asynchronous security protection log processing method
CN103605689A (en) * 2013-11-01 2014-02-26 北京奇虎科技有限公司 Method and device for acquiring visiting staying time
CN103916936A (en) * 2013-01-04 2014-07-09 中国移动通信集团公司 Method and system for realizing data long connection, mobile terminal and server
CN103944923A (en) * 2014-05-14 2014-07-23 沈文策 Network information processing system and method
CN104717133A (en) * 2015-03-16 2015-06-17 墨仕(厦门)电子商务有限公司 Distributed message push system and method
CN105357283A (en) * 2015-10-20 2016-02-24 北京奇虎科技有限公司 Long connection establishing method for intelligent wearable device, server and terminal
CN105681391A (en) * 2015-12-28 2016-06-15 智慧方舟科技有限公司 Server, Android client and network communication method and device of server and Android client
CN105677451A (en) * 2014-11-18 2016-06-15 北京风行在线技术有限公司 Load balancing method and equipment used for multiple processes

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102291808A (en) * 2011-06-03 2011-12-21 莫雅静 Network communication method, communication equipment and middleware of communication equipment
CN103024043A (en) * 2012-12-14 2013-04-03 腾讯科技(深圳)有限公司 Method, server and system for sharing data
CN103916936A (en) * 2013-01-04 2014-07-09 中国移动通信集团公司 Method and system for realizing data long connection, mobile terminal and server
CN103532943A (en) * 2013-10-08 2014-01-22 北京神州绿盟信息安全科技股份有限公司 Web application firewall device and asynchronous security protection log processing method
CN103605689A (en) * 2013-11-01 2014-02-26 北京奇虎科技有限公司 Method and device for acquiring visiting staying time
CN103944923A (en) * 2014-05-14 2014-07-23 沈文策 Network information processing system and method
CN105677451A (en) * 2014-11-18 2016-06-15 北京风行在线技术有限公司 Load balancing method and equipment used for multiple processes
CN104717133A (en) * 2015-03-16 2015-06-17 墨仕(厦门)电子商务有限公司 Distributed message push system and method
CN105357283A (en) * 2015-10-20 2016-02-24 北京奇虎科技有限公司 Long connection establishing method for intelligent wearable device, server and terminal
CN105681391A (en) * 2015-12-28 2016-06-15 智慧方舟科技有限公司 Server, Android client and network communication method and device of server and Android client

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109600444A (en) * 2018-12-14 2019-04-09 北京向上心科技有限公司 Data push method, server, terminal, electronic equipment and readable storage medium storing program for executing
CN110958162A (en) * 2019-12-06 2020-04-03 广东博智林机器人有限公司 BLE cascade network, link detection method, equipment and terminal thereof
CN113162956A (en) * 2020-01-22 2021-07-23 华为技术有限公司 Method, device and network equipment for establishing communication connection
CN111726413A (en) * 2020-06-28 2020-09-29 北京百度网讯科技有限公司 Equipment connection method and device
CN112437329A (en) * 2020-11-05 2021-03-02 上海幻电信息科技有限公司 Method, device and equipment for playing video and readable storage medium
CN112437329B (en) * 2020-11-05 2024-01-26 上海幻电信息科技有限公司 Method, device and equipment for playing video and readable storage medium
CN115297162A (en) * 2022-06-27 2022-11-04 青岛海尔科技有限公司 Message sending method and device, storage medium and electronic device
CN115297162B (en) * 2022-06-27 2024-03-22 青岛海尔科技有限公司 Message sending method and device, storage medium and electronic device

Also Published As

Publication number Publication date
CN107800585B (en) 2021-01-12

Similar Documents

Publication Publication Date Title
CN107800585A (en) The method and apparatus of network service, the method and apparatus of PUSH message
CN106155818B (en) A kind of terminal pulls the processing method and terminal and server of information
CN106534288B (en) A kind of data transmission method and mobile terminal
CN106681860B (en) A kind of data back up method and data backup device
CN105430600B (en) A kind of data transmission method and the terminal of data transmission
CN106603740B (en) It is connected to the network abnormal processing method and terminal device
CN106708633B (en) The method and mobile terminal of increasing terminal WiFi workstation mode closing velocities
CN112691363A (en) Cross-terminal switching method and related device for cloud games
CN109324866A (en) Using the processing method of footmark, device, computer readable storage medium and terminal
CN109102153A (en) A kind of identity management method and device
CN106980554B (en) Process processing method and device
CN117852753B (en) Printing and dyeing workshop intelligent management system based on Internet of things
CN106331302B (en) A kind of method and apparatus adding contact person
CN107104760B (en) Method for transmitting data packet, client and server
CN111359210B (en) Data processing method and device, electronic equipment and storage medium
CN104378339B (en) A kind of communication means and device using agency agreement
CN107786423A (en) A kind of method and system of instant messaging
CN116468382A (en) RPA robot flow management method, device, equipment and storage medium
CN110277097A (en) Data processing method and relevant device
CN117119036A (en) Method, device, storage medium and equipment for supporting access to multiple cloud servers
CN106209601B (en) State update message pushing method and device
CN109286571A (en) The method, apparatus and storage device of mobile terminal and application program limit core and limit net
WO2018103379A1 (en) Terminal monitoring method and mobile terminal
CN107390857A (en) The method and apparatus and mobile terminal of a kind of temperature control
CN112667868B (en) Data detection method and device

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
TR01 Transfer of patent right

Effective date of registration: 20221130

Address after: 1402, Floor 14, Block A, Haina Baichuan Headquarters Building, No. 6, Baoxing Road, Haibin Community, Xin'an Street, Bao'an District, Shenzhen, Guangdong 518000

Patentee after: Shenzhen Yayue Technology Co.,Ltd.

Address before: 2, 518000, East 403 room, SEG science and Technology Park, Zhenxing Road, Shenzhen, Guangdong, Futian District

Patentee before: TENCENT TECHNOLOGY (SHENZHEN) Co.,Ltd.

TR01 Transfer of patent right