CN107959727A - The method and device communicated between webpage and client - Google Patents

The method and device communicated between webpage and client Download PDF

Info

Publication number
CN107959727A
CN107959727A CN201711340001.0A CN201711340001A CN107959727A CN 107959727 A CN107959727 A CN 107959727A CN 201711340001 A CN201711340001 A CN 201711340001A CN 107959727 A CN107959727 A CN 107959727A
Authority
CN
China
Prior art keywords
business processing
processing request
business
client
webpage
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
CN201711340001.0A
Other languages
Chinese (zh)
Other versions
CN107959727B (en
Inventor
童磊
胡训国
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201711340001.0A priority Critical patent/CN107959727B/en
Publication of CN107959727A publication Critical patent/CN107959727A/en
Application granted granted Critical
Publication of CN107959727B publication Critical patent/CN107959727B/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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • 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/51Discovery or management thereof, e.g. service location protocol [SLP] or web services

Abstract

The present invention provides the method and device communicated between a kind of webpage and client, it is related to network technique field.The present invention realizes a home server by given client end, in business procession, it can be interacted by webpage and home server, to realize service request and business procession, due to the controllability of home server, thereby it is ensured that between webpage and client intercommunication security, this method can be adapted for any browser client, and practicality is very strong.

Description

The method and device communicated between webpage and client
Technical field
The present invention relates to network technique field, the method and dress that are communicated between more particularly to a kind of webpage and client Put.
Background technology
For the relevant business of some webpages, it usually needs browser client is relied on to carry out, therefore, once it is clear Device client of looking at is closed, it is possible to which situations such as causing the interruption of business, seriously affects business processing process.Therefore, Ke Yitong Cross webpage and directly transmit order to client, allow the orders of some high authorities of client executing, and client can be execution As a result webpage is returned to.It is well known that the authority of Web (referring specifically to relevant scripts of Web etc. here) is in normal conditions It is to be subject to stringent control of authority, it is impossible to carry out local file read-write, process initiation etc. operation.However, with network skill The development of art, it is increasing to the demand of this business processing, therefore, how on the premise of security is ensured by webpage and Communication between client carries out business processing, is a technical problem of urgent need to resolve.
The content of the invention
An embodiment of the present invention provides the method and device communicated between a kind of webpage and client, is ensureing safety The communication between webpage and client can be realized while property, so as to carry out the processing of a variety of different business, is substantially increased Business processing efficiency.The technical solution is as follows:
On the one hand, there is provided a kind of method communicated between webpage and client, it is described applied to given client end Given client end is initialized to server, and is configured with target port and destination network addresses, the described method includes:
Browser client is received to ask by the business processing that the target port and the destination network addresses are sent, The business processing request is used to ask given client end to perform specifying on the webpage that the browser client is currently shown Business;
The source of business processing request is verified;
When passed the verification, business processing request is handled.
On the one hand, there is provided communication device is carried out between a kind of webpage and client, applied to given client end, the finger Determine client and be initialized to server, and be configured with target port and destination network addresses, described device includes:
Receiving module, is sent by the target port and the destination network addresses for receiving browser client Business processing is asked, and the business processing request is used to ask given client end to perform what the browser client was currently shown Specified services on webpage;
Correction verification module, the source for asking the business processing verify;
Processing module, for when passed the verification, handling business processing request.
On the one hand, there is provided a kind of terminal, the terminal include:Processor;For storing the executable instruction of processing Memory;Wherein, the processor is used to perform the computer program stored on memory, realizes the side described in either side Method step.
On the one hand, there is provided a kind of computer-readable recording medium, the computer-readable recording medium memory contain meter Calculation machine program, the computer program realize the method and step described in either side when being executed by processor.
The beneficial effect that technical solution provided in an embodiment of the present invention is brought is:A sheet is realized on given client end Ground server, in business procession, can be interacted by webpage and home server, with realize service request and Business procession, due to the controllability of home server, thereby it is ensured that between webpage and client intercommunication safety Property, this method can be adapted for any browser client, and practicality is very strong.
Brief description of the drawings
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for For those of ordinary skill in the art, without creative efforts, other can also be obtained according to these attached drawings Attached drawing.
Fig. 1 is a kind of schematic diagram of implementation environment provided in an embodiment of the present invention;
Fig. 2 is the method flow diagram communicated between a kind of webpage provided in an embodiment of the present invention and client;
Fig. 3 is that a kind of HTTPS request provided in an embodiment of the present invention sends and receives process schematic;
Fig. 4 is the structural representation of the device communicated between a kind of webpage provided in an embodiment of the present invention and client Figure;
Fig. 5 is a kind of structure diagram of terminal 500 provided in an embodiment of the present invention;
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention Formula is described in further detail.
Fig. 1 is a kind of schematic diagram of implementation environment provided in an embodiment of the present invention, as shown in Figure 1, the implementation environment includes Terminal, first server and second server, by network connection between the terminal and server, can carry out data interaction.
Wherein, at least one client can be installed in terminal, for example, browser client, application management client, Social networking application client etc., terminal can realize multiple network function by least one client, to meet user's Use demand.Browser client can be realized with referring to by taking web page access is realized by browser client as an example, in the terminal Determine the intercommunication between client, which can be built upon on the basis of HTTPS agreements, to ensure the security of interaction, keep away Exempt from other people to distort interaction data.
And given client end can provide service by first server and second server.
Wherein, first server is the background server at given client end, can be used for carrying out given client end initial Change configuration, for example, the first server can provide the initialization information of HTTPS for given client end, such as certificate, support Service numbers and command number etc., to carry out processing of taking precautions against natural calamities.In addition, the first server can also by service numbers and/ Or the startup and pause of command number, to control the behavior at given client end, if the abnormal state of some business, then can be by One server is by the remote pauses of service numbers and/or command number, to stop performing the business, so as to fulfill to client behavior Flexibility control.
Second server is service server, can be installation, the Service control that business plug-in unit is provided for given client end Deng service.User can want the business realized, so as to be obtained employment by given client end when using given client end with customized It is engaged in corresponding second server downloading service plug-in unit.For example, apply more new function when user wants to realize by given client end When, then the application more new business can be set on the given client end.Business plug-in unit when performing corresponding service, can by with The interaction of the corresponding second server of business plug-in unit is realized.Each business can have a corresponding second server, and Two servers can also carry out the business of itself switch control accordingly, such as suspend the processing of a certain business etc..
HTTPS Hyper text transfer security protocol (English:Hypertext Transfer Protocol Secure, abbreviation: HTTPS, is frequently referred to HTTP over TLS, HTTP over SSL or HTTP Secure) it is a kind of network security transmission agreement. On the computer network, HTTPS communicates via hypertext transfer protocol, but using SSL/TLS come encryption data bag. The main purpose of HTTPS exploitations, is to provide the authentication to the webserver, and protection exchanges the privacy and integrality of data.
JSONPJSONP (JSON with Padding) is one kind " use pattern " of JSON, and available for solving, mainstream is clear Look at device cross-domain data access the problem of.Due to origin policy, in general positioned at server1.example.com webpage without Method be not server1.example.com server communication, but HTML<script>Element is an exception.Utilize <script>This opening strategy of element, webpage can obtain the JSON information produced from other sources dynamic, this use Method is exactly so-called JSONP.It is not JSON information with the JSONP information obtained, but arbitrary JavaScript data, Directly performed with JavaScript resolvers rather than parsed with JSON resolvers.
Fig. 2 is the method flow diagram communicated between a kind of webpage provided in an embodiment of the present invention and client.Referring to Fig. 2, this method comprise the following steps:
201st, given client end is initialized as server, and destination network addresses and target is configured for the given client end Port.
Wherein, destination network addresses are the network address at the given client end, which is the clothes at given client end Business device port.Given client end can be configured as the HTTPS servers of a local by HTTPS agreements, be serviced in configuration During device, it can be that IP address, such as 127.0.0.1 are distributed in the given client end, can also be the given client end point With a port number, so that given client end can be accessed in its operational process by other clients.Need what is illustrated It is that the destination network addresses are the unified IP address configured on all given client ends, so that platform is in webpage system The destination network addresses can be write when making in webpage, trigger the business processing flow.
It should be noted that the given client end can be application management class client, this kind of client longtime running in In terminal, and starting up is could be provided as, therefore, other clients can be received under operation as the carrier of intercommunication The request sent is held, so as to handle request.
By taking HTTPS agreements as an example, in initialization procedure, the given client end and first server communicate, and obtain The initialization information of HTTPS, for example certificate, the service numbers of support, command number etc., then initialize HTTPS services, in terminal A dedicated local HTTPS server is established in side.Then, given client end also needs to load each business plug-in unit so that no The corresponding order of the service numbers can be performed by the correspondence business plug-in unit in given client end with business, finally realize its industry Business step.It is used as communication protocol using HTTPS, so mainly prevents midway from having agency to distort communication data, improves Security.
202nd, when the triggering command for getting the specified services on the webpage that browser client shows, generate at business Reason request, business processing request are used to ask given client end to perform the specified services.
The embodiment of the present invention is only illustrated exemplified by carrying out web displaying by browser client, in actual scene In, which can also be carried out by any browser plug-in, for example, by the browser plug-in in social networking application into OK, the trigger mechanism of specified services is had been provided in the source code of the webpage, can be with for example, the webpage is during display Detect that current browser client or social networking application client are legacy versions, then can be updated and carried based on new version Show, the option for updating prompting is shown on the designated position of webpage, after the triggering command to the option is got, determining should Specified services on webpage are triggered, based on the corresponding code segment generation business processing request of the option.
Further, when the specified services on webpage are triggered, pseudorandom cookie is generated, and by the pseudorandom Cookie write-in business processing requests.Pseudorandom cookie can be preconfigured in web page code or its generating algorithm To be pre-configured with web page code, in order to avoid illegal website etc. to the abuse of the function, it is necessary to match somebody with somebody in advance in web page code Pseudorandom cookie or generating algorithm are put, the verification asked for given client end the business processing.Referring to the life in Fig. 3 , can be by generating and writing pseudorandom cookie when generation obtains (get) request into process, regeneration get is asked, from And HTTPS request is initiated to given client end.
203rd, browser client sends business processing request to given client end.
Specifically, which asks to send to destination network addresses by target port by the business processing, Since target port and destination network addresses can be directed toward given client end, terminated by above-mentioned transmission process given client Receive business processing request.
204th, given client end is when receiving business processing request, to the domain name that business processing request carries into Row verification.
For business processing request, it can carry the domain name in business processing request source, and visitor is specified to tell Family end oneself comes from which web page interlinkage, and malicious attack and some other illegal feelings in order to avoid other website Shape, given client end can be only to allow the requests from some domain names.It is exemplified by domain name is default domain name by the first preset condition, Given client end can be stored with default domain name, when receiving business processing request, it can be determined that business processing request is taken When the domain name of band is not default domain name, if it is not, then verification failure, the business processing can be ignored or be refused in given client end Request.When it is default domain name that verification, which determines the domain name, then can continue further to verify business processing request.
The default domain name can be the domain name passed through through first server certification, can carry out client by first server Given client end is configured at during the initialization of end.
205th, when the domain name meets the first preset condition, which carries business processing request Cookie is verified.
As described in above-mentioned steps 202, business processing request can also carry cookie, therefore given client end can lead to The cookie or generating algorithm for being pre-configured in client are crossed, to verify the cookie.Using the second preset condition as cookie with Exemplified by default cookie is identical, what given client end can be entrained according to preconfigured cookie and business processing request Cookie is compared, and when comparing consistent, then upchecks, when comparing inconsistent, then verification failure;Alternatively, specify visitor Family end can generate cookie, according to the cookie of generation and the business processing according to preconfigured cookie generating algorithms The entrained cookie of request is compared, and when comparing consistent, then upchecks, when comparing inconsistent, then verification failure.
206th, when cookie meets the second preset condition, which asks in response to the business processing, root The service numbers carried according to business processing request, determine business plug-in unit corresponding with the service numbers in the given client end.
In order to realize specific business, service numbers are carried in above-mentioned business processing request, service numbers are used to indicate to specify visitor Which class business family end specifically performs, and for any service numbers, it is corresponding can be loaded with the service numbers at given client end Business plug-in unit, so that given client end can be handled when receiving and asking business processing by corresponding business plug-in unit.
Above-mentioned steps 204 to 206 are that business processing request is verified, to ensure the process of security, in above-mentioned mistake It is to be illustrated exemplified by having carried out domain name and cookie verifications in journey, such as the order shown in Fig. 3, and in actual scene, Only domain name or cookie can also be verified, to accelerate checking process, improve the efficiency of business processing, the embodiment of the present invention To being specifically not specifically limited using which kind of checking process.The above-mentioned verification to domain name and cookie can not also limit its verification Sequentially, that is to say, its checking procedure, which can be carried out at the same time, one in front and one in back to be carried out using any sequential, and the present invention is implemented Example does not limit this.
Involved in above-mentioned 204 to 206 to checking procedure be the process that is verified of source to business processing request, In actual scene, provider website or the partner site at given client end etc. can be normally only allowed to open the communication function, with Ensure the security of business processing.
207th, business processing request is issued to the business plug-in unit by given client end, and the business is used by the business plug-in unit Number corresponding order asks corresponding processing step to perform the business processing.
For service numbers, its corresponding command number can represent access rights of the business in terminal.Each industry Business number can correspond to multiple command numbers, and the command number corresponding to each service numbers can be different, so as to realize difference Business procession.Certainly, in order to realize flexible control, service numbers and command number can be started by remote control Or close, so as to limit the processing at given client end.Every industry is accessed by this expansible, maintainable plug-in part technology Business, can facilitate the access of business, its flexibility and controllability are very strong.
Further, can lead to for some business more demanding to security and privacy, the related data of the business Public private key encryption is crossed to protect, to prevent data to be tampered, for example, channel number of some business etc..Therefore, each business plug-in unit It can correspond to and be stored with public key, so as to which data are decrypted.Correspondingly, business plug-in unit uses public affairs corresponding with service numbers Data during key asks the business processing are decrypted, and obtain pending data;The processing module uses the business Number corresponding order, alignment processing is carried out to the pending data.
208th, when needing to webpage return data, given client end is by data back to webpage.
When there is any type of data to need to be returned, given client end can return JavaScript numbers by JSONP According to so that browser client can be parsed based on JavaScript resolvers and be performed and carry out corresponding product table It is existing.
Method provided in an embodiment of the present invention, realizes a home server, in business processing by given client end During, it can be interacted by webpage and home server, to realize service request and business procession, due to this The controllability of ground server, thereby it is ensured that between webpage and client intercommunication security, this method can be adapted for appoint A kind of browser client, practicality are very strong.Further, this method substantially increases industry without establishing long connection with backstage The timeliness of business processing.Simultaneously as make use of JSONP methods to carry out the passback of data, the steady of business realizing is not only increased It is qualitative, also solve the problems, such as that return data is difficult in other Interworking Schemes.
Illustrate the implementation of above-mentioned method for processing business by taking scene in actual use as an example below, for example, browser For client when showing webpage, user can be by download of the web page trigger to any resource, so as to be given birth to by browser client Into download request, under browser client can for example be sent by HTTPS agreements to given client end using house keeper's client Carry request, when given client termination receive download request when, can based on the web page interlinkage carried in download request to resource into Row is downloaded.Certainly, when receiving download request, given client end can verify its domain name and cookie, and Verification by when just execution resource downloading, and when performing resource downloading process, which can also be distributed to Resource downloading plug-in unit performs, and completes entirely to download based on the corresponding order of the resource downloading task by resource downloading plug-in unit Journey.
For example, browser client is when showing webpage, user can by installation of the web page trigger to any resource, from And mount request is generated by browser client, browser client can for example should by HTTPS agreements to given client end Mount request is sent with house keeper's client, when given client termination receives mount request, can be based on carrying in mount request Web page interlinkage resource is downloaded, after the download is complete, the automatic installation for carrying out resource.Certainly, receive installation please When asking, given client end can verify its domain name and cookie, and verification by when just perform resource downloading, and When performing resource downloading process, the resource downloading and installation task can also be distributed to resource installation plug-in unit and performed, by providing Plug-in unit is installed based on the corresponding order of the resource downloading and installation task to complete the process entirely downloaded and installed in source.
Fig. 4 is the structural representation of the device communicated between a kind of webpage provided in an embodiment of the present invention and client Figure.The device includes:
Receiving module 401, is sent out for receiving browser client by the target port and the destination network addresses The business processing request sent, the business processing request are used to ask the given client end execution browser client currently to show The specified services on webpage shown;
Correction verification module 402, the source for asking the business processing verify;
Processing module 403, for when passed the verification, handling business processing request.
In one implementation, the correction verification module 402 is used to carry out the domain name that business processing request carries Verification, when domain name meets the first preset condition, determines that the business processing request verification passes through.
In one implementation, the correction verification module 402 is used for the cache information carried to business processing request Cookie is verified, when domain name meets first preset condition, and the cookie meets the second preset condition, Determine that the business processing request verification passes through.
In one implementation, the correction verification module 402 be used for the business processing request carry cookie into Row verification, when the cookie meets the second preset condition, determines that the business processing request verification passes through.
In one implementation, described device further includes passback module, is needed for working as to the webpage return data When, data back is carried out using the JSONP methods.
In one implementation, which is used for:
The service numbers carried according to business processing request, determine business plug-in unit corresponding with the service numbers;
Business processing request is issued to the business plug-in unit, is corresponded to by the business plug-in unit using the service numbers Order come to the business processing request handle.
In one implementation, which is used for:
Data during the business plug-in unit asks the business processing using public key corresponding with the service numbers carry out Decryption, obtains pending data;
The processing module uses the corresponding order of the service numbers, and alignment processing is carried out to the pending data.
In one implementation, the business processing request is HTTPS forms.
In one implementation, the given client end is application management class client.
In one implementation, the business processing request is resource download request or resource mount request.
It should be noted that:The device communicated between webpage and client that above-described embodiment provides is realizing webpage When being communicated between client, only with the division progress of above-mentioned each function module for example, in practical application, Ke Yigen Above-mentioned function distribution is completed by different function modules according to needs, i.e., the internal structure of device is divided into different functions Module, to complete all or part of function described above.In addition, above-described embodiment provide webpage and client between into The embodiment of the method communicated between the device and webpage and client of row communication belongs to same design, it implements process Embodiment of the method is referred to, which is not described herein again.
Fig. 5 is a kind of structure diagram of terminal 500 provided in an embodiment of the present invention.The terminal 500 can be:Intelligent hand (Moving Picture Experts Group Audio Layer III, dynamic image are special for machine, tablet computer, MP3 player Family's compression standard audio aspect 3), MP4 (Moving Picture Experts Group Audio Layer IV, dynamic image Expert's compression standard audio aspect 4) player, laptop or desktop computer.Terminal 500 is also possible to be referred to as user to set Other titles such as standby, portable terminal, laptop terminal, terminal console.
In general, terminal 500 includes:Processor 501 and memory 502.
Processor 501 can include one or more processing cores, such as 4 core processors, 8 core processors etc..Place Reason device 501 can use DSP (Digital Signal Processing, Digital Signal Processing), FPGA (Field- Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array, may be programmed Logic array) at least one of example, in hardware realize.Processor 501 can also include primary processor and coprocessor, main Processor is the processor for being handled data in the awake state, also referred to as CPU (Central Processing Unit, central processing unit);Coprocessor is the low power processor for being handled data in the standby state. In some embodiments, processor 501 can be integrated with GPU (Graphics Processing Unit, image processor), GPU is used to be responsible for rendering and drawing for content to be shown needed for display screen.In some embodiments, processor 501 can also wrap AI (Artificial Intelligence, artificial intelligence) processor is included, which is used to handle related machine learning Calculate operation.
Memory 502 can include one or more computer-readable recording mediums, which can To be non-transient.Memory 502 may also include high-speed random access memory, and nonvolatile memory, such as one Or multiple disk storage equipments, flash memory device.In certain embodiments, the non-transient computer in memory 502 can Read storage medium to be used to store at least one instruction, which is used for performed by processor 501 to realize this hair What bright middle embodiment of the method provided chooses content display method.
In certain embodiments, terminal 500 is also optional includes:Peripheral interface 503 and at least one ancillary equipment. It can be connected between processor 501, memory 502 and peripheral interface 503 by bus or signal wire.Each ancillary equipment It can be connected by bus, signal wire or circuit board with peripheral interface 503.Specifically, ancillary equipment includes:Radio circuit 504th, at least one of touch display screen 505, camera 506, voicefrequency circuit 507, positioning component 508 and power supply 509.
Peripheral interface 503 can be used for I/O (Input/Output, input/output) is relevant at least one outer Peripheral equipment is connected to processor 501 and memory 502.In certain embodiments, processor 501, memory 502 and ancillary equipment Interface 503 is integrated on same chip or circuit board;In some other embodiments, processor 501, memory 502 and outer Any one or two in peripheral equipment interface 503 can realize on single chip or circuit board, the embodiment of the present invention pair This is not limited.
Radio circuit 504 is used to receive and launch RF (Radio Frequency, radio frequency) signal, also referred to as electromagnetic signal.Penetrate Frequency circuit 504 is communicated by electromagnetic signal with communication network and other communication equipments.Radio circuit 504 turns electric signal It is changed to electromagnetic signal to be transmitted, alternatively, the electromagnetic signal received is converted to electric signal.Alternatively, radio circuit 504 wraps Include:Antenna system, RF transceivers, one or more amplifiers, tuner, oscillator, digital signal processor, codec chip Group, user identity module card etc..Radio circuit 504 can be carried out by least one wireless communication protocol with other terminals Communication.The wireless communication protocol includes but not limited to:WWW, Metropolitan Area Network (MAN), Intranet, each third generation mobile communication network (2G, 3G, 4G and 5G), WLAN and/or WiFi (Wireless Fidelity, Wireless Fidelity) network.In certain embodiments, penetrate Frequency circuit 504 can also include the related circuits of NFC (Near Field Communication, wireless near field communication), this Invention is not limited this.
Display screen 505 is used to show UI (User Interface, user interface).The UI can include figure, text, figure Mark, video and its their any combination.When display screen 505 is touch display screen, display screen 505 also there is collection to show The surface of screen 505 or the ability of the touch signal of surface.The touch signal can be inputted to processor as control signal 501 are handled.At this time, display screen 505 can be also used for providing virtual push button and/or dummy keyboard, also referred to as soft key and/or Soft keyboard.In certain embodiments, display screen 505 can be one, set the front panel of terminal 500;In other embodiments In, display screen 505 can be at least two, be separately positioned on the different surfaces of terminal 500 or in foldover design;In still other reality Apply in example, display screen 505 can be flexible display screen, be arranged on the curved surface of terminal 500 or on fold plane.Even, show Display screen 505 can also be arranged to non-rectangle irregular figure, namely abnormity screen.Display screen 505 can use LCD (Liquid Crystal Display, liquid crystal display), OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) Prepared etc. material.
CCD camera assembly 506 is used to gather image or video.Alternatively, CCD camera assembly 506 include front camera and Rear camera.In general, front camera is arranged on the front panel of terminal, rear camera is arranged on the back side of terminal.One In a little embodiments, rear camera at least two, is main camera, depth of field camera, wide-angle camera, focal length shooting respectively Head in any one, with realize main camera and the depth of field camera fusion realize background blurring function, main camera and wide-angle Camera fusion realizes that pan-shot and VR (Virtual Reality, virtual reality) shooting functions or other fusions are clapped Camera shooting function.In certain embodiments, CCD camera assembly 506 can also include flash lamp.Flash lamp can be monochromatic warm flash lamp, It can also be double-colored temperature flash lamp.Double-colored temperature flash lamp refers to the combination of warm light flash lamp and cold light flash lamp, can be used for not With the light compensation under colour temperature.
Voicefrequency circuit 507 can include microphone and loudspeaker.Microphone is used for the sound wave for gathering user and environment, and will Sound wave, which is converted to electric signal and inputs to processor 501, to be handled, or input to radio circuit 504 to realize voice communication. For stereo collection or the purpose of noise reduction, microphone can be multiple, be separately positioned on the different parts of terminal 500.Mike Wind can also be array microphone or omnidirectional's collection type microphone.Loudspeaker is then used to that processor 501 or radio circuit will to be come from 504 electric signal is converted to sound wave.Loudspeaker can be traditional wafer speaker or piezoelectric ceramic loudspeaker.When When loudspeaker is piezoelectric ceramic loudspeaker, the audible sound wave of the mankind can be not only converted electrical signals to, can also be by telecommunications Sound wave that the mankind do not hear number is converted to carry out the purposes such as ranging.In certain embodiments, voicefrequency circuit 507 can also include Earphone jack.
Positioning component 508 is used for the current geographic position of positioning terminal 500, to realize navigation or LBS (Location Based Service, location Based service).Positioning component 508 can be the GPS (Global based on the U.S. Positioning System, global positioning system), China dipper system or Russia Galileo system positioning group Part.
Power supply 509 is used to be powered for the various components in terminal 500.Power supply 509 can be alternating current, direct current, Disposable battery or rechargeable battery.When power supply 509 includes rechargeable battery, which can be wired charging electricity Pond or wireless charging battery.Wired charging battery is the battery to be charged by Wireline, and wireless charging battery is by wireless The battery of coil charges.The rechargeable battery can be also used for supporting fast charge technology.
In certain embodiments, terminal 500 has further included one or more sensors 510.The one or more sensors 510 include but not limited to:Acceleration transducer 511, gyro sensor 512, pressure sensor 513, fingerprint sensor 514, Optical sensor 515 and proximity sensor 516.
The acceleration that acceleration transducer 511 can be detected in three reference axis of the coordinate system established with terminal 500 is big It is small.For example acceleration transducer 511 can be used for detecting component of the acceleration of gravity in three reference axis.Processor 501 can With the acceleration of gravity signal gathered according to acceleration transducer 511, control touch display screen 505 is regarded with transverse views or longitudinal direction Figure carries out the display of user interface.Acceleration transducer 511 can be also used for game or the collection of the exercise data of user.
Gyro sensor 512 can be with the body direction of detection terminal 500 and rotational angle, and gyro sensor 512 can To cooperate with collection user to act the 3D of terminal 500 with acceleration transducer 511.Processor 501 is according to gyro sensor 512 The data of collection, it is possible to achieve following function:When action induction (for example changing UI according to the tilt operation of user), shooting Image stabilization, game control and inertial navigation.
Pressure sensor 513 can be arranged on the side frame of terminal 500 and/or the lower floor of touch display screen 505.Work as pressure When sensor 513 is arranged on the side frame of terminal 500, gripping signal of the user to terminal 500 can be detected, by processor 501 The gripping signal gathered according to pressure sensor 513 carries out right-hand man's identification or prompt operation.When pressure sensor 513 is arranged on During the lower floor of touch display screen 505, the pressure operation by processor 501 according to user to touch display screen 505, is realized to UI circle Operability control on face is controlled.Operability control includes button control, scroll bar control, icon control, menu At least one of control.
Fingerprint sensor 514 is used for the fingerprint for gathering user, is collected by processor 501 according to fingerprint sensor 514 The identity of fingerprint recognition user, alternatively, by fingerprint sensor 514 according to the identity of the fingerprint recognition user collected.Identifying When the identity for going out user is trusted identity, the user is authorized to perform relevant sensitive operation, the sensitive operation bag by processor 501 Solution lock screen is included, encryption information is checked, downloads software, payment and change setting etc..Terminal can be set in fingerprint sensor 514 500 front, the back side or side.When being provided with physical button or manufacturer Logo in terminal 500, fingerprint sensor 514 can be with Integrated with physical button or manufacturer Logo.
Optical sensor 515 is used to gather ambient light intensity.In one embodiment, processor 501 can be according to optics The ambient light intensity that sensor 515 gathers, controls the display brightness of touch display screen 505.Specifically, when ambient light intensity is higher When, heighten the display brightness of touch display screen 505;When ambient light intensity is relatively low, the display for turning down touch display screen 505 is bright Degree.In another embodiment, the ambient light intensity that processor 501 can also be gathered according to optical sensor 515, dynamic adjust The acquisition parameters of CCD camera assembly 506.
Proximity sensor 516, also referred to as range sensor, are generally arranged at the front panel of terminal 500.Proximity sensor 516 The distance between front for gathering user and terminal 500.In one embodiment, when proximity sensor 516 detects use When the distance between family and the front of terminal 500 taper into, touch display screen 505 is controlled from bright screen state by processor 501 It is switched to breath screen state;When proximity sensor 516 detects that the distance between front of user and terminal 500 becomes larger, Touch display screen 505 is controlled to be switched to bright screen state from breath screen state by processor 501.
It will be understood by those skilled in the art that the restriction of the structure shown in Fig. 5 not structure paired terminal 500, can wrap Include than illustrating more or fewer components, either combine some components or arranged using different components.
In the exemplary embodiment, a kind of computer-readable recording medium for being stored with computer program, example are additionally provided The memory of computer program is such as stored with, above computer program is processed when performing and realizes shown in above-described embodiment Fig. 2 Method.For example, above computer readable storage medium storing program for executing can be read-only memory (Read-Only Memory, ROM), deposit at random Access to memory (Random Access Memory, RAM), read-only optical disc (Compact Disc Read-Only Memory, CD- ROM), tape, floppy disk and optical data storage devices etc..
One of ordinary skill in the art will appreciate that hardware can be passed through by realizing all or part of step of above-described embodiment To complete, relevant hardware can also be instructed to complete by program, which can be stored in a kind of computer-readable storage In medium, storage medium mentioned above can be read-only storage, disk or CD etc..
Presently preferred embodiments of the present invention is above are only, is not intended to limit the invention, it is all in the spirit and principles in the present invention Within, any modification, equivalent replacement, improvement and so on, should all be included in the protection scope of the present invention.

