CN109040316B - HTTP service processing method and device - Google Patents

HTTP service processing method and device Download PDF

Info

Publication number
CN109040316B
CN109040316B CN201811096347.5A CN201811096347A CN109040316B CN 109040316 B CN109040316 B CN 109040316B CN 201811096347 A CN201811096347 A CN 201811096347A CN 109040316 B CN109040316 B CN 109040316B
Authority
CN
China
Prior art keywords
target
access request
service server
http
interface
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.)
Active
Application number
CN201811096347.5A
Other languages
Chinese (zh)
Other versions
CN109040316A (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.)
Beijing Feishu Technology Co ltd
Original Assignee
Tianjin ByteDance Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianjin ByteDance Technology Co Ltd filed Critical Tianjin ByteDance Technology Co Ltd
Priority to CN201811096347.5A priority Critical patent/CN109040316B/en
Publication of CN109040316A publication Critical patent/CN109040316A/en
Application granted granted Critical
Publication of CN109040316B publication Critical patent/CN109040316B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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]
    • 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/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Abstract

The application discloses a method and a device for processing HTTP (hyper text transport protocol) service, wherein the method comprises the following steps: analyzing the acquired HTTP access request to acquire a target path in the access request; determining a corresponding target interface and a target service server according to the target path; and sending the access request to the target service server through the target interface so that the target service server responds to the access request. According to the method, the path information is carried in the access request, and then the corresponding interface and the business server can be determined according to the path information, so that the possibility is provided for deploying a plurality of HTTP sub-services on one HTTP service, the HTTP service function can be provided for a plurality of businesses, the business development complexity is reduced, the business development time is shortened, and the business development efficiency is improved.

Description

