CN106911795A - A kind of data request processing device and method - Google Patents

A kind of data request processing device and method Download PDF

Info

Publication number
CN106911795A
CN106911795A CN201710188974.0A CN201710188974A CN106911795A CN 106911795 A CN106911795 A CN 106911795A CN 201710188974 A CN201710188974 A CN 201710188974A CN 106911795 A CN106911795 A CN 106911795A
Authority
CN
China
Prior art keywords
server
request
data
sse
passages
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.)
Pending
Application number
CN201710188974.0A
Other languages
Chinese (zh)
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.)
Nubia Technology Co Ltd
Original Assignee
Nubia Technology 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 Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN201710188974.0A priority Critical patent/CN106911795A/en
Publication of CN106911795A publication Critical patent/CN106911795A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/142Managing session states for stateless protocols; Signalling session states; State transitions; Keeping-state mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a kind of data request processing device and method, client is applied to, described device includes:Module is set up, setting up server with server sends event SSE passages;Sending module, sends request of data, and receive the distinguishing mark corresponding with the request of data that the server sends;Processing module, receives the treatment state corresponding with the request of data that the server is sent by the SSE passages, and according to the SSE passages and the distinguishing mark, the alignment processing result of the request of data is obtained from the server.The invention also discloses a kind of data request processing method, as long as establishing SSE passages, client can obtain corresponding result by SSE passages after the completion of data request processing, and the connection for being always maintained at server without client, save the resource of server.

Description