Claims (15)

1. a kind of method communicated between webpage and client, it is characterised in that described to specify applied to given client end Client is initialized to server, and is configured with target port and destination network addresses, the described method includes:
Browser client is received to ask by the business processing that the target port and the destination network addresses are sent, it is described Business processing request is used to ask given client end to perform the specified services on the webpage that the browser client is currently shown;
The source of business processing request is verified;
When passed the verification, business processing request is handled.
2. according to the method described in claim 1, it is characterized in that, the source to business processing request verifies Including:
The domain name carried to business processing request verifies, and when domain name meets the first preset condition, determines institute Business processing request verification is stated to pass through.
3. according to the method described in claim 2, it is characterized in that, the method further includes:
The cache information cookie carried to business processing request is verified, and is preset when domain name meets described first Condition, and when the cookie meets the second preset condition, determine that the business processing request verification passes through.
4. according to the method described in claim 1, it is characterized in that, the method further includes:
The cookie carried to business processing request is verified, when the cookie meets the second preset condition, really The fixed business processing request verification passes through.
5. according to the method described in claim 1, it is characterized in that, it is described to the business processing request handle after, The method further includes:
When needing to the webpage return data, data back is carried out using the JSONP methods.
6. according to the method described in claim 1, it is characterized in that, described carry out processing and include to business processing request:
The service numbers carried according to business processing request, determine business plug-in unit corresponding with the service numbers;
Business processing request is issued to the business plug-in unit, the corresponding life of the service numbers is used by the business plug-in unit Make to handle business processing request.
7. according to the method described in claim 6, it is characterized in that, described corresponded to by the business plug-in unit using the service numbers Order business processing request carried out by processing includes:
Data during the business plug-in unit asks the business processing using public key corresponding with the service numbers are decrypted, Obtain pending data;
The processing module uses the corresponding order of the service numbers, and alignment processing is carried out to the pending data.
8. according to claim 1-7 any one of them methods, it is characterised in that the business processing request is HTTPS forms.
9. according to claim 1-7 any one of them methods, it is characterised in that the given client end is application management class visitor Family end.
10. according to claim 1-7 any one of them methods, it is characterised in that the business processing request is resource downloading Request or resource mount request.
A kind of 11. device communicated between webpage and client, it is characterised in that applied to given client end, the finger Determine client and be initialized to server, and be configured with target port and destination network addresses, described device includes:
Receiving module, the business sent for receiving browser client by the target port and the destination network addresses Processing request, the business processing request are used to ask given client end to perform the webpage that the browser client is currently shown On specified services;
Correction verification module, the source for asking the business processing verify;
Processing module, for when passed the verification, handling business processing request.
12. according to the devices described in claim 11, it is characterised in that the correction verification module is used to ask the business processing The domain name of carrying is verified, and when domain name meets the first preset condition, determines that the business processing request verification passes through.
13. device according to claim 12, it is characterised in that the correction verification module is used to ask the business processing The cache information cookie of carrying is verified, and when domain name meets first preset condition, and the cookie meets During the second preset condition, determine that the business processing request verification passes through.
A kind of 14. terminal, it is characterised in that including:
Processor;
For storing the memory of computer program;
Wherein, the processor is used to perform the computer program stored on memory, realizes any one of claim 1-10 The method and step.
15. a kind of computer-readable recording medium, it is characterised in that the computer-readable recording medium memory contains computer Program, the computer program realize claim 1-10 any one of them method and steps when being executed by processor.
CN201711340001.0A 2017-12-14 2017-12-14 Method and device for communication between webpage and client Active CN107959727B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711340001.0A CN107959727B (en) 2017-12-14 2017-12-14 Method and device for communication between webpage and client

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711340001.0A CN107959727B (en) 2017-12-14 2017-12-14 Method and device for communication between webpage and client