HTTP service processing method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for processing an HTTP service.
Background
The HyperText Transfer Protocol (HTTP) is a network Protocol most widely used on the internet. The method can achieve the purpose of sending an HTTP request to the server through the client and acquiring the needed data resources from the server side.
At present, in a process of developing a service with an HTTP service function, a designer needs to provide an HTTP service as an interface layer for the service to meet the HTTP service requirement. The HTTP service interface generally needs to have functions of Cookie management, login capability, security protection, and the like. This results in a complex, long and inefficient business development process.
Disclosure of Invention
The application provides a method and a device for processing an HTTP service, which are used for solving the problems of complex service development process, long time and low efficiency in the related technology.
An embodiment of an aspect of the present application provides an HTTP service processing method, including: analyzing the acquired HTTP access request to acquire a target path in the access request; determining a corresponding target interface and a target service server according to the target path; and sending the access request to the target service server through the target interface so that the target service server responds to the access request.
Another embodiment of the present application provides an HTTP service processing apparatus, including: the acquisition module is used for analyzing the acquired HTTP access request to acquire a target path in the access request; the determining module is used for determining a corresponding target interface and a corresponding target service server according to the target path; and the response module is used for sending the access request to the target service server through the target interface so as to enable the target service server to respond to the access request.
In another aspect, the present application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the HTTP service processing method described in the first aspect is implemented.
The computer-readable storage medium of an embodiment of a further aspect of the present application stores thereon a computer program, which, when executed by a processor, implements the HTTP service processing method described in the embodiment of the first aspect.
The computer program of an embodiment of another aspect of the present application, when executed by a processor, implements the HTTP service processing method described in the embodiment of the first aspect.
The technical scheme disclosed in the application has the following beneficial effects:
the method comprises the steps of analyzing an acquired HTTP access request to acquire a target path in the access request, determining a corresponding target interface and a target service server according to the target path, and sending the access request to the target service server through the target interface, so that the target service server responds to the access request. Therefore, by carrying the path information in the access request, the corresponding interface and the service server can be determined according to the path information, and the possibility of deploying a plurality of HTTP sub-services on one HTTP service is provided, so that the HTTP service function can be provided for a plurality of services, the complexity of service development is reduced, the service development time is shortened, and the service development efficiency is improved.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
The above and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which,
fig. 1 is a flowchart illustrating a HTTP service processing method according to an embodiment of the present application;
fig. 2 is a flowchart illustrating a HTTP service processing method according to another embodiment of the present application;
FIG. 3 is a flow diagram illustrating a method of HTTP service processing according to yet another embodiment of the present application;
fig. 4 is a schematic structural diagram of an HTTP service processing apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an HTTP service processing apparatus according to another embodiment of the present application;
fig. 6 is a schematic structural diagram of an HTTP service processing apparatus according to still another embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary and intended to be used for explaining the present application and should not be construed as limiting the present application.
The embodiments of the application provide an HTTP service processing method for solving the problems of complex service development process, long time and low efficiency in the related art.
According to the embodiment of the application, the target path is obtained by analyzing the HTTP access request, and then the target interface and the target service server are determined according to the target path, so that the access request is sent to the target service server through the determined target interface, and the target service server responds to the access request. Therefore, by carrying the path information in the access request, the corresponding interface and the service server can be determined according to the path information, and the possibility of deploying a plurality of HTTP sub-services on one HTTP service is provided, so that the HTTP service function can be provided for a plurality of services, the complexity of service development is reduced, the service development time is shortened, and the service development efficiency is improved.
The HTTP service processing method and apparatus according to the embodiment of the present application are described in detail below with reference to the drawings. First, a HTTP service processing method in the embodiment of the present application is specifically described with reference to fig. 1.
Fig. 1 is a flowchart illustrating an HTTP service processing method according to an embodiment of the present application. As shown in fig. 1, the HTTP service processing method of the present application may include the steps of:
step 101, analyzing the obtained HTTP access request to obtain a target path in the access request.
The HTTP service processing method provided in the embodiment of the present application may be executed by the electronic device provided in the embodiment of the present application. The electronic equipment is provided with an HTTP service processing device to control HTTP access requests. In this embodiment, the electronic device may be any hardware device having a data processing function, such as a smart phone, a wearable device, a personal digital assistant, a server, and the like.
Optionally, in actual use, the client (e.g., a Web browser) may establish a connection with the server through a network, where the connection may be completed through a Transmission Control Protocol (TCP). After the client establishes a TCP connection with the server, the client may send an HTTP access request to the server. For example: GET/hello.jsp HTTP/1.1. In this embodiment, the server may refer to an HTTP server.
Furthermore, after acquiring the HTTP access request sent by the client, the server may perform parsing on the HTTP access request to acquire a target path in the HTTP access request.
For example, if the HTTP access request is GET/hello.jsp HTTP/1.1, the target path in the access request can be resolved as: jsp.
That is, the present embodiment implements dynamic identification of the access request by parsing the HTTP access request, so as to perform a corresponding operation according to the identification result.
And 102, determining a corresponding target interface and a target service server according to the target path.
Optionally, since the path information in the access request may indicate that the data resource is stored in a specific location in the corresponding service server, after the target path in the access request is obtained, the corresponding target interface and the corresponding target service server may be determined according to the target path in the embodiment of the present application.
In this embodiment, in order to improve the service development efficiency, the corresponding relationship among the path, the interface, and the service server may be registered in the server in advance to establish a corresponding relationship table among the interface, the service, and the server, so that after the target path in the access request is obtained, the target interface and the target service server may be determined by searching the relationship table among the interface, the service, and the server according to the target path.
That is, in the embodiment of the present application, before determining the corresponding target interface and the target service server according to the target path, the method further includes:
acquiring an HTTP service registration request, wherein the registration request comprises the target service path, a target interface and a target service server;
and storing the corresponding relation between the target path and the target interface and the target service server.
That is, after the target path is obtained, the corresponding target interface and the target service server can be searched in the preset corresponding relation according to the target path by performing HTTP service registration operation on the server side in advance, so that the processing speed is increased, and the processing time is saved.
And 103, sending the access request to the target service server through the target interface so that the target service server responds to the access request.
Optionally, after the target interface and the target service are determined, the embodiment may send the access request to the target service server through the target interface, so that the target service server performs response processing on the access request.
According to an embodiment of the present application, after sending the access request to the target service server through the target interface, the target service server may obtain a corresponding response message according to the access request, and return the response message to the client through the target interface.
Namely, the embodiment of the present application further includes:
receiving a response message returned by the target service server through the target interface;
and returning the response message to the client initiating the HTTP access request.
It can be understood that, in the embodiment of the present application, the HTTP service is registered in the server side in advance, so that the server stores the corresponding relationship between the path and the interface and the service server in the registration request, and thus when the HTTP access request is subsequently obtained, the access request is analyzed to obtain the target path, and according to the target path, the target interface and the target service server are searched in the corresponding relationship between the path and the interface and the service server, and then the access request is sent to the target service server through the corresponding target interface, so as to improve the service development efficiency.
According to the HTTP service processing method provided by the embodiment of the application, the acquired HTTP access request is analyzed to acquire the target path in the access request, and then the corresponding target interface and the target service server are determined according to the target path to send the access request to the target service server through the target interface, so that the target service server responds to the access request. Therefore, by carrying the path information in the access request, the corresponding interface and the service server can be determined according to the path information, and the possibility of deploying a plurality of HTTP sub-services on one HTTP service is provided, so that the HTTP service function can be provided for a plurality of services, the complexity of service development is reduced, the service development time is shortened, and the service development efficiency is improved.
As can be seen from the above analysis, in the embodiment of the present application, the target path is obtained, and the target interface and the target service server are determined according to the target path, so that the access request is sent to the target service server through the target interface, and the target service server responds to the access request.
In a specific implementation, if the HTTP service includes a plurality of domain names for providing services, the HTTP access request may further include a target domain name. E.g., apigage.me, exampie.com, etc. When the HTTP access request is analyzed, the target domain name and the target path can be obtained, and further the target interface and the target service can be determined according to the target domain name. The HTTP service processing method according to the embodiment of the present application will be described in detail below with reference to fig. 2.
Fig. 2 is a flowchart illustrating an HTTP service processing method according to another embodiment of the present application. As shown in fig. 2, the HTTP service processing method according to the embodiment of the present application may include the following steps:
step 201, the obtained HTTP access request is analyzed to obtain a target domain name and a target path in the access request.
For example, assume that HTTP access request a is: https:// align. me/doc, by analyzing the access request a, the target domain name can be obtained as: me, the target path is: and/doc.
Step 202, according to the target domain name, determining a target mapping relation table, wherein the mapping relation between the service path and the interface and the server is stored in the target mapping relation table.
Step 203, query the target mapping relation table to determine the target interface and the target service server corresponding to the target path.
In actual use, if there are multiple domain names in the HTTP service, a mapping table of mapping relationships between the service path and the interface and the server may be set for each domain name. Then, after the target domain name is obtained, the target mapping relation table corresponding to the target domain name can be obtained firstly, and then the target mapping relation table is only inquired without traversing all the mapping relation tables so as to determine the target interface and the target service server corresponding to the target service path, so that the response speed of the HTTP service is improved.
Optionally, after obtaining the target domain name and the target path, the electronic device may determine a corresponding target mapping relationship according to the target domain name, and determine the target interface and the target service server corresponding to the target path by querying the target mapping relationship.
For example, if the target domain name is: and if the target path is associated with the target path, the electronic device may determine a corresponding target mapping relation table B in a preset mapping relation table according to the target path: and B, querying the target mapping relation table B to obtain a target interface x1 and a target service server y1 corresponding to the/doc.
And step 204, sending the access request to the target service server through the target interface so that the target service server responds to the access request.
According to the HTTP service processing method provided by the embodiment of the application, the target domain name and the target path in the access request are obtained by analyzing the HTTP access request, the target mapping relation table is determined according to the target domain name, so that the target path is utilized, the target mapping relation table is inquired, the target interface and the target service server corresponding to the target path are determined, and the access request is sent to the target service server through the target interface, so that the target service server responds to the access request. Therefore, the service development efficiency can be improved, the domain name and the path information can be deployed in the same access request, the domain name and the server resources are saved, and the resource utilization rate is improved.
As can be seen from the above analysis, in the embodiment of the present application, the corresponding target mapping table is determined through the target domain name in the HTTP access request, so as to query the target mapping table according to the target path, and determine the corresponding target interface and the target service server.
In another implementation scenario of the embodiment of the present application, in order to reduce a risk of data leakage and improve data security, in this embodiment, after a target path in an access request is obtained, a target access processing policy may be further determined, so as to determine whether the access request is legal, thereby avoiding data information from being injected by SQL, cross-domain attack, and the like, so as to improve a capability of a service to defend a network attack, and ensure reliability and quality of the service. The HTTP service processing method according to the embodiment of the present application will be specifically described below with reference to fig. 3.
Fig. 3 is a flowchart illustrating an HTTP service processing method according to still another embodiment of the present application. As shown in fig. 3, the HTTP service processing method according to the embodiment of the present application may include the following steps:
step 301, analyzing the obtained HTTP access request to obtain a target path in the access request.
Step 302, according to the target path, determining a corresponding target access processing policy, a target interface and a target service server.
In this embodiment, the access processing policy includes any one of the following policies: login strategy, monitoring strategy and description language type.
The login strategy is that the access request of the service needs to contain a user name and an identifier, and determines whether the access request is legal or not by determining whether the user name and the identifier are stored in data such as Cookie, if so, the access request is legal, otherwise, the access request is illegal.
For example, when a user a sends an access request to a server through a client to obtain a data resource, the server obtains a user name and identification information from the access request, compares the obtained user name and identification information with data information stored in a Cookie, and if the Cookie has the corresponding user name and identification information, it indicates that the current access request is legal.
The monitoring strategy is to monitor the service requests in real time, and when the number of the service requests exceeds a preset threshold value, the service requests are determined to have security threats.
For example, for a card punching service, company XX has 1 ten thousand employees, and the working time is 9 hours, the time can be set before 9 hours, and within every minute, the request for accessing the service does not exceed 1000, then after receiving the access request, the current request can be judged, which is the second in the time period, and if the access request exceeds 1000, the service can be considered to be attacked, i.e., defense processing can be performed, so as to protect the security of the service.
The description language type may refer to a language type supportable by a service. For example, Standard Generalized Markup Language (SGML), HyperText Markup Language (HTML), Extensible Markup Language (XML), and the like.
Optionally, in this embodiment, a corresponding target access processing policy may be determined in a preset mapping relationship according to the target path; or, it may be determined in other ways, which are not specifically limited herein.
Step 303, determining the access request as a legal request according to the target access processing policy.
Optionally, after determining the target access processing policy corresponding to the target path, the electronic device may determine whether the access request is legal according to the target access processing policy. And then executing corresponding operation according to the determined result. When the access request is determined to be illegal, a notification message can be sent to related personnel to prompt that the current service is abnormal and to prompt for timely processing. And when the access request is determined to be legal, executing subsequent operations correspondingly.
For example, if the target access processing policy includes a login policy, the electronic device may analyze the HTTP access request C according to the login policy, obtain a user name and identification information carried in the access request C, and search in data of a cookie according to the obtained user name and identification information, and if the same user name and identification information are not found, it indicates that the current access request C is illegal. At this time, a notification message such as "query failed" may be sent to the relevant person to remind the relevant person that the current access is abnormal.
That is to say, in this embodiment, by setting the access processing policy, the service can be grasped in real time, so as to ensure the overall quality of the service.
In another optional implementation form of the embodiment of the present application, before sending the access request to the target service server through the target interface, the present application may further determine whether the description language type corresponding to the access request matches the description language of the target service server, and convert the description language type of the access request when the description language type does not match, so that the target service server does not need to perform a language type conversion operation on the access request, and the service processing speed is increased. The following is described in detail with reference to steps 304 to 306.
Step 304, determining whether the type of the first description language corresponding to the access request matches the type of the second description language corresponding to the target service server.
And 305, if the request is not matched with the second description language, converting the access request into the second description language.
For example, if the type of the second description language corresponding to the target service server X2 is HTML and the type of the first description language corresponding to the access request is XML, it is determined that the type of the target service server X2 is not matched with the type of the description language of the access request, and the type of the first description language corresponding to the access request may be converted according to the type HTML of the second description language corresponding to the target service server X2, so that the type XML of the first description language corresponding to the access request is converted into HTML.
Step 306, sending the access request to the target service server through the target interface, so that the target service server responds to the access request.
According to the HTTP service processing method provided by the embodiment of the application, the target access processing strategy is determined according to the target path, whether the access request is legal or not is determined according to the target access processing strategy, and then corresponding processing is executed according to the determination result, so that the service development efficiency can be improved, the safety of data resources can be ensured, the data is prevented from being attacked by a network, and the reliability and quality of the service are improved. In addition, the description language of the access request is converted into the description language type corresponding to the target service server, so that when the target service server processes the access request, the description language type conversion operation is not needed, the service processing time is saved, and the service processing speed is increased.
In order to implement the foregoing embodiments, an HTTP service processing apparatus is further provided in the embodiments of the present application.
Fig. 4 is a schematic structural diagram of an HTTP service processing apparatus according to an embodiment of the present application. As shown in fig. 4, the HTTP service processing apparatus according to the embodiment of the present application includes: the device comprises an acquisition module 11, a determination module 12 and a response module 13.
The obtaining module 11 is configured to analyze the obtained HTTP access request to obtain a target path in the access request;
the determining module 12 is configured to determine a corresponding target interface and a corresponding target service server according to the target path;
the response module 13 is configured to send the access request to the target service server through the target interface, so that the target service server responds to the access request.
Optionally, in an optional implementation manner of the embodiment of the present application, the mail processing apparatus further includes: the device comprises a second acquisition module and a storage module.
The second acquisition module is used for acquiring an HTTP service registration request, wherein the registration request comprises the target service path, a target interface and a target service server;
and the storage module is used for storing the corresponding relation between the target path and the target interface and the target service server.
Optionally, in an optional implementation manner of the embodiment of the present application, the mail processing apparatus further includes: the device comprises a receiving module and a returning module.
The receiving module is used for receiving a response message returned by the target service server through the target interface;
and the return module is used for returning the response message to the client initiating the HTTP access request.
It should be noted that the foregoing explanation of the HTTP service processing method embodiment is also applicable to the HTTP service processing apparatus of the embodiment, and the implementation principle thereof is similar, and is not described herein again.
According to the HTTP service processing apparatus provided in the embodiment of the present application, the HTTP service processing apparatus analyzes the obtained HTTP access request to obtain the target path in the access request, and then determines the corresponding target interface and the target service server according to the target path, so as to send the access request to the target service server through the target interface, so that the target service server responds to the access request. Therefore, by carrying the path information in the access request, the corresponding interface and the service server can be determined according to the path information, and the possibility of deploying a plurality of HTTP sub-services on one HTTP service is provided, so that the HTTP service function can be provided for a plurality of services, the complexity of service development is reduced, the service development time is shortened, and the service development efficiency is improved.
Fig. 5 is a schematic structural diagram of an HTTP service processing apparatus according to another embodiment of the present application.
Referring to fig. 5, the HTTP service processing apparatus according to the embodiment of the present application further includes: the device comprises an acquisition module 11, a determination module 12 and a response module 13.
The obtaining module 11 is configured to analyze the obtained HTTP access request to obtain a target path in the access request;
wherein, the obtained access request also comprises a target domain name;
the determining module 12 is configured to determine a corresponding target interface and a corresponding target service server according to the target path;
the response module 13 is configured to send the access request to the target service server through the target interface, so that the target service server responds to the access request.
Optionally, in an optional implementation manner of the embodiment of the present application, the determining module 12 includes: a first determining subunit 121 and a querying subunit 122.
The first determining subunit 121 is configured to determine a target mapping relationship table according to the target domain name, where the target mapping relationship table stores mapping relationships between service paths and interfaces and servers;
the query subunit 122 is configured to query the target mapping relationship table to determine a target interface and a target service server corresponding to the target path.
It should be noted that, for the implementation process and the technical principle of the HTTP service processing apparatus of this embodiment, reference is made to the foregoing explanation of the HTTP service processing method of the first embodiment, and details are not described here.
The HTTP service processing apparatus provided in the embodiment of the present application obtains a target domain name and a target path in an access request by analyzing an HTTP access request, and determines a target mapping relationship table according to the target domain name, so as to query the target mapping relationship table by using the target path, determine a target interface and a target service server corresponding to the target path, and send the access request to the target service server through the target interface, so that the target service server responds to the access request. Therefore, the service development efficiency can be improved, the domain name and the path information can be deployed in the same access request, the domain name and the server resources are saved, and the resource utilization rate is improved.
Fig. 6 is a schematic structural diagram of an HTTP service processing apparatus according to still another embodiment of the present application.
Referring to fig. 6, an HTTP service processing apparatus according to an embodiment of the present application may include: the device comprises an acquisition module 11, a determination module 12, a response module 13, a second determination module 14 and a third determination module 15.
The obtaining module 11 is configured to analyze the obtained HTTP access request to obtain a target path in the access request;
the determining module 12 is configured to determine a corresponding target interface and a corresponding target service server according to the target path;
the response module 13 is configured to send the access request to the target service server through the target interface, so that the target service server responds to the access request.
Optionally, in an optional implementation manner of the embodiment of the present application, the HTTP service processing apparatus further includes: a second determination module 14 and a third determination module 15.
The second determining module 14 is configured to determine a corresponding target access processing policy according to the target path;
the third determining module 15 is configured to determine that the access request is a legal request according to the target access processing policy.
Optionally, in an optional implementation manner of the embodiment of the present application, the access processing policy includes any one of the following policies: login strategy, monitoring strategy and description language type.
Optionally, in an optional implementation manner of the embodiment of the present application, the HTTP service processing apparatus further includes: a fourth determination module and a conversion module.
The fourth determining module is configured to determine whether the type of the first description language corresponding to the access request matches the type of the second description language corresponding to the target service server;
and the conversion module is used for converting the access request into a second description language if the access request is not matched with the second description language.
It should be noted that, for the implementation process and the technical principle of the HTTP service processing apparatus of this embodiment, reference is made to the foregoing explanation of the HTTP service processing method of the first embodiment, and details are not described here.
According to the HTTP service processing device provided by the embodiment of the application, the target access processing strategy is determined according to the target path, whether the access request is legal or not is determined according to the target access processing strategy, and then corresponding processing is executed according to the determination result, so that the service development efficiency can be improved, the safety of data resources can be ensured, the data is prevented from being attacked by a network, and the reliability and quality of the service are improved. In addition, the description language of the access request is converted into the description language type corresponding to the target service server, so that when the target service server processes the access request, the description language type conversion operation is not needed, the service processing time is saved, and the service processing speed is increased.
In order to implement the above embodiments, an electronic device is further provided in the embodiments of the present application.
Fig. 7 is a schematic structural diagram of an electronic device shown in accordance with an exemplary embodiment of the present application. The electronic device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 7, a schematic diagram of an electronic device 700 suitable for implementing embodiments of the present disclosure is shown. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, PDAs (personal digital assistants), PADs (tablet computers), wearable devices, and the like, and fixed terminals such as desktop computers and the like. The electronic device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 7, electronic device 700 may include a processing means (e.g., central processing unit, graphics processor, etc.) 701 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from storage 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the electronic apparatus 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Generally, the following devices may be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 707 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 708 including, for example, magnetic tape, hard disk, etc.; and a communication device 709. The communication means 709 may allow the electronic device 700 to communicate wirelessly or by wire with other devices to exchange data. While fig. 7 illustrates an electronic device 700 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via the communication means 709, or may be installed from the storage means 708, or may be installed from the ROM 702. The computer program, when executed by the processing device 701, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that, for the implementation process and the technical principle of the electronic device of this embodiment, reference is made to the foregoing explanation of the HTTP service processing method of the embodiment of the first aspect, and details are not described here again.
The electronic device provided by the embodiment of the application analyzes the acquired HTTP access request to acquire a target path in the access request, and then determines a corresponding target interface and a target service server according to the target path to send the access request to the target service server through the target interface, so that the target service server responds to the access request. Therefore, by carrying the path information in the access request, the corresponding interface and the service server can be determined according to the path information, and the possibility of deploying a plurality of HTTP sub-services on one HTTP service is provided, so that the HTTP service function can be provided for a plurality of services, the complexity of service development is reduced, the service development time is shortened, and the service development efficiency is improved.
To achieve the above object, the present application also proposes a computer-readable storage medium.
Wherein the computer readable storage medium has stored thereon a computer program, which when executed by a processor, implements the HTTP service processing method according to the embodiment of the first aspect.
In an alternative implementation, the embodiments may be implemented in any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
To achieve the above object, the present application also proposes a computer program. Wherein the computer program is adapted to implement the HTTP service processing method according to the embodiment of the first aspect when executed by the processor.
In this application, unless expressly stated or limited otherwise, the terms "disposed," "connected," and the like are to be construed broadly and include, for example, mechanical and electrical connections; they may be directly connected or indirectly connected through intervening media, or they may be connected internally or in any other suitable relationship, unless expressly stated otherwise. The specific meaning of the above terms in the present application can be understood by those of ordinary skill in the art as appropriate.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and the scope of the preferred embodiments of the present application includes other implementations in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.