A kind of data request processing device and method
Technical field
The present invention relates to data request processing technical field, more particularly to a kind of data request processing device and method.
Background technology
First, when client sends request of data, server can carry out data processing, work as server process after receiving request Finish is to send the corresponding result of request of data to client to feed back.And in practical application, server needs to connect in synchronization Receive substantial amounts of user to access, as the request of data time that the increasing server of user's access number responds user can also lengthen.
Therefore, user's request of the prior art generally require server perform for a long time just can returning result when, And have always a demand for keeping this connection during this period between user and server, if disconnecting will influence data to ask Seek the feedback of corresponding result.
It can be seen that, in the prior art for the request of each user, server will remain this connection always, will very Connection number is wasted, can so cause the pressure of server excessive;And it is always maintained at connecting the resource that can also waste server.
The content of the invention
It is a primary object of the present invention to propose a kind of data request processing device and method, it is intended to solve in the prior art After request sends, client can be always maintained at the connection with server, until request is disposed, server can be caused to connect Number of users it is excessive, cause server stress big and waste the problem of server resource.
To achieve the above object, the invention provides a kind of data request processing device, client, described device are applied to Including:
Module is set up, event SSE passages are sent for setting up server with server;
Sending module, for sending request of data, and receives the corresponding with the request of data of the server transmission Distinguishing mark;
Processing module, for receive the server by the SSE passages send it is corresponding with the request of data Treatment state, and according to the SSE passages and the distinguishing mark, the correspondence of the request of data is obtained from the server Result.
Optionally, the distinguishing mark is general unique identifier.
Optionally, the processing module, including:
First receiving submodule, for receiving the request of data pair that the server is sent by the SSE passages The treatment state answered;
Sending submodule, for when the treatment state for receiving is to complete, sending the request for obtaining result To the server;
Acquisition submodule, for according to the SSE passages and the distinguishing mark, the number being obtained from the server According to the alignment processing result of request.
Optionally, it is described to set up module, specifically for:
The request that server transmission event SSE passages will be set up is sent to proxy server, with the proxy server point The server matched somebody with somebody sets up the server and sends event SSE passages;
The treatment processing module, including:
Second receiving submodule being sent with the request of data for receiving the server by the SSE passages Corresponding treatment state, wherein, the server will treatment state corresponding with the request of data and result send to Message queue;
3rd receiving submodule, for according to the SSE passages and the distinguishing mark, receiving the server from institute The result for obtaining and sending in message queue is stated, wherein, the result is the alignment processing with the request of data.
Optionally, the message queue is Mark reaction kafka queues.
Compared to prior art, data request processing device proposed by the invention sets up server by with server Transmission event SSE passages;Then request of data is sent, and receives the knowledge corresponding with the request of data that the server sends Do not indicate;Receive the treatment state corresponding with the request of data that the server is sent by the SSE passages, and according to The SSE passages and the distinguishing mark, the alignment processing result of the request of data is obtained from the server.So only SSE passages are established, client can obtain corresponding treatment knot by SSE passages after the completion of data request processing Really, the connection for being always maintained at server without client, so as to save the resource of server.
Additionally, to achieve the above object, the present invention also proposes a kind of data request processing method, is applied to client, institute The method of stating includes:
Server is set up with server send event SSE passages;
Request of data is sent, and receives the distinguishing mark corresponding with the request of data that the server sends;
Receive the treatment state corresponding with the request of data that the server is sent by the SSE passages, and root According to the SSE passages and the distinguishing mark, the alignment processing result of the request of data is obtained from the server.
Optionally, the distinguishing mark is general unique identifier.
Optionally, it is described to receive the place corresponding with the request of data that the server is sent by the SSE passages Reason state, and according to the SSE passages and the distinguishing mark, the corresponding position of the request of data is obtained from the server Reason result, including:
The server is received by the corresponding treatment state of the request of data that the SSE passages send;
When the treatment state for receiving is to complete, the request for obtaining result is sent to the server;
According to the SSE passages and the distinguishing mark, the corresponding position of the request of data is obtained from the server Reason result.
Optionally, it is described to set up server transmission event SSE passages with server, including:
The request that server transmission event SSE passages will be set up is sent to proxy server, with the proxy server point The server matched somebody with somebody sets up the server and sends event SSE passages;
It is described to receive the treatment state corresponding with the request of data that the server is sent by the SSE passages, And according to the SSE passages and the distinguishing mark, the alignment processing result of the request of data is obtained from the server, Including:
The treatment state corresponding with the request of data that the server is sent by the SSE passages is received, wherein, The server sends to message queue treatment state corresponding with the request of data and result;
According to the SSE passages and the distinguishing mark, receive the server and obtained simultaneously from the message queue The result of transmission, wherein, the result is the alignment processing with the request of data.
Optionally, the message queue is Mark reaction kafka queues.
Compared to prior art, data request processing method proposed by the invention sets up server by with server Transmission event SSE passages;Then request of data is sent, and receives the knowledge corresponding with the request of data that the server sends Do not indicate;Receive the treatment state corresponding with the request of data that the server is sent by the SSE passages, and according to The SSE passages and the distinguishing mark, the alignment processing result of the request of data is obtained from the server.So only SSE passages are established, client can obtain corresponding treatment knot by SSE passages after the completion of data request processing Really, the connection for being always maintained at server without client, so as to save the resource of server.
Brief description of the drawings
Fig. 1 is the hardware architecture diagram for realizing an optional mobile terminal in each embodiment of the invention;
Fig. 2 is the wireless communication system schematic diagram of mobile terminal as shown in Figure 1;
Fig. 3 is a kind of high-level schematic functional block diagram of data request processing device of the present invention;
Fig. 4 is asynchronous process flow chart provided by the present invention;
Fig. 5 is another high-level schematic functional block diagram of data request processing device of the present invention;
Fig. 6 is the schematic flow sheet of data request processing device first embodiment of the present invention;
Fig. 7 is a kind of schematic flow sheet of data request processing method of the present invention;
Fig. 8 is another schematic flow sheet of data request processing method of the present invention.
Reference:
The realization of the object of the invention, functional characteristics and advantage will be described further referring to the drawings in conjunction with the embodiments.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The mobile terminal of each embodiment of the invention is realized referring now to Description of Drawings.In follow-up description, use For represent element such as " module ", " part " or " unit " suffix only for being conducive to explanation of the invention, itself Not specific meaning.Therefore, " module " can be used mixedly with " part ".
Mobile terminal can be implemented in a variety of manners.For example, the terminal described in the present invention can include such as moving Phone, smart phone, notebook computer, digit broadcasting receiver, PDA (personal digital assistant), PAD (panel computer), PMP The mobile terminal of (portable media player), guider etc. and such as numeral TV, desktop computer etc. are consolidated Determine terminal.Hereinafter it is assumed that terminal is mobile terminal.However, it will be understood by those skilled in the art that, except being used in particular for movement Outside the element of purpose, construction according to the embodiment of the present invention can also apply to the terminal of fixed type.
Fig. 1 is that the hardware configuration of the mobile terminal for realizing each embodiment of the invention is illustrated.
Mobile terminal 1 00 can include that wireless communication unit 110, input block 120, user input unit 130, sensing are single Unit 140, output unit 150, memory 160, interface unit 170, controller 180 and power subsystem 190 etc..Fig. 1 shows Mobile terminal with various assemblies, it should be understood that being not required for implementing all components for showing.Can be alternatively real Apply more or less component.The element of mobile terminal will be discussed in more detail below.
Wireless communication unit 110 generally includes one or more assemblies, and it allows mobile terminal 1 00 and wireless communication system Or the radio communication between network.For example, wireless communication unit can include broadcasting reception module, mobile communication module, nothing At least one of line the Internet module, short range communication module and location information module.
Broadcasting reception module receives broadcast singal from external broadcast management server via broadcast channel and/or broadcast is related Information.Broadcast channel can include satellite channel and/or terrestrial channel.Broadcast management server can generate and send broadcast The server of signal and/or broadcast related information or the broadcast singal generated before receiving and/or broadcast related information and Send it to the server of terminal.Broadcast singal can include TV broadcast singals, radio signals, data broadcasting signal Etc..And, broadcast singal may further include the broadcast singal combined with TV or radio signals.The related letter of broadcast Breath can also be provided via mobile communications network, and in this case, broadcast related information can be come by mobile communication module Receive.Broadcast singal can exist in a variety of manners, for example, it can be referred to the electronic programming of DMB (DMB) The form of southern (EPG), the electronic service guidebooks (ESG) of digital video broadcast-handheld (DVB-H) etc. and exist.Broadcast reception mould Block can receive signal and broadcast by using various types of broadcast systems.Especially, broadcasting reception module can be by using Such as multimedia broadcasting-ground (DMB-T), DMB-satellite (DMB-S), DVB-hand-held (DVB- H), forward link media (MediaFLO@) Radio Data System, received terrestrial digital broadcasting integrated service (ISDB-T) etc. number Word broadcast system receives digital broadcasting.Broadcasting reception module may be constructed such that the various broadcast systems for being adapted to provide for broadcast singal And above-mentioned digit broadcasting system.The broadcast singal and/or broadcast related information received via broadcasting reception module can be stored In memory 160 (or other types of storage medium).
Mobile communication module send radio signals to base station (for example, access point, node B etc.), exterior terminal with And at least one of server and/or receive from it radio signal.Such radio signal can include voice call Signal, video calling signal or the various types of data for sending and/or receiving according to text and/or Multimedia Message.
Wireless Internet module supports the Wi-Fi (Wireless Internet Access) of mobile terminal.The module can be coupled internally or externally To terminal.Wi-Fi (Wireless Internet Access) technology involved by the module can include WLAN (WLAN) (Wi-Fi), Wibro (nothings Line width band), Wimax (worldwide interoperability for microwave accesses), HSDPA (high-speed downlink packet access) etc..
Short range communication module is the module for supporting junction service.Some examples of short-range communication technology include bluetoothTM、 Radio frequency identification (RFID), Infrared Data Association (IrDA), ultra wide band (UWB), purple honeybeeTMEtc..
Location information module is the module for checking or obtaining the positional information of mobile terminal.The allusion quotation of location information module Type example is GPS (global positioning system).According to current technology, GPS module calculates the distance from three or more satellites Information and correct time information and the Information application triangulation for calculating, so as to according to longitude, latitude and height Three-dimensional current location information is calculated exactly.Currently, for calculate position and temporal information method use three satellites and The position calculated by using other satellite correction and the error of temporal information.Additionally, GPS module can be by reality When ground Continuous plus current location information carry out calculating speed information.
Input block 120 is used to receive audio or video signal.Input block 120 can include camera 121 and microphone 122, static images or video that 121 pairs, camera is obtained in Video Capture pattern or image capture mode by image capture apparatus View data processed.Picture frame after treatment may be displayed on display unit 151.Figure after being processed through camera 121 As frame can be stored in memory 160 (or other storage mediums) or is transmitted via wireless communication unit 110, can be with Construction according to mobile terminal provides two or more cameras 121.Microphone 122 can telephone calling model, logging mode, Sound (voice data) is received via microphone in speech recognition mode etc. operational mode, and can be by such sound It is voice data to manage.Audio (voice) data after treatment can be converted in the case of telephone calling model can be via movement Communication module is sent to the form output of mobile communication base station.Microphone 122 can implement various types of noises and eliminate (or suppression System) algorithm eliminating (or suppression) in the noise or interference for receiving and producing during sending audio signal.
User input unit 130 can generate key input data to control each of mobile terminal according to the order of user input Plant operation.User input unit 130 allows the various types of information of user input, and can include keyboard, metal dome, touch Plate (for example, detection due to being touched caused by resistance, pressure, electric capacity etc. change sensitive component), roller, rocking bar etc. Deng.Especially, when touch pad is superimposed upon on display unit 151 in the form of layer, touch-screen can be formed.
Sensing unit 140 detects the current state of mobile terminal 1 00, (for example, mobile terminal 1 00 opens or closes shape State), the presence or absence of the contact (that is, touch input) of the position of mobile terminal 1 00, user for mobile terminal 1 00, mobile terminal The acceleration or deceleration movement of 100 orientation, mobile terminal 1 00 and direction etc., and generate for controlling mobile terminal 1 00 The order of operation or signal.For example, when mobile terminal 1 00 is embodied as sliding-type mobile phone, sensing unit 140 can be sensed The sliding-type phone is opened or closed.In addition, sensing unit 140 can detect power subsystem 190 whether provide electric power or Whether person's interface unit 170 couples with external device (ED).Sensing unit 140 can include vocal print sensor, for gathering user's Voiceprint.
Interface unit 170 is connected the interface that can pass through with mobile terminal 1 00 as at least one external device (ED).For example, External device (ED) can include wired or wireless head-band earphone port, external power source (or battery charger) port, wired or nothing Line FPDP, memory card port, the port for connecting the device with identification module, audio input/output (I/O) end Mouth, video i/o port, ear port etc..Identification module can be that storage uses each of mobile terminal 1 00 for verifying user Kind of information and subscriber identification module (UIM), client identification module (SIM), Universal Subscriber identification module (USIM) can be included Etc..In addition, the device (hereinafter referred to as " identifying device ") with identification module can take the form of smart card, therefore, know Other device can be connected via port or other attachment means with mobile terminal 1 00.Interface unit 170 can be used for reception and come from The input (for example, data message, electric power etc.) of the external device (ED) and input that will be received is transferred in mobile terminal 1 00 One or more elements can be used for transmitting data between mobile terminal and external device (ED).
In addition, when mobile terminal 1 00 is connected with external base, interface unit 170 can serve as allowing by it by electricity Power provides to the path of mobile terminal 1 00 from base or can serve as allowing the various command signals being input into from base to pass through it It is transferred to the path of mobile terminal.Be can serve as recognizing that mobile terminal is from the various command signals or electric power of base input The no signal being accurately fitted within base.Output unit 150 is configured to provide defeated with vision, audio and/or tactile manner Go out signal (for example, audio signal, vision signal, alarm signal, vibration signal etc.).Output unit 150 can include display Unit 151, dio Output Modules 152, alarm unit 153 etc..
Display unit 151 may be displayed on the information processed in mobile terminal 1 00.For example, when mobile terminal 1 00 is in electricity During words call mode, display unit 151 can show and converse or other communicate (for example, text messaging, multimedia file Download etc.) related user interface (UI) or graphic user interface (GUI).When mobile terminal 1 00 is in video calling pattern Or during image capture mode, display unit 151 can show the image of capture and/or the image of reception, show video or figure UI or GUI of picture and correlation function etc..
Meanwhile, when display unit 151 and touch pad in the form of layer it is superposed on one another to form touch-screen when, display unit 151 can serve as input unit and output device.Display unit 151 can include liquid crystal display (LCD), thin film transistor (TFT) In LCD (TFT-LCD), Organic Light Emitting Diode (OLED) display, flexible display, three-dimensional (3D) display etc. at least It is a kind of.Some in these displays may be constructed such that transparence to allow user to be watched from outside, and this is properly termed as transparent Display, typical transparent display can be, for example, TOLED (transparent organic light emitting diode) display etc..According to specific Desired implementation method, mobile terminal 1 00 can include two or more display units (or other display devices), for example, moving Dynamic terminal can include outernal display unit (not shown) and inner display unit (not shown).Touch-screen can be used to detect touch Input pressure and touch input position and touch input area.
Dio Output Modules 152 can mobile terminal be in call signal reception pattern, call mode, logging mode, It is that wireless communication unit 110 is received or in memory 160 when under the isotypes such as speech recognition mode, broadcast reception mode The voice data transducing audio signal of middle storage and it is output as sound.And, dio Output Modules 152 can be provided and movement The audio output (for example, call signal receives sound, message sink sound etc.) of the specific function correlation that terminal 100 is performed. Dio Output Modules 152 can include loudspeaker, buzzer etc..
Alarm unit 153 can provide output and be notified to mobile terminal 1 00 with by event.Typical event can be with Including calling reception, message sink, key signals input, touch input etc..In addition to audio or video is exported, alarm unit 153 can in a different manner provide output with the generation of notification event.For example, alarm unit 153 can be in the form of vibrating Output is provided, when calling, message or some other entrance communication (incomingcommunication) are received, alarm list Unit 153 can provide tactile output (that is, vibrating) to notify to user.Exported by providing such tactile, even if When in pocket of the mobile phone of user in user, user also can recognize that the generation of various events.Alarm unit 153 The output of the generation of notification event can be provided via display unit 151 or dio Output Modules 152.
Memory 160 can store software program for the treatment and control operation performed by controller 180 etc., Huo Zheke Temporarily to store oneself data (for example, telephone directory, message, still image, video etc.) through exporting or will export.And And, memory 160 can store the vibration of various modes on being exported when touching and being applied to touch-screen and audio signal Data.
Memory 160 can include the storage medium of at least one type, and the storage medium includes flash memory, hard disk, many Media card, card-type memory (for example, SD or DX memories etc.), random access storage device (RAM), static random-access storage Device (SRAM), read-only storage (ROM), Electrically Erasable Read Only Memory (EEPROM), programmable read only memory (PROM), magnetic storage, disk, CD etc..And, mobile terminal 1 00 can perform memory with by network connection The network storage device cooperation of 160 store function.
The overall operation of the generally control mobile terminal of controller 180.For example, controller 180 is performed and voice call, data Communication, video calling etc. related control and treatment.In addition, controller 180 can be included for reproducing (or playback) many matchmakers The multi-media module 181 of volume data, multi-media module 181 can be constructed in controller 180, or can be structured as and control Device 180 is separated.Controller 180 can be with execution pattern identifying processing, the handwriting input that will be performed on the touchscreen or picture Draw input and be identified as character or image.
Power subsystem 190 receives external power or internal power under the control of controller 180 and provides operation each unit Appropriate electric power needed for part and component.
Various implementation methods described herein can be with use such as computer software, hardware or its any combination of calculating Machine computer-readable recording medium is implemented.Implement for hardware, implementation method described herein can be by using application-specific IC (ASIC), digital signal processor (DSP), digital signal processing device (DSPD), programmable logic device (PLD), scene can Programming gate array (FPGA), processor, controller, microcontroller, microprocessor, it is designed to perform function described herein At least one in electronic unit is implemented, and in some cases, such implementation method can be implemented in controller 180. For software implementation, the implementation method of such as process or function can with allow to perform the single of at least one function or operation Software module is implemented.Software code can be come by the software application (or program) write with any appropriate programming language Implement, software code can be stored in memory 160 and performed by controller 180.
So far, oneself according to its function through describing mobile terminal.Below, with reference to the present invention, the mobile terminal is a tool There is the display terminal of display function, display terminal discussed below is the mobile terminal 1 00.The present invention can be applied to appoint The display terminal of what type, and it is not limited to Leading format terminal.
Mobile terminal 1 00 as shown in Figure 1 may be constructed such that using via frame or packet transmission data it is all if any Line and wireless communication system and satellite-based communication system are operated.
The communication system that mobile terminal wherein of the invention can be operated is described referring now to Fig. 2.
Such communication system can use different air interface and/or physical layer.For example, used by communication system Air interface includes such as frequency division multiple access (FDMA), time division multiple acess (TDMA), CDMA (CDMA) and universal mobile communications system System (UMTS) (especially, Long Term Evolution (LTE)), global system for mobile communications (GSM) etc..As non-limiting example, under The description in face is related to cdma communication system, but such teaching is equally applicable to other types of system.
With reference to Fig. 2, cdma wireless communication system can include multiple mobile terminal 1s 00, multiple base station (BS) 270, base station Controller (BSC) 275 and mobile switching centre (MSC) 280.MSC280 is configured to and Public Switched Telephony Network (PSTN) 290 form interface.MSC280 is also structured to form interface with the BSC275 that can be couple to base station 270 via back haul link. If any one in the interface that back haul link can be known according to Ganji is constructed, the interface includes such as E1/T1, ATM, IP, PPP, frame relay, HDSL, ADSL or xDSL.It will be appreciated that system can include multiple BSC2750 as shown in Figure 2.
Each BS270 can service one or more subregions (or region), by multidirectional antenna or the day of sensing specific direction Each subregion of line covering is radially away from BS270.Or, each subregion can be by two or more for diversity reception Antenna is covered.Each BS270 may be constructed such that the multiple frequency distribution of support, and the distribution of each frequency has specific frequency spectrum (for example, 1.25MHz, 5MHz etc.).
What subregion and frequency were distributed intersects can be referred to as CDMA Channel.BS270 can also be referred to as base station transceiver System (BTS) or other equivalent terms.In this case, term " base station " can be used for broadly representing single BSC275 and at least one BS270.Base station can also be referred to as " cellular station ".Or, each subregion of specific BS270 can be claimed It is multiple cellular stations.
As shown in Figure 2, broadcast singal is sent to broadcsting transmitter (BT) 295 mobile terminal operated in system 100.Broadcasting reception module 111 as shown in Figure 1 is arranged at mobile terminal 1 00 to receive the broadcast sent by BT295 Signal.In fig. 2 it is shown that several global positioning system (GPS) satellites 300.Satellite 300 helps position multiple mobile terminals At least one of 100.
In fig. 2, multiple satellites 300 are depicted, it is understood that be, it is possible to use any number of satellite obtains useful Location information.GPS module 115 as shown in Figure 1 is generally configured to coordinate with satellite 300 to be believed with obtaining desired positioning Breath.Substitute GPS tracking techniques or outside GPS tracking techniques, it is possible to use other of the position of mobile terminal can be tracked Technology.In addition, at least one gps satellite 300 can optionally or additionally process satellite dmb transmission.
Used as a typical operation of wireless communication system, BS270 receives the reverse link from various mobile terminal 1s 00 Signal.Mobile terminal 1 00 generally participates in call, information receiving and transmitting and other types of communication.Each of the reception of certain base station 270 is anti- Processed in specific BS270 to link signal.The data of acquisition are forwarded to the BSC275 of correlation.BSC provides call Resource allocation and the mobile management function of the coordination including the soft switching process between BS270.The number that BSC275 will also be received According to MSC280 is routed to, it provides the extra route service for forming interface with PSTN290.Similarly, PSTN290 with MSC280 forms interface, and MSC and BSC275 form interface, and BSC275 correspondingly controls BS270 with by forward link signals It is sent to mobile terminal 1 00.
Based on above-mentioned mobile terminal hardware configuration and communication system, present system each embodiment is proposed.
First, the present invention proposes a kind of data request processing device 400.
As shown in figure 3, the high-level schematic functional block diagram of data request processing device of the present invention.In the present embodiment, The data request processing device 400 can be divided into one or more modules, and one or more of modules are stored in It is in the memory 160 and performed by one or more controllers (controller 180 in the present embodiment), to complete The present invention.For example, in figure 3, the data request processing device 400 can be divided into sets up module 401, sending module 402nd, processing module 403.Module alleged by the present invention refers to that a kind of series of computation machine program that can complete specific function refers to Section is made, below the concrete function of just above-mentioned each functional module 401-403 is described in detail.
It is described to set up module 401, send event SSE passages for setting up server with server.
Specifically, the mobile terminal 1 00 can be communicated as client for server.Exemplary, pass through The APP that client is installed, such as browser, connection request, server are sent when webpage is opened by a certain order to server To receive after the request and set up server with the client to send event SSE (Server-Sent Events, abbreviation SSE) logical Road.Exemplary, an account can be logged on one or many station terminals, and the account logged on each station terminal can A SSE passage is set up as an independent client and server, the data that will be so sent on different terminals please Asking will obtain corresponding result.
You need to add is that, the client and server of the embodiment of the present invention refers to B/S mode (i.e. Browser- Server), C/S mode (Client-Server) needs to use the scheme that poll or queue are pushed to solve.
It will be appreciated by persons skilled in the art that SSE is pushed, i.e. Server-Send Event, client server is to clear Look at device propelling data.As long as browser sets up a SSE passage with server, the data for needing can just be passed through this by server Individual passage is pushed to browser, goes to obtain manually without browser.
The sending module 402, for sending request of data, and it is sending with the request of data to receive the server Corresponding distinguishing mark.
It is understood that by the way of asynchronous execution access interface, so-called asynchronous execution access module is:Client After end sends request, the confirmation of server can be immediately received, as shown in Figure 4.Specifically, the request that client sends can be with To set up the request of SSE passages, server feeds back to client confirmation after receiving is the confirmation for confirming to set up SSE passages Information.In addition, starting another thread for performing this task in server internal.So, client is connected without keeping, Wait tasks carrying to finish to disconnect again.Therefore, without keeping connecting the resource that can save server constantly, and can subtract Light server keeps the pressure of numerous connection numbers with client.
Exemplary, data base querying is performed, as a example by acquisition data base querying implementing result.First, client is being opened During the page, SSE passages are set up with server.This passage, the message for coming is pushed for the reception server.When channel abnormal is disconnected When opening, SSE can be reconnected in itself;Then query sentence of database is performed, is sent to server and asked, and obtain server and returned The distinguishing mark corresponding with the request of data for returning, the distinguishing mark is corresponding with request, and what Servers-all sent please with this Seeking relevant information will carry the distinguishing mark, and the result that the client needs of the transmission request are obtained is made so as to reach with clothes The information that business device sends is corresponded.
The processing module 403 being sent with the request of data for receiving the server by the SSE passages Corresponding treatment state, and according to the SSE passages and the distinguishing mark, the request of data is obtained from the server Alignment processing result.
In the embodiment of the present invention, server process request of data is that request of data configures corresponding response data, that is, process As a result.Specifically, the state of request of data can be sent to client by server by SSE passages.
Exemplary, the treatment state of request of data can be completed for data request processing, can be told by SSE passages Client data request has been completed, and client can go to obtain corresponding result;Or, the treatment state of request of data Can fail for data request processing, server can tell that client this time asks not obtaining result, in this way, client can Resend request of data and perform request of data again.
Specifically, the distinguishing mark is general unique identifier (Universally Unique Identifier, letter Claim:UUID), after request of data is finished, result can be obtained by this UUID.
Using the embodiment shown in Fig. 3 of the present invention, compared to prior art, thing is sent by setting up server with server Part SSE passages;Then request of data is sent, and receives the identification mark corresponding with the request of data that the server sends Will;The treatment state corresponding with the request of data that the server is sent by the SSE passages is received, and according to described SSE passages and the distinguishing mark, the alignment processing result of the request of data is obtained from the server.As long as so building SSE passages are found, client can obtain corresponding result by SSE passages after the completion of data request processing, And the connection for being always maintained at server without client, so as to save the resource of server.
Shown in Figure 5, when distinguishing mark is UUID, the processing module 403 can include:First receives submodule Block 501, sending submodule 502, acquisition submodule 503;Specifically,
First receiving submodule 501, for receiving the request of data that the server is sent by the SSE passages Corresponding treatment state;
Sending submodule 502, for when the treatment state for receiving is to complete, sending and obtaining asking for result Ask to the server;
Acquisition submodule 503, for according to the SSE passages and the distinguishing mark, institute being obtained from the server State the alignment processing result of request of data.
Exemplary, after the completion of data request processing, with UUID be sent to the information comprising " completion " in the lump by server Client, after client is received, judges whether the UUID is identical with distinguishing mark in sending module 402, if identical, It is judged as treatment state corresponding with the request of data that itself sends, and then user end to server sends corresponding result Request;Otherwise, it is that the state for once failing sends, client is disregarded.
When SSE passages are established between client and server, message just can be pushed to visitor by server by passage Family end.But, many when server disposition, for example, when being forwarded by proxy server nginx, it may appear that information drop-out Phenomenon.Reason is that client establishes SSE passages by nginx with a server therein.When nginx is execution task point When being dealt into another server, the state performed on this server will be pushed nowhere, because this server does not have and client SSE passages are set up at end.A kind of technique for solving these problems scheme is the embodiment of the invention provides, is below carried out specifically It is bright.
Specifically, described set up module 401, can be used for:The request transmission that server sends event SSE passages will be set up To proxy server, the server distributed with the proxy server sets up the server and sends event SSE passages.
It should be noted that when comprising proxy server, proxy server can be connected with multiple servers, agency's clothes Business device is used for receiving the request of client transmission, and the request of reception is sent at least one server.
The treatment processing module 403, can include:
Second receiving submodule being sent with the request of data for receiving the server by the SSE passages Corresponding treatment state, wherein, the server will treatment state corresponding with the request of data and result send to Message queue;
3rd receiving submodule, for according to the SSE passages and the distinguishing mark, receiving the server from institute The result for obtaining and sending in message queue is stated, wherein, the result is the alignment processing with the request of data.
Exemplary, as shown in fig. 6, Fig. 6 is the flow of data request processing device first embodiment of the present invention Schematic diagram, for server A, is set up after SSE passages, client in client by proxy server and server A The request of data of transmission can be sent to server by proxy server, specifically, can be server A, B, C.Can manage Solution, only server A establish SSE passages with client, if request of data is sent to server B or server C, So corresponding result cannot be fed back to by client by SSE passages.In the embodiment of the present invention, by setting a message team Row, the corresponding all results of request that a client is sent are sent to message queue, Ran Houjing by the server for performing The corresponding result of request of data in message queue is sent to client by SSE passages.
Specifically, the message queue is Mark reaction kafka queues.
Exemplary, the browser of client establishes SSE passages by proxy server and server A.Browser is sent out Act the request for performing.No matter this request is distributed to server A, server B or server C by nginx, all can be state plug To same kafka message queues the inside.With the server A that browser establishes SSE passages, carry out message push when, no It is to be obtained from local, but is obtained from public part kafka queues.So accomplish that the data produced on every server can be pushed Success.
Therefore, using the embodiment shown in Fig. 6 of the present invention, data sending request can be avoided from being carried out by proxy server The loss of data that a more than server carries out data processing and produces is assigned to when transmission, thereby it is ensured that number According to the security and integrality of request alignment processing result.
In addition, in order to ensure the message that user A is produced not to be pushed to the SSE passages of user B, it is possible to use a user The mode of one kafka queue solves problem above.The data that only storage active user produces i.e. in this queue.It is often same Individual user, the same time can log in multiple equipment.For the data for preventing from being produced in another equipment, can be pushed to current Equipment.Need to establish the link the once request of same user.In order to solve this problem, the naming method of queue makes into use Name in an account book+page unique mark.Each SSE is reconnected, and incoming page unique mark is the same, it is ensured that same page consumption is same One message queue.
Further, present invention also offers a kind of data request processing method, client is applied to, as shown in fig. 7, being Data request processing method flow schematic diagram of the present invention.In the present embodiment, the data request processing method can be with It is divided into following steps:
S701, sets up server and sends event SSE passages with server.
S702, sends request of data, and receive the distinguishing mark corresponding with the request of data that the server sends.
S703, receives the treatment state corresponding with the request of data that the server is sent by the SSE passages, And according to the SSE passages and the distinguishing mark, the alignment processing result of the request of data is obtained from the server.
Specifically, the distinguishing mark can be general unique identifier.
Specifically, as shown in figure 8, it is described receive that the server sends by the SSE passages asked with the data Corresponding treatment state is sought, and according to the SSE passages and the distinguishing mark, obtaining the data from the server please The alignment processing result asked, including:
S801, receives the server by the corresponding treatment state of the request of data that the SSE passages send;
S802, when the treatment state for receiving is to complete, sends the request for obtaining result to the service Device;
S803, according to the SSE passages and the distinguishing mark, the right of the request of data is obtained from the server Answer result.
Specifically, described set up server transmission event SSE passages with server, including:
The request that server transmission event SSE passages will be set up is sent to proxy server, with the proxy server point The server matched somebody with somebody sets up the server and sends event SSE passages;
It is described to receive the treatment state corresponding with the request of data that the server is sent by the SSE passages, And according to the SSE passages and the distinguishing mark, the alignment processing result of the request of data is obtained from the server, Including:
The treatment state corresponding with the request of data that the server is sent by the SSE passages is received, wherein, The server sends to message queue treatment state corresponding with the request of data and result;
According to the SSE passages and the distinguishing mark, receive the server and obtained simultaneously from the message queue The result of transmission, wherein, the result is the alignment processing with the request of data.
Specifically, the message queue is Mark reaction kafka queues.
Using the embodiment shown in Fig. 7 of the present invention, compared to prior art, data request processing dress proposed by the invention Put, event SSE passages are sent by setting up server with client;Then the request of data that the client sends is received, and Send distinguishing mark corresponding with request of data to client;Process the request of data, and by the treatment state of request of data Sent to the client by SSE passages, so that the client is according to the distinguishing mark is obtained by SSE passages The alignment processing result of request of data.As long as so establishing SSE passages, you can be at request of data by SSE passages Obtain corresponding result after the completion of reason, and the connection for being always maintained at server without client, save server Resource.
The embodiments of the present invention are for illustration only, and the quality of embodiment is not represented.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases The former is more preferably implementation method.Based on such understanding, technical scheme is substantially done to prior art in other words The part for going out contribution can be embodied in the form of software product, and the computer software product is stored in a storage medium In (such as ROM/RAM, magnetic disc, CD), including some instructions are used to so that a station terminal equipment (can be mobile phone, computer, clothes Business device, air-conditioner, or the network equipment, robot etc.) perform method described in each embodiment of the invention.
The preferred embodiments of the present invention are these are only, the scope of the claims of the invention is not thereby limited, it is every to utilize this hair Equivalent structure or equivalent flow conversion that bright specification and accompanying drawing content are made, or directly or indirectly it is used in other related skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of data request processing device, applications client, it is characterised in that described device includes:
Module is set up, event SSE passages are sent for setting up server with server;
Sending module, for sending request of data, and receives the identification corresponding with the request of data that the server sends Mark;
Processing module, for receiving the treatment corresponding with the request of data that the server is sent by the SSE passages State, and according to the SSE passages and the distinguishing mark, the alignment processing of the request of data is obtained from the server As a result.
2. data request processing device according to claim 1, it is characterised in that the distinguishing mark is general unique knowledge Other code.
3. data request processing device according to claim 1 and 2, it is characterised in that the processing module, including:
First receiving submodule, it is corresponding by the request of data that the SSE passages send for receiving the server Treatment state;
Sending submodule, for when the treatment state for receiving is to complete, sending the request for obtaining result to institute State server;
Acquisition submodule, for according to the SSE passages and the distinguishing mark, obtaining the data from the server please The alignment processing result asked.
4. data request processing device according to claim 2, it is characterised in that described to set up module, specifically for:
The request that server transmission event SSE passages will be set up is sent to proxy server, with proxy server distribution Server sets up the server and sends event SSE passages;
The treatment processing module, including:
Second receiving submodule, for receive the server by the SSE passages send it is corresponding with the request of data Treatment state, wherein, the server sends to message treatment state corresponding with the request of data and result Queue;
3rd receiving submodule, disappears for according to the SSE passages and the distinguishing mark, receiving the server from described The result for obtaining and sending in breath queue, wherein, the result is the alignment processing with the request of data.
5. data request processing device according to claim 4, it is characterised in that the message queue is Mark reaction Kafka queues.
6. a kind of data request processing method, is applied to client, it is characterised in that methods described includes:
Server is set up with server send event SSE passages;
Request of data is sent, and receives the distinguishing mark corresponding with the request of data that the server sends;
The treatment state corresponding with the request of data that the server is sent by the SSE passages is received, and according to institute SSE passages and the distinguishing mark are stated, the alignment processing result of the request of data is obtained from the server.
7. data request processing method according to claim 6, it is characterised in that the distinguishing mark is general unique knowledge Other code.
8. the data request processing method according to claim 6 or 7, it is characterised in that the reception server leads to The treatment state corresponding with the request of data that the SSE passages send is crossed, and according to the SSE passages and the identification Mark, the alignment processing result of the request of data is obtained from the server, including:
The server is received by the corresponding treatment state of the request of data that the SSE passages send;
When the treatment state for receiving is to complete, the request for obtaining result is sent to the server;
According to the SSE passages and the distinguishing mark, the alignment processing knot of the request of data is obtained from the server Really.
9. data request processing method according to claim 7, it is characterised in that described to set up server hair with server Event SSE passages are sent, including:
The request that server transmission event SSE passages will be set up is sent to proxy server, with proxy server distribution Server sets up the server and sends event SSE passages;
It is described to receive the treatment state corresponding with the request of data that the server is sent by the SSE passages, and root According to the SSE passages and the distinguishing mark, the alignment processing result of the request of data, bag are obtained from the server Include:
The treatment state corresponding with the request of data that the server is sent by the SSE passages is received, wherein, it is described Server sends to message queue treatment state corresponding with the request of data and result;
According to the SSE passages and the distinguishing mark, receive the server and obtain and send from the message queue Result, wherein, the result is the alignment processing with the request of data.
10. data request processing method according to claim 9, it is characterised in that the message queue is Mark reaction Kafka queues.
CN201710188974.0A 2017-03-27 2017-03-27 A kind of data request processing device and method Pending CN106911795A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710188974.0A CN106911795A (en) 2017-03-27 2017-03-27 A kind of data request processing device and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710188974.0A CN106911795A (en) 2017-03-27 2017-03-27 A kind of data request processing device and method