Publications (2)

Publication Number Publication Date
CN107959727A true CN107959727A (en) 2018-04-24
CN107959727B CN107959727B (en) 2021-10-29

Family

ID=61958943

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711340001.0A Active CN107959727B (en) 2017-12-14 2017-12-14 Method and device for communication between webpage and client

Country Status (1)

Country Link
CN (1) CN107959727B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109617979A (en) * 2018-12-24 2019-04-12 珠海豹趣科技有限公司 A kind of data access method and relevant device
CN109800031A (en) * 2019-01-18 2019-05-24 广州虎牙信息科技有限公司 Service control method, server, terminal and device based on mobile office system
CN111314396A (en) * 2018-12-11 2020-06-19 杭州海康威视数字技术股份有限公司 Data processing method and device
CN112214333A (en) * 2020-09-23 2021-01-12 安徽深迪科技有限公司 Webpage and local application communication protocol based on HTTP (hyper text transport protocol) and application
CN112506685A (en) * 2019-09-16 2021-03-16 浙江宇视科技有限公司 Log storage method and device
US11157588B2 (en) 2019-08-29 2021-10-26 Shenzhen New Trend International Logis-Tech Co. Ltd Interface self-service method, and a device, a computer system and a storage medium for implementing the same

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030187995A1 (en) * 2002-03-27 2003-10-02 International Business Machines Corporation Efficient server handling of multiple requests from a web browser
CN101986652A (en) * 2010-09-27 2011-03-16 北京泰豪智能工程有限公司 Data sharing method and system based on embedded servers as well as client
CN102917074A (en) * 2012-11-09 2013-02-06 北京奇虎科技有限公司 Server-side browser realization method and server
CN104462478A (en) * 2014-12-18 2015-03-25 北京奇虎科技有限公司 Mobile browser client and webpage interacting method, device and client
CN104601433A (en) * 2013-10-30 2015-05-06 腾讯科技(深圳)有限公司 Method, client, server and system for displaying application information window
CN104854843A (en) * 2012-12-13 2015-08-19 高通股份有限公司 Loading a re-directed web page on a web browser of a client device in a communications system
CN105357183A (en) * 2015-09-30 2016-02-24 广州酷狗计算机科技有限公司 Communication method and device between client and local webpage
US20160164993A1 (en) * 2014-12-08 2016-06-09 International Business Machines Corporation Processing hybrid data using a single web client
CN105718517A (en) * 2016-01-14 2016-06-29 浪潮通用软件有限公司 Webpage display control method and system, and application server
CN105812345A (en) * 2014-12-31 2016-07-27 广州市动景计算机科技有限公司 Method and device for realizing communication between webpage and client end
CN106899455A (en) * 2017-03-07 2017-06-27 广州优视网络科技有限公司 The method and apparatus that a kind of client is interacted with webpage
CN106953740A (en) * 2017-01-24 2017-07-14 阿里巴巴集团控股有限公司 The processing method of page access data, client, server and system in
CN107038042A (en) * 2017-02-07 2017-08-11 阿里巴巴集团控股有限公司 The method and device that a kind of business is performed

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030187995A1 (en) * 2002-03-27 2003-10-02 International Business Machines Corporation Efficient server handling of multiple requests from a web browser
CN101986652A (en) * 2010-09-27 2011-03-16 北京泰豪智能工程有限公司 Data sharing method and system based on embedded servers as well as client
CN102917074A (en) * 2012-11-09 2013-02-06 北京奇虎科技有限公司 Server-side browser realization method and server
CN104854843A (en) * 2012-12-13 2015-08-19 高通股份有限公司 Loading a re-directed web page on a web browser of a client device in a communications system
CN104601433A (en) * 2013-10-30 2015-05-06 腾讯科技(深圳)有限公司 Method, client, server and system for displaying application information window
US20160164993A1 (en) * 2014-12-08 2016-06-09 International Business Machines Corporation Processing hybrid data using a single web client
CN104462478A (en) * 2014-12-18 2015-03-25 北京奇虎科技有限公司 Mobile browser client and webpage interacting method, device and client
CN105812345A (en) * 2014-12-31 2016-07-27 广州市动景计算机科技有限公司 Method and device for realizing communication between webpage and client end
CN105357183A (en) * 2015-09-30 2016-02-24 广州酷狗计算机科技有限公司 Communication method and device between client and local webpage
CN105718517A (en) * 2016-01-14 2016-06-29 浪潮通用软件有限公司 Webpage display control method and system, and application server
CN106953740A (en) * 2017-01-24 2017-07-14 阿里巴巴集团控股有限公司 The processing method of page access data, client, server and system in
CN107038042A (en) * 2017-02-07 2017-08-11 阿里巴巴集团控股有限公司 The method and device that a kind of business is performed
CN106899455A (en) * 2017-03-07 2017-06-27 广州优视网络科技有限公司 The method and apparatus that a kind of client is interacted with webpage

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111314396A (en) * 2018-12-11 2020-06-19 杭州海康威视数字技术股份有限公司 Data processing method and device
US11553031B2 (en) 2018-12-11 2023-01-10 Hangzhou Hikvision Digital Technology Co., Ltd. Method and apparatus for processing data
CN109617979A (en) * 2018-12-24 2019-04-12 珠海豹趣科技有限公司 A kind of data access method and relevant device
CN109800031A (en) * 2019-01-18 2019-05-24 广州虎牙信息科技有限公司 Service control method, server, terminal and device based on mobile office system
US11157588B2 (en) 2019-08-29 2021-10-26 Shenzhen New Trend International Logis-Tech Co. Ltd Interface self-service method, and a device, a computer system and a storage medium for implementing the same
CN112506685A (en) * 2019-09-16 2021-03-16 浙江宇视科技有限公司 Log storage method and device
CN112214333A (en) * 2020-09-23 2021-01-12 安徽深迪科技有限公司 Webpage and local application communication protocol based on HTTP (hyper text transport protocol) and application
CN112214333B (en) * 2020-09-23 2023-08-22 安徽深迪科技有限公司 Method for applying HTTP protocol-based webpage and local application communication protocol