Claims (9)

1. An HTTP service processing method, comprising:
analyzing the acquired HTTP access request to acquire a target path in the access request;
according to the target path, determining a corresponding target interface and a target service server by searching a pre-stored corresponding relation between the target path and the target interface and the target service server;
sending the access request to the target service server through the target interface so that the target service server responds to the access request;
before sending the access request to the target service server through the target interface, the method further includes:
determining whether the type of a first description language corresponding to the access request is matched with the type of a second description language corresponding to the target service server;
and if not, converting the access request into a second description language.
2. The method of claim 1, wherein the obtained access request further includes a target domain name;
the determining of the corresponding target interface and the target service server includes:
determining a target mapping relation table according to the target domain name, wherein the mapping relation among the service path, the interface and the server is stored in the target mapping relation table;
and querying the target mapping relation table to determine a target interface and a target service server corresponding to the target path.
3. The method of claim 1, wherein after obtaining the target path in the access request, further comprising:
determining a corresponding target access processing strategy according to the target path;
before sending the access request to the target service server through the target interface, the method further includes:
and determining the access request as a legal request according to the target access processing strategy.
4. The method of claim 3, wherein the access handling policy comprises any one of: login strategy, monitoring strategy and description language type.
5. The method according to any of claims 1-4, wherein before determining the corresponding target interface and target service server according to the target path, further comprising:
acquiring an HTTP service registration request, wherein the registration request comprises the target service path, a target interface and a target service server;
and storing the corresponding relation between the target path and the target interface and the target service server.
6. The method of any of claims 1-4, wherein after sending the access request to the target service server over the target interface, further comprising:
receiving a response message returned by the target service server through the target interface;
and returning the response message to the client initiating the HTTP access request.
7. An HTTP service processing apparatus, comprising:
the acquisition module is used for analyzing the acquired HTTP access request to acquire a target path in the access request;
the determining module is used for determining a corresponding target interface and a target service server by searching the corresponding relationship between the target path and the target interface and the target service server which are stored in advance according to the target path;
the response module is used for sending the access request to the target business server through the target interface so as to enable the target business server to respond to the access request;
a fourth confirmation module, configured to determine whether a type of the first description language corresponding to the access request matches a type of the second description language corresponding to the target service server before the response module sends the access request to the target service server through the target interface;
and the conversion module is used for converting the access request into a second description language if the access request is not matched with the second description language.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor when executing the program implementing the HTTP service handling method according to any one of claims 1 to 6.
9. A computer-readable storage medium on which a computer program is stored, the program being characterized in that it is executed by a processor to implement the HTTP service processing method according to any one of claims 1 to 6.
CN201811096347.5A 2018-09-19 2018-09-19 HTTP service processing method and device Active CN109040316B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811096347.5A CN109040316B (en) 2018-09-19 2018-09-19 HTTP service processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811096347.5A CN109040316B (en) 2018-09-19 2018-09-19 HTTP service processing method and device