Publications (1)

Publication Number Publication Date
CN106911795A true CN106911795A (en) 2017-06-30

Family

ID=59195446

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710188974.0A Pending CN106911795A (en) 2017-03-27 2017-03-27 A kind of data request processing device and method

Country Status (1)

Country Link
CN (1) CN106911795A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107181821A (en) * 2017-07-05 2017-09-19 广州华多网络科技有限公司 A kind of information push method and device based on SSE specifications
CN110730373A (en) * 2019-12-18 2020-01-24 南京创维信息技术研究院有限公司 Method and system for pushing videos across screens among devices with screens

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101237335A (en) * 2007-02-02 2008-08-06 阿里巴巴公司 Method and system for real time notifying event status change
CN102209302A (en) * 2011-07-07 2011-10-05 深圳市金立通信设备有限公司 System and method for realizing information push of mobile terminal
US20120278473A1 (en) * 2011-04-27 2012-11-01 Rackspace Us, Inc. Event Queuing and Distribution System
CN104660708A (en) * 2015-03-13 2015-05-27 黄庆宇 HTTP (Hyper Text Transfer Protocol) based mobile application message forwarding method and system
CN105227398A (en) * 2015-09-08 2016-01-06 深圳创维-Rgb电子有限公司 Long method of attachment, system and its apparatus, terminal are shared in multi-service

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101237335A (en) * 2007-02-02 2008-08-06 阿里巴巴公司 Method and system for real time notifying event status change
US20120278473A1 (en) * 2011-04-27 2012-11-01 Rackspace Us, Inc. Event Queuing and Distribution System
CN102209302A (en) * 2011-07-07 2011-10-05 深圳市金立通信设备有限公司 System and method for realizing information push of mobile terminal
CN104660708A (en) * 2015-03-13 2015-05-27 黄庆宇 HTTP (Hyper Text Transfer Protocol) based mobile application message forwarding method and system
CN105227398A (en) * 2015-09-08 2016-01-06 深圳创维-Rgb电子有限公司 Long method of attachment, system and its apparatus, terminal are shared in multi-service

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107181821A (en) * 2017-07-05 2017-09-19 广州华多网络科技有限公司 A kind of information push method and device based on SSE specifications
CN110730373A (en) * 2019-12-18 2020-01-24 南京创维信息技术研究院有限公司 Method and system for pushing videos across screens among devices with screens