Also Published As

Publication number Publication date
CN107959727B (en) 2021-10-29

Similar Documents

Publication Publication Date Title
CN111064795B (en) Web page access acceleration method, system, computer equipment, server and medium
CN107959727A (en) The method and device communicated between webpage and client
JP7338044B2 (en) Face image transmission method, value transfer method, device and electronic device
CN109600223B (en) Verification method, activation method, device, equipment and storage medium
CN108614878B (en) Protocol data management method, device, storage medium and system
CN108769992B (en) User authentication method, device, terminal and storage medium
CN111466099A (en) Login method, token sending method and device
CN109547495B (en) Sensitive operation processing method, device, server, terminal and storage medium
CN113542290B (en) Data access request processing method, device, equipment and readable storage medium
CN111506884A (en) User invitation method, device, computer equipment and computer readable storage medium
CN112417425A (en) Equipment authentication method, device, system, terminal equipment and storage medium
CN112003879B (en) Data transmission method for virtual scene, computer device and storage medium
CN108810019A (en) Refusal service attack defending method, apparatus, equipment and storage medium
CN110795737A (en) Method and terminal equipment for upgrading service application range of electronic identity card
CN110826103A (en) Block chain-based document authority processing method, device, equipment and storage medium
CN107968783A (en) Flow managing method, device, terminal and computer-readable recording medium
CN111404991A (en) Method, device, electronic equipment and medium for acquiring cloud service
CN111193724B (en) Authentication method, device, server and storage medium
CN111212074B (en) Blockchain-based qualification identification method, device, equipment and storage medium
CN108616835A (en) Internet resources acquisition methods, device, system and storage medium based on browser
CN110263525B (en) Equipment configuration method and device
CN108038232A (en) Page authoring method, device and system, storage medium
CN111970298A (en) Application access method and device, storage medium and computer equipment
CN109547444B (en) Virtual object acquisition method and device and electronic equipment
CN108737341B (en) Service processing method, terminal and server

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