Publications (2)

Publication Number Publication Date
CN109040316A CN109040316A (en) 2018-12-18
CN109040316B true CN109040316B (en) 2021-08-27

Family

ID=64616969

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811096347.5A Active CN109040316B (en) 2018-09-19 2018-09-19 HTTP service processing method and device

Country Status (1)

Country Link
CN (1) CN109040316B (en)

Families Citing this family (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110543340A (en) * 2019-08-09 2019-12-06 北京信安世纪科技股份有限公司 Method, device, equipment and medium for determining password equipment corresponding to interface library
CN110557445A (en) * 2019-08-22 2019-12-10 上海艾融软件股份有限公司 Access request routing method and device, storage medium and electronic equipment
CN110569092A (en) * 2019-09-09 2019-12-13 政采云有限公司 service execution method and device
CN112702368B (en) * 2019-10-22 2023-05-09 贵州白山云科技股份有限公司 Service request processing method and device
CN110691042A (en) * 2019-10-23 2020-01-14 上海艾融软件股份有限公司 Resource allocation method and device
CN111212154B (en) * 2019-12-31 2022-06-21 瑞庭网络技术(上海)有限公司 Service binding method, device, terminal, server and storage medium
CN111352748B (en) * 2020-02-26 2023-12-05 北京思特奇信息技术股份有限公司 Interface calling method and device, electronic equipment and storage medium
CN113452728A (en) * 2020-03-24 2021-09-28 阿里巴巴集团控股有限公司 Request message processing method and device
CN111787102A (en) * 2020-06-30 2020-10-16 北京金山安全软件有限公司 Service processing method and device for multiple application platforms, electronic equipment and storage medium
CN112055053A (en) * 2020-08-06 2020-12-08 北京达佳互联信息技术有限公司 Request processing method, device, server and storage medium
CN111988400B (en) * 2020-08-20 2023-08-22 广州探途网络技术有限公司 Access processing method, application server and electronic equipment
CN112202717B (en) * 2020-09-02 2023-09-05 深信服科技股份有限公司 HTTP request processing method and device, server and storage medium
CN112260988B (en) * 2020-09-16 2021-09-24 厦门网宿有限公司 Abnormal request processing method and device
CN112261047B (en) * 2020-10-22 2023-11-03 上海擎感智能科技有限公司 Gateway access method, mobile terminal and computer storage medium
CN112702319B (en) * 2020-12-11 2023-03-24 杭州安恒信息技术股份有限公司 Access request port standardization method and device, electronic equipment and storage medium
CN112650728A (en) * 2020-12-15 2021-04-13 中国联合网络通信集团有限公司 Interface information storage method and device, server and distributed service system
CN112804373B (en) * 2020-12-30 2022-10-14 微医云(杭州)控股有限公司 Interface domain name determining method and device, electronic equipment and storage medium
CN112839084B (en) * 2021-01-04 2022-06-07 浙江诺诺网络科技有限公司 Service processing method, device, equipment and computer readable storage medium
CN113162998B (en) * 2021-04-07 2022-07-05 广州炫视智能科技有限公司 Intelligent interactive communication method and communication system
CN113992645B (en) * 2021-12-23 2022-03-01 飞狐信息技术(天津)有限公司 Request processing method and device, electronic equipment and storage medium
CN114531350B (en) * 2022-03-18 2023-11-28 深圳市欧瑞博科技股份有限公司 Interface access method, interface access device and electronic equipment
CN117149468A (en) * 2023-10-30 2023-12-01 建信金融科技有限责任公司 Resource access method and device, electronic equipment and computer readable medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7082465B1 (en) * 2001-03-27 2006-07-25 Cisco Technology, Inc. Web based management of host computers in an open protocol network
US7953893B1 (en) * 2008-04-03 2011-05-31 Sprint Spectrum L.P. Method and system for expedited HTTP communication
CN104954415A (en) * 2014-09-24 2015-09-30 腾讯科技(深圳)有限公司 Method and apparatus for carrying out processing on HTTP request
CN105701047A (en) * 2015-12-31 2016-06-22 厦门市美亚柏科信息股份有限公司 Multichannel data transmission and virtual restoration method
CN106354481A (en) * 2015-07-13 2017-01-25 阿里巴巴集团控股有限公司 Method and equipment for uniform mapping of HTTP requests
CN106453536A (en) * 2016-09-29 2017-02-22 车智互联(北京)科技有限公司 Network request processing method and system and server
CN106936651A (en) * 2015-12-29 2017-07-07 华为技术有限公司 The determination method and controller of a kind of data flow
CN107277140A (en) * 2017-06-21 2017-10-20 山东浪潮通软信息科技有限公司 A kind of distribution method of application programming interfaces, route middleware and operation system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102811140B (en) * 2011-05-31 2015-04-08 国际商业机器公司 Method and system for testing browser based application
CN103516785A (en) * 2013-08-19 2014-01-15 上海艾泰网络信息有限公司 Web page proxy system and communication method thereof
CN106331215A (en) * 2016-08-30 2017-01-11 常州化龙网络科技股份有限公司 Data request processing system and processing method
CN106850830B (en) * 2017-02-28 2020-11-20 北京神州绿盟信息安全科技股份有限公司 Service request processing method, device and system and related server
CN107508903B (en) * 2017-09-07 2020-06-16 维沃移动通信有限公司 Webpage content access method and terminal equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7082465B1 (en) * 2001-03-27 2006-07-25 Cisco Technology, Inc. Web based management of host computers in an open protocol network
US7953893B1 (en) * 2008-04-03 2011-05-31 Sprint Spectrum L.P. Method and system for expedited HTTP communication
CN104954415A (en) * 2014-09-24 2015-09-30 腾讯科技(深圳)有限公司 Method and apparatus for carrying out processing on HTTP request
CN106354481A (en) * 2015-07-13 2017-01-25 阿里巴巴集团控股有限公司 Method and equipment for uniform mapping of HTTP requests
CN106936651A (en) * 2015-12-29 2017-07-07 华为技术有限公司 The determination method and controller of a kind of data flow
CN105701047A (en) * 2015-12-31 2016-06-22 厦门市美亚柏科信息股份有限公司 Multichannel data transmission and virtual restoration method
CN106453536A (en) * 2016-09-29 2017-02-22 车智互联(北京)科技有限公司 Network request processing method and system and server
CN107277140A (en) * 2017-06-21 2017-10-20 山东浪潮通软信息科技有限公司 A kind of distribution method of application programming interfaces, route middleware and operation system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"基于http的移动终端和web服务器的通信接口研究";张倩,秦宏等;《通信技术》;20160831;全文 *

Also Published As

Publication number Publication date
CN109040316A (en) 2018-12-18

Similar Documents

Publication Publication Date Title
CN109040316B (en) HTTP service processing method and device
US20140358964A1 (en) Natural language processing (NLP) query formulation engine for a computing device
US9825934B1 (en) Operating system interface for credential management
CN111614624B (en) Risk detection method, device, system and storage medium
CN109992406A (en) The method and client that picture requesting method, response picture are requested
CN105701198B (en) Page verification method and device
CN108880923A (en) The method and apparatus that policer operation applied to application server is requested
CN112015383A (en) Login method and device
US9405933B2 (en) Secure access to running client application features from a browser application
US10469575B2 (en) Techniques for contact exporting
CN113242301A (en) Method and device for selecting real server, computer equipment and storage medium
CN109933508B (en) Method and apparatus for transmitting information
CN116861198A (en) Data processing method, device and storage medium
CN111831503B (en) Monitoring method based on monitoring agent and monitoring agent device
CN113709136B (en) Access request verification method and device
CN105339928A (en) Website server request rerouting
CN113609516A (en) Information generation method and device based on abnormal user, electronic equipment and medium
CN113486749A (en) Image data collection method, device, electronic equipment and computer readable medium
CN110659476A (en) Method and apparatus for resetting password
US20150222505A1 (en) Business transaction resource usage tracking
CN115604041B (en) Security agent method, system, apparatus, computer device, and storage medium
CN110248326A (en) A kind of data processing method and its device
US8738049B1 (en) Converged dialog in hybrid mobile applications
CN113824625B (en) Information interaction method and device
CN113641966B (en) Application integration method, system, equipment and 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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20211126

Address after: Room 201-2031, floor 2, building 1, building 2 and building 3, qinchunjiayuan, Xisanqi, Haidian District, Beijing 100096

Patentee after: Beijing Feishu Technology Co.,Ltd.

Address before: 300000 Tianjin Binhai High-tech Zone Binhai Science Park, No. 39, No. 6 High-tech Road, 9-3-401

Patentee before: TIANJIN BYTEDANCE TECHNOLOGY Co.,Ltd.