Similar Documents

Publication Publication Date Title
CN104731512B (en) The method, apparatus and terminal that picture is shared
CN104735255B (en) Multi-screen display method and system
CN105159533A (en) Mobile terminal and automatic verification code input method thereof
CN105098895B (en) The device and method of charge control
CN104809213B (en) Start the methods, devices and systems of application software client
CN106341817A (en) Access control system, access control method, mobile terminals and access server
CN107104970A (en) A kind of regular and synchronized processing method, system, rule server and gray scale server
CN106911850A (en) Mobile terminal and its screenshotss method
CN106407088A (en) Method and device for detecting multi-core CPU
CN106791141A (en) A kind of method of adjustment and mobile terminal of sound effect parameters of conversing
CN106803860A (en) The storage processing method and device of a kind of terminal applies
CN105764085A (en) Abnormal electricity consumption detection method and terminal
CN107133111A (en) A kind of message processing apparatus and method
CN105138255A (en) Terminal and image information acquisition method
CN107360214A (en) A kind of message push processing method, message sink processing method and processing device
CN106406733A (en) Anti-mistaken-touch terminal and method
CN105049612A (en) Method of realizing recording and device of realizing recording
CN107071161A (en) The aggregation display method and mobile terminal of icon in a kind of status bar
CN106911486A (en) A kind of message push processing method, apparatus and system
CN106550133A (en) Calling identification device and method
CN106850080A (en) The sending method and mobile terminal of a kind of associated person information
CN106657643A (en) Mobile terminal and communication session display method
CN105335055A (en) Self-response type realization method and system of menu as well as terminal equipment
CN105389007A (en) Application processing apparatus and method, and mobile terminal
CN106911795A (en) A kind of data request processing device and method

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20170630

RJ01 Rejection of invention patent application after publication