CN109871498A - Back end interface response method, device, electronic equipment and storage medium - Google Patents
Back end interface response method, device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN109871498A CN109871498A CN201811537748.XA CN201811537748A CN109871498A CN 109871498 A CN109871498 A CN 109871498A CN 201811537748 A CN201811537748 A CN 201811537748A CN 109871498 A CN109871498 A CN 109871498A
- Authority
- CN
- China
- Prior art keywords
- server
- client
- interface
- data
- access request
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 42
- 230000004044 response Effects 0.000 title claims abstract description 40
- 230000005540 biological transmission Effects 0.000 claims abstract description 11
- 238000004590 computer program Methods 0.000 claims description 21
- 230000008859 change Effects 0.000 claims description 11
- 230000007257 malfunction Effects 0.000 claims description 4
- 230000006870 function Effects 0.000 description 14
- 238000012163 sequencing technique Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 5
- 238000012544 monitoring process Methods 0.000 description 5
- 235000014510 cooky Nutrition 0.000 description 4
- 241000238366 Cephalopoda Species 0.000 description 2
- 230000008901 benefit Effects 0.000 description 2
- 230000008676 import Effects 0.000 description 2
- 230000008447 perception Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 238000012508 change request Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
Abstract
The present invention relates to back end interface response method, device, electronic equipment and storage mediums.The described method includes: user end to server sends an access request to obtain load data, wherein the access request includes the interface IP address parameter of forwarding;The server receives the access request that the client is sent, and determines a matched interface according to the interface IP address parameter in the access request;The server passes through the interface determined and searches the data to match with the interface from the database of the server;And the server gives the load data transmission found out from the database to the client so that the client loads the load data.The present invention can reduce the pressure of the back end interface of server and improve the non-speed for loading required front end resource for the first time of client.
Description
Technical field
The present invention relates to field of computer technology, and in particular to a kind of back end interface response method, device, electronic equipment and
Storage medium.
Background technique
Current some APP are because the data volume of rear end request is excessive, so that the pressure of the back end interface of server, causes to take
Business device be easy to appear interruptions, without response, response timeout, too long response time the problems such as, cause client for a long time acquisition less than
Data.
Summary of the invention
In view of the foregoing, it is necessary to propose that a kind of back end interface response method, device, computer installation and computer can
Storage medium is read, to reduce the pressure of the back end interface of server and accelerate the non-speed for loading required front end resource for the first time in front end
Degree.
The first aspect of the application provides a kind of back end interface response method, applies in client and leads to the client
In the server for believing connection, which comprises
The client sends an access request to obtain load data, wherein the access request packet to the server
Include the interface IP address parameter of forwarding;
The server receives the access request that the client is sent, and according to the interface IP address in the access request
Parameter determines a matched interface;
The server passes through the interface determined and searches from the database of the server and the interface phase
Matched data;And
The server is by the load data transmission found out from the database to the client so that the visitor
Family end loads the load data.
Preferably, the client sends an access request to the server to obtain load data and include:
The client by the description information of the front end data of the client, judge the client it is local whether
It is stored with front end data;
When the client is when being locally stored front end data, the client reads institute from the local of the client
Front end data is stated as load data;And
When the local of the client does not store front end data, the client sends the visit to the server
Ask request to obtain load data.
Preferably, the client sends an access request to the server to obtain load data and include:
If front end data is the data that initialization data or web document state change, the client is to the service
Device sends the access request with the data for obtaining the initialization data or web document state changes;And
If front end data is the non-initialization data loaded for the first time or the data that web document state does not change, the visitor
Family end reads the non-initialization data loaded for the first time from the local of the client or web document state does not become
The data of change.
Preferably, the server receives the access request that the client is sent, and is determined according to the access request
One matched interface includes:
The access when the server determines a matched interface according to the interface IP address parameter in the access request
The interface;And
When the server is not determined and the interface IP address according to the interface IP address parameter in the access request
One prompt information of the client is returned to when the interface that parameter matches to remind access to malfunction.
Preferably, the access request of the server reception client transmission includes:
The server receives the access request that the client is sent by http proxy server, wherein the http
Proxy server determines that the front end for issuing the server of access request identifies according to the access request, acts on behalf of and takes in the http
Inquiry identifies the path of corresponding server with the front end in preset routing table in business device, and will be described according to the path
Access request is forwarded to the server.
Preferably, the method also includes steps:
The client monitors the server to the responsive state for requesting the load data;And
When the response timeout or failure for requesting the load data, load load data are re-requested.
Preferably, the client monitors the server to the responsive state for requesting the load data further include:
The client carries out timing after issuing the request for loading data;
The prompting message of a request timed out is issued when timing time is more than a preset time to remind the server to ring
Answer overlong time.
The second aspect of the application provides a kind of back end interface responding device, applies in client and leads to the client
In the server for believing connection, described device includes:
Request module, for control the client to the server send an access request to obtain load data,
Wherein the access request includes the interface IP address parameter of forwarding;
Interface determining module receives the access request that the client is sent for controlling the server, and according to institute
It states the interface IP address parameter in access request and determines a matched interface;
Data search module passes through data of the interface determined from the server for controlling the server
The data to match with the interface are searched in library;And
Sending module, for controlling the server for the load data transmission found out from the database to described
Client is so that the client loads the load data.
The third aspect of the application provides a kind of electronic equipment, and the electronic equipment includes processor, and the processor is used
The back end interface response method is realized when executing the computer program stored in memory.
The fourth aspect of the application provides a kind of computer readable storage medium, is stored thereon with computer program, described
The back end interface response method is realized when computer program is executed by processor.
The present invention judges locally whether be stored with load data by the description information of the front end data of client, if it exists
Data are loaded, then client directly reads the load data from local;Data are loaded if it does not exist, then user end to server
Request loads data, can so reduce the pressure of the back end interface of server and improve needed for the non-load for the first time of client
The speed of front end resource reduces flow and occupies.
Detailed description of the invention
Fig. 1 is the application environment schematic diagram of back end interface response method in an embodiment of the present invention.
Fig. 2 is the flow chart of back end interface response method in an embodiment of the present invention.
Fig. 3 is the structure chart of back end interface responding device in an embodiment of the present invention.
Fig. 4 is the schematic diagram of electronic equipment preferred embodiment of the present invention.
Specific embodiment
To better understand the objects, features and advantages of the present invention, with reference to the accompanying drawing and specific real
Applying example, the present invention will be described in detail.It should be noted that in the absence of conflict, embodiments herein and embodiment
In feature can be combined with each other.
In the following description, numerous specific details are set forth in order to facilitate a full understanding of the present invention, described embodiment is only
It is only a part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill
Personnel's every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
Unless otherwise defined, all technical and scientific terms used herein and belong to technical field of the invention
The normally understood meaning of technical staff is identical.Term as used herein in the specification of the present invention is intended merely to description tool
The purpose of the embodiment of body, it is not intended that in the limitation present invention.
Preferably, back end interface response method of the invention is applied in one or more electronic equipment.The electronics
Equipment is that one kind can be according to the instruction for being previously set or storing, the automatic equipment for carrying out numerical value calculating and/or information processing,
Hardware includes but is not limited to microprocessor, specific integrated circuit (Application Specific Integrated
Circuit, ASIC), programmable gate array (Field-Programmable Gate Array, FPGA), digital processing unit
(Digital Signal Processor, DSP), embedded device etc..
The electronic equipment can be the calculating such as desktop PC, laptop, tablet computer and cloud server
Equipment.The equipment can carry out man-machine friendship by modes such as keyboard, mouse, remote controler, touch tablet or voice-operated devices with user
Mutually.
Embodiment 1
Fig. 1 is the application environment schematic diagram of back end interface response method of the present invention.
As shown in fig.1, the back end interface response method is applied in server 1 and an at least client 3, the clothes
Business device 1 is connect by network 2 with an at least client 3.Wherein, the network 2 can be cable network, be also possible to wireless network
Network, such as radio, Wireless Fidelity (Wireless Fidelity, WIFI), honeycomb, satellite, broadcast etc..In an embodiment
In, the server 1 is server.The server 1 can be single server, be also possible to a server zone.It is described
Client 3 includes front end.For example, the front end can be the Webpage operated in client 3 or web document.One
A in embodiment, the client 3 can be the devices such as laptop, desktop computer, tablet computer, cell phone.
Fig. 2 is the flow chart of back end interface response method preferred embodiment of the present invention.The process according to different requirements,
The sequence of step can change in figure, and certain steps can be omitted.
As shown in fig.2, the back end interface response method specifically includes the following steps:
Step S201, client 3 send an access request to server 1 to obtain load data.
In present embodiment, the access request includes retransmitting paramater, and the retransmitting paramater is used to search data for rear end.
In present embodiment, the retransmitting paramater includes but is not limited to: method, shortUrl, requestParam, retKey,
splitPath,cacheTime.Wherein method indicates the interface requests mode of forwarding, default value GET.ShortUrl is indicated
The interface IP address of forwarding.RequestParam indicates the interface requests parameter of forwarding.RetKey indicates the number of ports after processing
According to the key assignments of storage, default value indicates retKey.SplitPath indicates to need to intercept the data of the node in returned packet
The path PATH.CacheTime indicates cache-time control mark.
In present embodiment, when there is the demand of load front end data in the front end of client 3, the client 3 is to described
Server 1 sends request.Wherein, the client 3 sends an access request to server 1 to obtain load data and include:
(S2011) client 3 judges whether the local of client 3 is stored with front end by the description information of front end data
Data.If so, S2011 is thened follow the steps, it is no to then follow the steps S2013.
In present embodiment, the description information of the front end data includes javaScript source file, CSS source file.Institute
Description information is stated for describing the mark, property and feature of the front end data.
(S2012) client 3 reads the front end data as load data from local.
In present embodiment, the front end of the client 3 can be web document.Client 3 reads front end number from local
According to the load data as web document.In one embodiment, client 3 can load web document according to front end data
Whole piecemeal frame and operation charging assembly.
(S2013) client 3 sends the access request to server 1 to obtain load data.
Judge locally whether be stored with load number by the description information of the front end data of client 3 in present embodiment
According to loading data if it exists, then client 3 directly reads the load data from local;Data are loaded if it does not exist, then client
End 3 loads data to 1 request of server, can so reduce the pressure of the back end interface of server 1 and improve client 3
The non-speed for loading required front end resource for the first time reduces flow and occupies.
In one embodiment, the client 3 sends an access request to server 1 to obtain load data and also wrap
Include: if front end data is initialization data or the data that web document state changes, client 3 sends to server 1 and accesses
Data of the request to obtain the initialization data or web document state changes;If front end data be it is non-load for the first time just
The data that beginningization data or web document state do not change, the client 3 read the non-initialization loaded for the first time from local
The data that data or web document state do not change.
Step S202, server 1 receives the access request that client 3 is sent, and determines one according to the access request
The interface matched.
In present embodiment, when server 1 receives the access request of the transmission of client 3, according to connecing in access request
Port address parameter (shortUrl) determines a matched interface.In present embodiment, the server 1 receives client 3 and sends
Access request, and according to the request determine a matched interface include:
(S2021) access when server 1 determines a matched interface according to the interface IP address parameter in access request
The interface.
(S2022) when server 1 is not determined and interface IP address parameter according to the interface IP address parameter in access request
3 one prompt informations of client are returned to when the interface to match to remind access to malfunction.
In present embodiment, server 1 owns according to the interface IP address parameter in access request to what server 1 was included
Back end interface is checked one by one, and the import is entered when determining the interface to match with access request and ought not found
3 one prompting messages of client are returned to when the interface to match with access request to remind user to access error, to avoid
The case where interface is without responding uses operation overcomplicated, nested sql query argument access interface so as to avoid user
And make the case where interface is without response.
In one embodiment, server 1 receives visitor based on the unaware of http proxy server orientation Proxy Method
The request that family end 3 is sent.The server 1 is a server cluster, and the server cluster includes multiple servers.Specifically
, step " rear end receives the access request that client 3 is sent, and determines a matched interface according to the request " includes:
(S2021 ') http proxy server receives the access request that client 3 is sent.
In present embodiment, the http proxy server can service for Nginx, Squid, Apache Traffic
Device.
(S2022 ') described http proxy server determines the server for issuing access request according to the access request
Front end mark.
The mark of front end described in present embodiment, can be the unique identifications such as code, the title of server 1, mainly
Different server 1 for identification.
In present embodiment, http proxy server, can be true according to the access request after receiving access request
The front end mark of fixed corresponding server 1, specifically can there are many feasible embodiments according to the content of access request.This reality
It applies in mode, the server 1 judges whether the user of client 3 is new registration user according to the access request.Wherein, may be used
To use whether contain the information for whether having the user in registration information and customer data base according in the access request
Etc. modes judge whether the user is new registration user.If new registration user, before will not having the user on server 1
Privatization data, the loading condition according to server each in current server cluster selects from the server cluster
It selects a server and distributes to the user, a routing table is preset on http proxy server, if being recorded in routing table
There is the corresponding front end mark of the server, it is possible to determine that the server of selection is corresponding according to preset routing table
Front end mark;More easily accessed for the ease of the user is subsequent, can also by the server of selection it is corresponding before
End mark write-in cookies, is then sent to client 3 for the cookies.If without recording the server in routing table
Corresponding front end mark should then carry the front end mark for the server that user's last time logs in the access request,
So, the front end that parsing obtains the server that the user requests access to directly from the access request identifies.
(S2023 ') inquires corresponding with front end mark in the http proxy server in preset routing table
The path of server 1.
In present embodiment, routing table is provided on http proxy server in advance, routing table records server set
The corresponding relationship of path and each front end mark of each server in group.
The access request is forwarded to the server 1 according to the path by (S2024 ').
The association of front end mark and server 1 is established in this case using routing table, so that client 3 be made to be identified i.e. according to front end
It may have access to corresponding server, in this way, when increasing server newly in the server 1, it is only necessary to modify routing table, be not required to
It increases second level domain newly, does not also need additionally to increase server configuration, so as to keep the unification of external URL, used in front end
The increase of server 1 is realized in family perception less than in the case where, while can effectively save domain name, in addition, change routing table phase
It is simpler, flexible compared with the mode for increasing second level domain and server configuration, it is extended convenient for the later period.
Step S203, the server 1 are searched and the determination by determining interface from the database of server 1
The data that interface matches.
In present embodiment, the server 1 is searched from the database of server 1 by determining interface and is asked with access
The data that interface requests parameter (requestParam) in asking matches.
Step S204, server 1 is by the load data transmission found out from database to client 3 so that client 3
Load the load data.
In present embodiment, the method is after step S201 further include: client 3 monitors 1 pair of request institute of server
State the responsive state of load data;When the response timeout or failure for requesting the load data, load load number is re-requested
According to.To retry load request automatically when resource loads failure, load failure rate is reduced.
In the present embodiment, the responsive state availability status word for requesting the load data is obtained.Specific real
During applying, client 3 can arrange the rule of responsive state with server 1, status code, number such as the response of provisioning server 1
The error message prompt of client 3 is fed back to according to format and rear end.
In present embodiment, the front end of the client 3 can be web document, the tail of the web document (i.e. front end)
Portion includes the corresponding code for loading the mode of the load data, and the corresponding code of mode for loading the load data is set
In the tail portion of the web document of the client 3,3 browser APP of client can be allowed when parsing the web document in this way
It is not disrupted as far as possible, to accelerate the web page layout response time.
In present embodiment, when executing the code for the tail portion for being placed in the web document, if the downloading number to be loaded
According to quantity be it is multiple, then the browser APP of client 3 is according to the sequencing of request by multiple load data of downloading
It is added into the web document.In the present embodiment, if the quantity of the load data of downloading is multiple, the browsing of client 3
The request that device APP downloads the load data to improve speed of download, but can work as to be multiple parallel and download to multiple load numbers
According to rear, then multiple load data of downloading are loaded into the web document according to the sequencing of request, with ensure to have according to
Dependence between the different load data for the relationship of relying.Such as: assuming that in the web document include three loads data A, B, C,
The wherein correct load of B depends on the correct load of A, and the correct load of C depends on the correct load of B, browser APP according to A,
B, the sequencing of C requests downloading above three to load data to each server simultaneously, although due to the data of each load data
The difference of size and the network transfer speeds between each server, complete downloading sequence be B, A, C, but browser APP according to
So above-mentioned 3 loads data can be added into the web document according to the sequencing of A, B, C, so that B, C will not be because being mentioned
Preceding load and cause unnecessary load to fail, so that it is guaranteed that all load data can be loaded smoothly, raising loading efficiency.
In present embodiment, the client 3 monitors the responsive state of 1 pair of server request load data also
Include:
Client 3 carries out timing after issuing the request for loading data;
When issuing the prompting message of a request timed out when timing time is more than a preset time to remind server 1 to respond
Between it is too long.In this way, avoiding user's meaningless waiting for a long time, user experience is promoted.
In present embodiment, client 3 is communicated with server 1 by HTTP2.0 agreement, so advantageously reduces net
Lattice delay, and reduce the link pressure of server 1.
Embodiment 2
Fig. 3 is the structure chart of back end interface responding device 40 in an embodiment of the present invention.
In some embodiments, the back end interface responding device 40 is run in electronic equipment.The back end interface is rung
Answering device 40 may include multiple functional modules as composed by program code segments.It is each in the back end interface responding device 40
The program code of a program segment can store in memory, and as performed by least one processor, to execute back end interface
The function of response.
In the present embodiment, function of the back end interface responding device 40 of the electronic equipment according to performed by it can be by
It is divided into multiple functional modules.As shown in fig.3, the back end interface responding device 40 may include request module 401, interface
Determining module 402, data search module 403, sending module 404 and monitoring module 405.The so-called module of the present invention refers to one kind
Performed by least one processor and the series of computation machine program segment of fixed function can be completed, be stored in
In reservoir.The request module 401, monitoring module 405 operate in the client 3, the interface determining module 402, number
It is operated in the server 1 according to searching module 403, sending module 404.In some embodiments, the function about each module
It will be described in detail in subsequent embodiment.
The request module 401 sends an access request to server 1 for controlling client 3 to obtain load data.
In present embodiment, the access request includes retransmitting paramater, and the retransmitting paramater is used to search data for rear end.
In present embodiment, the retransmitting paramater includes but is not limited to: method, shortUrl, requestParam, retKey,
splitPath,cacheTime.Wherein method indicates the interface requests mode of forwarding, default value GET.ShortUrl is indicated
The interface IP address of forwarding.RequestParam indicates the interface requests parameter of forwarding.RetKey indicates the number of ports after processing
According to the key assignments of storage, default value indicates retKey.SplitPath indicates to need to intercept the data of the node in returned packet
The path PATH.CacheTime indicates cache-time control mark.
In present embodiment, when there is the demand of load front end data in the front end of client 3, the request module 401 is controlled
Client 3 processed sends to the server 1 and requests.In a specific embodiment, the request module 401 passes through client 3
Front end data description information, judge whether the local of client 3 is stored with front end data;When being locally stored for client 3
When having front end data, the request module 401 controls client 3 and reads the front end data as load data from local;When
When front end data has been locally stored of client 3, the request module 401 control client 3 and send the access to server 1
Request is to obtain load data.
In present embodiment, the description information of the front end data includes javaScript source file, CSS source file.Institute
Description information is stated for describing the mark, property and feature of the front end data.In present embodiment, before the client 3
End can be web document.The front end that the request module 401 controls client 3 loads the whole of web document according to front end data
Body piecemeal frame and operation charging assembly.
Judge locally whether be stored with load data by the description information of the front end data of front end in present embodiment, if
In the presence of load data, then client 3 directly reads the load data from local;Load data if it does not exist, then client 3 to
1 request of server loads data, can so reduce the pressure of the back end interface of server 1 and improve the non-head of client 3
The speed of front end resource needed for secondary load reduces flow and occupies.
In one embodiment, described if front end data is the data that initialization data or web document state change
Request module 401 controls client 3 and sends access request to server 1 to obtain the initialization data or web document state
The data changed.If front end data is the data that the non-initialization data loaded for the first time or web document state do not change,
The request module 401 controls the client 3 and reads the non-initialization data loaded for the first time or web document state from local
The data not changed.
The interface determining module 402 receives the access request that client 3 is sent for control server 1, and according to institute
It states access request and determines a matched interface.
In present embodiment, when server 1 receives the access request of the transmission of client 3, the interface determining module 402
A matched interface is determined according to the interface IP address parameter (shortUrl) in access request.In a specific embodiment, institute
Interface determining module 402 is stated to be also used to determine that one matched connects according to the interface IP address parameter in access request when server 1
Mouthful when access the interface, and when server 1 is not determined and interface IP address according to the interface IP address parameter in access request
3 one prompt informations of client are returned to when the interface that parameter matches to remind access to malfunction.
In present embodiment, 402 control server 1 of interface determining module is joined according to the interface IP address in access request
All back end interfaces that several pairs of servers 1 are included are checked one by one, when the interface for determining to match with access request
3 one prompting messages of client are returned into the import and when not finding the interface to match with access request to mention
The user that wakes up accesses error, to avoid the case where interface is without respond, so as to avoid user using operating overcomplicated, embedding
The sql query argument access interface of set and make interface without response the case where.
In one embodiment, 402 control server 1 of interface determining module is based on the noninductive of http proxy server
Orientation Proxy Method is known to receive the request of the transmission of client 3.The server 1 is a server cluster, the server set
Group includes multiple servers.Specifically, http proxy server receives the access request that client 3 is sent, the http agency
Server determines that the front end for issuing the server of access request identifies according to the access request, in the http proxy server
In in preset routing table inquiry identify the path of corresponding server 1 with the front end, and according to the path by the visit
Ask that request is forwarded to the server 1.In present embodiment, the http proxy server can for Nginx, Squid,
Apache Traffic server.The mark of front end described in present embodiment, can be code, title of server 1 etc. only
One property mark, is mainly used for identifying different servers 1.
In present embodiment, http proxy server, can be true according to the access request after receiving access request
The front end mark of fixed corresponding server 1, specifically can there are many feasible embodiments according to the content of access request.This reality
It applies in mode, the server 1 judges whether the user of client 3 is new registration user according to the access request.Wherein, may be used
To use whether contain the information for whether having the user in registration information and customer data base according in the access request
Etc. modes judge whether the user is new registration user.If new registration user, before will not having the user on server 1
Privatization data, the loading condition according to server each in current server cluster selects from the server cluster
It selects a server and distributes to the user, a routing table is preset on http proxy server, if being recorded in routing table
There is the corresponding front end mark of the server, it is possible to determine that the server of selection is corresponding according to preset routing table
Front end mark;More easily accessed for the ease of the user is subsequent, can also by the server of selection it is corresponding before
End mark write-in cookies, is then sent to client 3 for the cookies.If without recording the server in routing table
Corresponding front end mark should then carry the front end mark for the server that user's last time logs in the access request,
So, the front end that parsing obtains the server that the user requests access to directly from the access request identifies.
In present embodiment, routing table is provided on http proxy server in advance, routing table records server set
The corresponding relationship of path and each front end mark of each server in group.This case establishes front end mark and server 1 using routing table
Association, thus make client 3 according to front end mark may have access to corresponding server, in this way, in the server 1 increase newly service
When device, it is only necessary to routing table is modified, newly-increased second level domain is not needed, does not also need additionally to increase server configuration,
So as to keep the unification of external URL, front end user perception less than in the case where realize the increase of server 1, while energy
It is enough effectively to save domain name, in addition, change routing table it is simpler compared to the mode that increases second level domain and server configuration,
Flexibly, it is extended convenient for the later period.
The data search module 403 is used to control database of the server 1 by determining interface from server 1
The data that the interface of middle lookup and the determination matches.
In present embodiment, the data search module 403 controls the server 1 and passes through determining interface from server
The data to match with the interface requests parameter (requestParam) in access request are searched in 1 database.
The load data transmission that the sending module 404 is used to find out from database is to client 3 so that client
The 3 load load data of end.
405 client 3 of module of monitoring monitors the responsive state of 1 pair of server request load data, and works as and ask
When asking response timeout or the failure of the load data, load load data are re-requested.Thus when resource loads failure, from
It is dynamic to retry load request, reduce load failure rate.
In the present embodiment, the responsive state availability status word for requesting the load data is obtained.Specific real
During applying, client 3 can arrange the rule of responsive state with server 1, status code, number such as the response of provisioning server 1
The error message prompt of client 3 is fed back to according to format and rear end.
In present embodiment, the front end of the client 3 can be web document, the tail of the web document (i.e. front end)
Portion includes the corresponding code for loading the mode of the load data, that is, the mode for loading the load data is corresponding
Code is placed in the tail portion of the web document of the client 3, and 3 browser APP of client can be allowed to parse the webpage in this way
It is not disrupted as far as possible when document, to accelerate the web page layout response time.
In present embodiment, when executing the code for the tail portion for being placed in the web document, if the downloading number to be loaded
According to quantity be it is multiple, then the browser APP of client 3 is according to the sequencing of request by multiple load data of downloading
It is added into the web document.In the present embodiment, if the quantity of the load data of downloading is multiple, the browsing of client 3
The request that device APP downloads the load data to improve speed of download, but can work as to be multiple parallel and download to multiple load numbers
According to rear, then multiple load data of downloading are loaded into the web document according to the sequencing of request, with ensure to have according to
Dependence between the different load data for the relationship of relying.Such as: assuming that in the web document include three loads data A, B, C,
The wherein correct load of B depends on the correct load of A, and the correct load of C depends on the correct load of B, browser APP according to A,
B, the sequencing of C requests downloading above three to load data to each server simultaneously, although due to the data of each load data
The difference of size and the network transfer speeds between each server, complete downloading sequence be B, A, C, but browser APP according to
So above-mentioned 3 loads data can be added into the web document according to the sequencing of A, B, C, so that B, C will not be because being mentioned
Preceding load and cause unnecessary load to fail, so that it is guaranteed that all load data can be loaded smoothly, raising loading efficiency.
In present embodiment, the module 405 of monitoring is also used to be counted after the request that client 3 issues load data
When, and the prompting message of a request timed out is issued when timing time is more than a preset time to remind 1 response time of server
It is too long.In this way, avoiding user's meaningless waiting for a long time, user experience is promoted.
In present embodiment, client 3 is communicated with server 1 by HTTP2.0 agreement, so advantageously reduces net
Lattice delay, and reduce the link pressure of server 1.
Embodiment three
Fig. 4 is the schematic diagram of 7 preferred embodiment of electronic equipment of the present invention.
The electronic equipment 7 includes memory 71, processor 72 and is stored in the memory 71 and can be described
The computer program 73 run on processor 72.The processor 72 realizes above-mentioned rear termination when executing the computer program 73
Step in mouth response method embodiment, such as step 201~204 shown in Fig. 2.Alternatively, the processor 42 execute it is described
The function of each module/unit in above-mentioned back end interface responding device embodiment, such as the mould in Fig. 3 are realized when computer program 43
Block 401~405.
Illustratively, the computer program 73 can be divided into one or more module/units, it is one or
Multiple module/units are stored in the memory 71, and are executed by the processor 72, to complete the present invention.Described one
A or multiple module/units can be the series of computation machine program instruction section that can complete specific function, and described instruction section is used
In implementation procedure of the description computer program 73 in the electronic equipment 7.For example, the computer program 73 can be by
Request module 401, interface determining module 402, data search module 403, sending module 404 and the monitoring mould being divided into Fig. 3
Block 405, each module concrete function is referring to embodiment two.
The electronic equipment 7 can be the calculating such as desktop PC, notebook, palm PC and cloud server and set
It is standby.It will be understood by those skilled in the art that the schematic diagram is only the example of electronic equipment 7, do not constitute to electronic equipment 7
Restriction, may include perhaps combining certain components or different components, such as institute than illustrating more or fewer components
Stating electronic equipment 7 can also include input-output equipment, network access equipment, bus etc..
Alleged processor 72 can be central processing module (Central Processing Unit, CPU), can also be
Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit
(Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-
Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,
Discrete hardware components etc..General processor can be microprocessor or the processor 72 is also possible to any conventional processing
Device etc., the processor 72 are the control centres of the electronic equipment 7, utilize various interfaces and the entire electronic equipment of connection
7 various pieces.
The memory 71 can be used for storing the computer program 73 and/or module/unit, and the processor 72 passes through
Operation executes the computer program and/or module/unit being stored in the memory 71, and calls and be stored in memory
Data in 71 realize the various functions of the meter electronic equipment 7.The memory 71 can mainly include storing program area and deposit
Store up data field, wherein storing program area can application program needed for storage program area, at least one function (for example sound is broadcast
Playing function, image player function etc.) etc.;Storage data area can store according to electronic equipment 7 use created data (such as
Audio data, phone directory etc.) etc..In addition, memory 71 may include high-speed random access memory, it can also include non-volatile
Property memory, such as hard disk, memory, plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital
(Secure Digital, SD) card, flash card (Flash Card), at least one disk memory, flush memory device or other
Volatile solid-state part.
If the integrated module/unit of the electronic equipment 7 is realized in the form of software function module and as independent
Product when selling or using, can store in a computer readable storage medium.Based on this understanding, the present invention is real
All or part of the process in existing above-described embodiment method, can also instruct relevant hardware come complete by computer program
At the computer program can be stored in a computer readable storage medium, and the computer program is held by processor
When row, it can be achieved that the step of above-mentioned each embodiment of the method.Wherein, the computer program includes computer program code, institute
Stating computer program code can be source code form, object identification code form, executable file or certain intermediate forms etc..It is described
Computer-readable medium may include: any entity or device, recording medium, U that can carry the computer program code
Disk, mobile hard disk, magnetic disk, CD, computer storage, read-only memory (ROM, Read-Only Memory), arbitrary access
Memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It needs
It is bright, the content that the computer-readable medium includes can according in jurisdiction make laws and patent practice requirement into
Row increase and decrease appropriate, such as do not include electric load according to legislation and patent practice, computer-readable medium in certain jurisdictions
Wave signal and telecommunication signal.
In several embodiments provided by the present invention, it should be understood that arriving, disclosed electronic equipment and method can be with
It realizes by another way.For example, electronic equipment embodiment described above is only schematical, for example, the mould
The division of block, only a kind of logical function partition, there may be another division manner in actual implementation.
It, can also be in addition, each functional module in each embodiment of the present invention can integrate in same treatment module
It is that modules physically exist alone, can also be integrated in equal modules with two or more modules.Above-mentioned integrated mould
Block both can take the form of hardware realization, can also realize in the form of hardware adds software function module.
It is obvious to a person skilled in the art that invention is not limited to the details of the above exemplary embodiments, Er Qie
In the case where without departing substantially from spirit or essential attributes of the invention, the present invention can be realized in other specific forms.Therefore, no matter
From the point of view of which point, the present embodiments are to be considered as illustrative and not restrictive, and the scope of the present invention is by appended power
Benefit requires rather than above description limits, it is intended that all by what is fallen within the meaning and scope of the equivalent elements of the claims
Variation is included in the present invention.Any reference signs in the claims should not be construed as limiting the involved claims.This
Outside, it is clear that one word of " comprising " is not excluded for other modules or step, and odd number is not excluded for plural number.It is stated in electronic equipment claim
Multiple modules or electronic equipment can also be implemented through software or hardware by the same module or electronic equipment.The first, the
Second-class word is used to indicate names, and is not indicated any particular order.
Finally it should be noted that the above examples are only used to illustrate the technical scheme of the present invention and are not limiting, although reference
Preferred embodiment describes the invention in detail, those skilled in the art should understand that, it can be to of the invention
Technical solution is modified or equivalent replacement, without departing from the spirit and scope of the technical solution of the present invention.
Claims (10)
1. a kind of back end interface response method is applied in client and the server connecting with the client communication, special
Sign is, which comprises
The client sends an access request to the server to obtain load data, wherein the access request includes turning
The interface IP address parameter of hair;
The server receives the access request that the client is sent, and according to the interface IP address parameter in the access request
Determine a matched interface;
The server is searched from the database of the server and the matched interface phase by the matched interface
Matched data;And
The server is by the load data transmission found out from the database to the client so that the client
Load the load data.
2. back end interface response method as described in claim 1, which is characterized in that the client is sent to the server
One access request with obtain load data include:
The client judges whether the local of the client stores by the description information of the front end data of the client
There is front end data;
When the client is when being locally stored front end data, the client from the local of the client read it is described before
End data is as load data;And
When the local of the client does not store front end data, the client sends the access to the server and asks
It asks to obtain load data.
3. back end interface response method as described in claim 1, which is characterized in that the client is sent to the server
One access request with obtain load data include:
If front end data is initialization data or the data that web document state changes, the client is sent out to the server
The data that the access request is sent to obtain the initialization data or web document state changes;And
If front end data is the non-initialization data loaded for the first time or the data that web document state does not change, the client
It from the local of the client reads the non-initialization data loaded for the first time or web document state does not change
Data.
4. back end interface response method as described in claim 1, which is characterized in that the server receives the client hair
The access request sent, and determine that a matched interface includes: according to the access request
When the server determines a matched interface according to the interface IP address parameter in the access request, described in access
Matched interface;And
When the server is not determined and the interface IP address parameter according to the interface IP address parameter in the access request
When the interface to match, one prompt information of the client is returned to remind access to malfunction.
5. back end interface response method as described in claim 1, which is characterized in that the server receives what client was sent
Access request includes:
The server receives the access request that the client is sent by http proxy server, wherein the http is acted on behalf of
Server determines that the front end for issuing the server of access request identifies according to the access request, in the http proxy server
In in preset routing table inquiry identify the path of corresponding server with the front end, and according to the path by the access
Request is forwarded to the server.
6. back end interface response method as described in claim 1, which is characterized in that the method also includes steps:
The client monitors the server to the responsive state of the access request;And
When the response timeout of the access request or failure, access request is retransmitted to obtain load data.
7. back end interface response method as claimed in claim 6, which is characterized in that the client monitors the server pair
Request the responsive state of the load data further include:
The client carries out timing after issuing the request for loading data;
When issuing the prompting message of a request timed out when timing time is more than a preset time to remind the server to respond
Between it is too long.
8. a kind of back end interface responding device is applied in client and the server connecting with the client communication, special
Sign is that described device includes:
Request module sends an access request to the server for controlling the client to obtain load data, wherein
The access request includes the interface IP address parameter of forwarding;
Interface determining module receives the access request that the client is sent for controlling the server, and according to the visit
Ask that the interface IP address parameter in request determines a matched interface;
Data search module passes through the interface determined from the database of the server for controlling the server
Search the data to match with the interface;And
Sending module, for controlling the server for the load data transmission found out from the database to the client
It holds so that the client loads the load data.
9. a kind of electronic equipment, it is characterised in that: the electronic equipment includes processor, and the processor is for executing memory
The back end interface response method as described in any one of claim 1-7 is realized when the computer program of middle storage.
10. a kind of computer readable storage medium, is stored thereon with computer program, it is characterised in that: the computer program
The back end interface response method as described in any one of claim 1-7 is realized when being executed by processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811537748.XA CN109871498B (en) | 2018-12-15 | 2018-12-15 | Rear-end interface response method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811537748.XA CN109871498B (en) | 2018-12-15 | 2018-12-15 | Rear-end interface response method and device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109871498A true CN109871498A (en) | 2019-06-11 |
CN109871498B CN109871498B (en) | 2024-04-02 |
Family
ID=66917090
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811537748.XA Active CN109871498B (en) | 2018-12-15 | 2018-12-15 | Rear-end interface response method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109871498B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110427324A (en) * | 2019-07-30 | 2019-11-08 | 中国工商银行股份有限公司 | Joint debugging system, joint debugging method, computer equipment and storage medium |
CN112115103A (en) * | 2020-09-02 | 2020-12-22 | 北京奇艺世纪科技有限公司 | File address display method and device, electronic equipment and readable storage medium |
CN113127414A (en) * | 2019-12-31 | 2021-07-16 | 贵州白山云科技股份有限公司 | Request processing method and system and edge node |
CN113590100A (en) * | 2021-09-28 | 2021-11-02 | 深圳市信润富联数字科技有限公司 | Front-end interface processing method, system, electronic equipment and storage medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090300138A1 (en) * | 2008-05-29 | 2009-12-03 | Red Hat, Inc. | Using Distributed Aspects to Reorder Online Application Workflows |
US20130013729A1 (en) * | 2011-07-07 | 2013-01-10 | International Business Machines Corporation | Multi-level adaptive caching within asset-based web systems |
CN103593466A (en) * | 2013-11-26 | 2014-02-19 | 优视科技有限公司 | Webpage loading method, client side and server |
CN105930538A (en) * | 2016-06-27 | 2016-09-07 | 北京奇虎科技有限公司 | Webpage accessing request processing method and server |
CN106921699A (en) * | 2015-12-25 | 2017-07-04 | 北京奇虎科技有限公司 | A kind of Network Access Method, device and system |
CN106951573A (en) * | 2017-04-27 | 2017-07-14 | 努比亚技术有限公司 | A kind of living broadcast interactive data load method, server and computer-readable medium |
CN106961469A (en) * | 2017-02-28 | 2017-07-18 | 北京致远互联软件股份有限公司 | Unaware orientation Proxy Method and system based on http proxy servers |
CN108093086A (en) * | 2018-01-22 | 2018-05-29 | 微梦创科网络科技(中国)有限公司 | The data transmission method and system of a kind of gateway |
-
2018
- 2018-12-15 CN CN201811537748.XA patent/CN109871498B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090300138A1 (en) * | 2008-05-29 | 2009-12-03 | Red Hat, Inc. | Using Distributed Aspects to Reorder Online Application Workflows |
US20130013729A1 (en) * | 2011-07-07 | 2013-01-10 | International Business Machines Corporation | Multi-level adaptive caching within asset-based web systems |
CN103593466A (en) * | 2013-11-26 | 2014-02-19 | 优视科技有限公司 | Webpage loading method, client side and server |
CN106921699A (en) * | 2015-12-25 | 2017-07-04 | 北京奇虎科技有限公司 | A kind of Network Access Method, device and system |
CN105930538A (en) * | 2016-06-27 | 2016-09-07 | 北京奇虎科技有限公司 | Webpage accessing request processing method and server |
CN106961469A (en) * | 2017-02-28 | 2017-07-18 | 北京致远互联软件股份有限公司 | Unaware orientation Proxy Method and system based on http proxy servers |
CN106951573A (en) * | 2017-04-27 | 2017-07-14 | 努比亚技术有限公司 | A kind of living broadcast interactive data load method, server and computer-readable medium |
CN108093086A (en) * | 2018-01-22 | 2018-05-29 | 微梦创科网络科技(中国)有限公司 | The data transmission method and system of a kind of gateway |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110427324A (en) * | 2019-07-30 | 2019-11-08 | 中国工商银行股份有限公司 | Joint debugging system, joint debugging method, computer equipment and storage medium |
CN110427324B (en) * | 2019-07-30 | 2023-09-08 | 中国工商银行股份有限公司 | Joint debugging system, joint debugging method, computer equipment and storage medium |
CN113127414A (en) * | 2019-12-31 | 2021-07-16 | 贵州白山云科技股份有限公司 | Request processing method and system and edge node |
CN112115103A (en) * | 2020-09-02 | 2020-12-22 | 北京奇艺世纪科技有限公司 | File address display method and device, electronic equipment and readable storage medium |
CN112115103B (en) * | 2020-09-02 | 2023-08-01 | 北京奇艺世纪科技有限公司 | File address display method and device, electronic equipment and readable storage medium |
CN113590100A (en) * | 2021-09-28 | 2021-11-02 | 深圳市信润富联数字科技有限公司 | Front-end interface processing method, system, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN109871498B (en) | 2024-04-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109871498A (en) | Back end interface response method, device, electronic equipment and storage medium | |
CN107590001B (en) | Load balancing method and device, storage medium and electronic equipment | |
CN109684358B (en) | Data query method and device | |
CN110519401A (en) | Improve method, apparatus, equipment and the storage medium of network Access Success Rate | |
CN108696374A (en) | Update the method and apparatus of client configuration | |
CN104081339A (en) | Managing data transfers over network connections based on priority and data usage plan | |
CN110019125A (en) | The method and apparatus of data base administration | |
CN109151025B (en) | Load balancing method and device based on URL, computer storage medium and equipment | |
CN110727738B (en) | Global routing system based on data fragmentation, electronic equipment and storage medium | |
CN110096663A (en) | Page loading method, device, electronic equipment and computer readable storage medium | |
EP3091712B1 (en) | Smart device for realizing multiple-device collaboration and working method for multiple-device collaboration | |
CN109982152A (en) | P2P CDN method for processing business, intelligent gateway and CDN platform | |
CN107659473A (en) | Connection control method, system, routing server and computer-readable recording medium | |
CN114924751A (en) | Method and device for distributing service access request flow | |
CN110996372B (en) | Message routing method, device and system and electronic equipment | |
CN110019539A (en) | A kind of method and apparatus that the data of data warehouse are synchronous | |
CN113301079A (en) | Data acquisition method, system, computing device and storage medium | |
CN111444278A (en) | Data synchronization method and device and transfer server | |
CN113452600A (en) | Cross-region message communication method and device, electronic equipment and storage medium | |
CN109634630A (en) | Application program update method, apparatus, electronic equipment and storage medium | |
CN110401731B (en) | Method and apparatus for distributing content distribution nodes | |
CN106408793B (en) | A kind of Service Component sharing method and system suitable for ATM business | |
CN113609349A (en) | Rental vehicle inventory detection method, apparatus and medium | |
CN108173898A (en) | The method, apparatus and terminal device of service are accessed for resource | |
CN114422436A (en) | Gateway, gateway control method, gateway control device, electronic equipment and storage medium |
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 |