CN109635019A - Request processing method, device, equipment and storage medium - Google Patents
Request processing method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN109635019A CN109635019A CN201811246136.5A CN201811246136A CN109635019A CN 109635019 A CN109635019 A CN 109635019A CN 201811246136 A CN201811246136 A CN 201811246136A CN 109635019 A CN109635019 A CN 109635019A
- Authority
- CN
- China
- Prior art keywords
- request
- interface
- call request
- interface call
- path
- 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
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Computer And Data Communications (AREA)
Abstract
The present invention discloses a kind of request processing method, device, equipment and storage medium, this method comprises: receiving interface call request, obtains the corresponding request protocol type of interface call request, and detect whether request protocol type belongs to preset protocol set of types;When request protocol type belongs to preset protocol set of types, the request path for including in interface call request is read;The corresponding business logic objects in search request path in the database, and interface call request is sent to business logic objects, request processing method of the present invention is when receiving any request, first detection requests whether corresponding request protocol type belongs to preset protocol set of types, if then determining the subsequent business logic objects for making requests processing according to the request path for including in request, compared to the request response mode of existing one-to-one mapping, caused response when individual certain protocol data transmission error can be effectively avoided to block, improve request processing fault-tolerance and treatment effeciency.
Description
Technical field
The present invention relates to Internet technical fields more particularly to a kind of request processing method, device, equipment and storage to be situated between
Matter.
Background technique
Currently, with the fast development of Internet technology, the wider Internet enterprises in many service coverage faces can all design
Corresponding Business Management Platform is managed collectively physical/virtual resource relevant to business, service resources.This kind of business
It manages platform and (Representational State Transfer, REST) software architecture is generally transmitted using declarative state
Style realizes that functional institute is provided by REST interface, and associated external system or third party user are by not
Same transportation protocol (such as HTTP or HTTPS) carries out interface calling to the main system where Business Management Platform, corresponding to obtain
Resource.But in fact, the business as involved in associated external system is different, when transmission interface call request, is made
Protocol type mode is also different.For such issues that, platform development personnel be usually using " one-to-one " mapping
Mode guarantees main system to the normal response of all kinds of request calls, but the defect of this mode is in face of high-volume, high
When concurrent and different protocol type call request, treatment effeciency is excessively slow, and data jamming is be easy to cause to cause to respond
Not in time, the risk and unstability of system failure are increased.
Above content is only used to facilitate the understanding of the technical scheme, and is not represented and is recognized that above content is existing skill
Art.
Summary of the invention
The main purpose of the present invention is to provide a kind of request processing method, device, equipment and storage mediums, it is intended to solve
Certainly for the prior art when facing the call request of a large amount of different agreement types, treatment effeciency is excessively slow, responds skill not in time
Art problem.
To achieve the above object, it the present invention provides a kind of request processing method, the described method comprises the following steps:
Receiving interface call request obtains the corresponding request protocol type of the interface call request, and asks described in detection
Ask whether protocol type belongs to preset protocol set of types;
When the request protocol type belongs to the preset protocol set of types, reads in the interface call request and include
Request path;
The corresponding business logic objects of the request path are searched in the database, and the interface call request is sent
To the business logic objects.
Preferably, before described the step of searching the corresponding business logic objects of the request path in the database, institute
State method further include:
Read the interface parameters for including in the request path, according to the service identification for including in the interface parameters and
Interface identifier determines Object Query parameter;
Described the step of searching the corresponding business logic objects of the request path in the database, comprising:
The corresponding business logic objects of the Object Query parameter are searched in the mapping relations of database purchase, it is described to reflect
Penetrate the corresponding relationship stored and had between Object Query parameter and business logic objects in relationship.
Preferably, described to determine that Object Query is joined according to the service identification and interface identifier that include in the interface parameters
Several steps, comprising:
The service identification and interface identifier for including in the interface parameters are read, according to the service logic tree pre-established
The corresponding destination node of service identification described in shape structure lookup;
The corresponding interface path collection of the destination node is obtained, is concentrated really according to the interface identifier from the interface path
Destination path is made, and using the destination path as Object Query parameter.
Preferably, the receiving interface call request obtains the corresponding request protocol type of the interface call request, and
Before detecting the step of whether the request protocol type belongs to preset protocol set of types, the method also includes:
Business object to be sorted is obtained, service logic point is carried out to the business object using towards tangent plane programming technology
Class obtains several business logic objects;
The service identification carried in the business logic objects is read, the business is determined according to the service identification read
Class of service belonging to object logic;
It is father node by child node, the class of service of the corresponding service identification of each business logic objects, establishes business
Logic tree structure.
Preferably, the receiving interface call request obtains the corresponding request protocol type of the interface call request
Step, comprising:
In receiving interface call request, intercept the interface call request, and to the interface call request carry out across
Domain browsing detection;
When detecting that the interface call request belongs to cross-domain access request, it is corresponding to obtain the interface call request
Request protocol type.
Preferably, the receiving interface call request, to the interface call request carry out cross-domain access detection the step of,
Include:
Receiving interface call request obtains the corresponding request path of the interface call request, from the request path
Read domain name field and peer-port field;
Whether identical detect domain name field domain name field corresponding with home domain name, and/or the detection port word
Whether section peer-port field corresponding with local port is identical;
If domain name field domain name field corresponding with home domain name is identical and/or the peer-port field and local
The corresponding peer-port field in port is not identical, then determines that the interface call request belongs to cross-domain access request.
Preferably, the receiving interface call request, to the interface call request carry out cross-domain access detection the step of
Later, the method also includes:
When detecting that the interface call request is not belonging to cross-domain access request, obtains and wrapped in the interface call request
The required parameter and request path contained;
Target interface to be called is determined according to the request path, and the required parameter is sent to the target to be called
The corresponding target service object logic of interface, so that the target service object logic obtains out parameter according to the required parameter
According to and feed back it is described go out parameter evidence.
In addition, to achieve the above object, the present invention also proposes that a kind of request processing unit, described device include:
Request receiving module is used for receiving interface call request, obtains the corresponding request protocol of the interface call request
Type, and detect whether the request protocol type belongs to preset protocol set of types;
Protocol detection module, for when the request protocol type belongs to the preset protocol set of types, described in reading
The request path for including in interface call request;
Object searching module, for searching the corresponding business logic objects of the request path in the database, and by institute
It states interface call request and is sent to the business logic objects.
In addition, to achieve the above object, the present invention also proposes a kind of request processing equipment, the equipment include: memory,
Processor and it is stored in the request handler that can be run on the memory and on the processor, the request handles journey
Sequence is arranged for carrying out the step of request processing method as described above.
In addition, to achieve the above object, the present invention also proposes a kind of storage medium, request is stored on the storage medium
The step of processing routine, the request handler realizes request processing method as described above when being executed by processor.
The present invention obtains the corresponding request protocol type of interface call request by receiving interface call request, and detects
Whether request protocol type belongs to preset protocol set of types;When request protocol type belongs to preset protocol set of types, reading is connect
The request path for including in mouth call request;The corresponding business logic objects in search request path in the database, and by interface
Call request is sent to business logic objects, and request processing method of the present invention is when receiving any request, first detection request pair
Whether the request protocol type answered belongs to preset protocol set of types, if after then being determined according to the request path for including in request
The continuous business logic objects for making requests processing can effectively be kept away compared to the request response mode of existing one-to-one mapping
Exempt from caused response obstruction when individual certain protocol data transmission error, improves request processing fault-tolerance and processing effect
Rate.
Detailed description of the invention
Fig. 1 is the structural schematic diagram of the request processing equipment for the hardware running environment that the embodiment of the present invention is related to;
Fig. 2 is the flow diagram of request processing method first embodiment of the present invention;
Fig. 3 is the flow diagram of request processing method second embodiment of the present invention;
Fig. 4 is service logic tree structure schematic diagram in request processing method second embodiment of the present invention;
Fig. 5 is the flow diagram of request processing method 3rd embodiment of the present invention;
Fig. 6 is the structural block diagram of present invention request processing unit first embodiment.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that described herein, specific examples are only used to explain the present invention, is not intended to limit the present invention.
Referring to Fig.1, Fig. 1 is the request processing equipment structural representation for the hardware running environment that the embodiment of the present invention is related to
Figure.
As shown in Figure 1, the request processing equipment may include: processor 1001, such as central processing unit (Central
Processing Unit, CPU), communication bus 1002, user interface 1003, network interface 1004, memory 1005.Wherein,
Communication bus 1002 is for realizing the connection communication between these components.User interface 1003 may include display screen
(Display), input unit such as keyboard (Keyboard), optional user interface 1003 can also include that the wired of standard connects
Mouth, wireless interface.Network interface 1004 optionally may include standard wireline interface and wireless interface (such as Wireless Fidelity
(WIreless-FIdelity, WI-FI) interface).Memory 1005 can be the random access memory (Random of high speed
Access Memory, RAM) memory, be also possible to stable nonvolatile memory (Non-Volatile Memory,
), such as magnetic disk storage NVM.Memory 1005 optionally can also be the storage device independently of aforementioned processor 1001.
It will be understood by those skilled in the art that structure shown in Fig. 1 does not constitute the restriction to request processing equipment, it can
To include perhaps combining certain components or different component layouts than illustrating more or fewer components.
As shown in Figure 1, as may include operating system, data storage mould in a kind of memory 1005 of storage medium
Block, network communication module, Subscriber Interface Module SIM and request handler.
In request processing equipment shown in Fig. 1, network interface 1004 is mainly used for logical with network server progress data
Letter;User interface 1003 is mainly used for carrying out data interaction with user;The present invention request processing equipment in processor 1001, deposit
Reservoir 1005 can be set in request processing equipment, and the request processing equipment calls memory 1005 by processor 1001
The request handler of middle storage, and execute request processing method provided in an embodiment of the present invention.
It is request processing method of the present invention the referring to Fig. 2, Fig. 2 the embodiment of the invention provides a kind of request processing method
The flow diagram of one embodiment.
In the present embodiment, the request processing method the following steps are included:
Step S10: receiving interface call request obtains the corresponding request protocol type of the interface call request, and examines
Survey whether the request protocol type belongs to preset protocol set of types;
It is sent out it should be noted that the executing subject of the present embodiment method can be the response external system that is used for developed in advance
The main system for the call request sent, the main system can be a kind of channel of external output data, and output object is to be connected thereto
Third party's external system or interconnected system.
It should be understood that the request protocol type can be the corresponding network transmission protocol of interface call request or transmission
The protocol type of agreement, in the present embodiment, the request protocol type includes but is not limited to: hypertext transfer protocol
(HyperText Transfer Protocol, HTTP), for the hypertext transfer protocol (HyperText of safety data transmission
Transfer Protocol over Secure Socket Layer, HTTPS), Enterprise Service Bus (Enterprise
Service Bus, ESB), (Enterprise JavaBean, one kind are multiple using journey for developing enterprise component-based by EJB
The standard of sequence) etc..
In addition, before executing this step, developer can be different according to the standard or principle of all kinds of agreements, by standard or
The same or similar transportation protocol of principle is classified as one kind, for example, can be unified by the agreement of HTTP, HTTPS type in the present embodiment
It is classified as HTTP class and constructs the preset protocol set of types;It is the agreement (example of object mapping principle by consensus standard or principle
Such as, ESB agreement, EJB agreement) it is classified as another kind of and establishes second protocol set of types, so that main system is receiving respectively
When class is requested, can first agreement be intercepted and be shunted according to the difference of request protocol type, then to the request after shunting
The distribution for making requests object avoids caused response obstruction when the data loading error occurring of a certain agreement, improves request
Handle fault-tolerance and treatment effeciency.
In the concrete realization, main system is when receiving the interface call request that a certain interconnected system is sent, to the interface
Call request is parsed, and then according to the corresponding request protocol type of parsing result acquisition request, then detects the request association
It discusses whether type is to belong to the preset protocol set of types, thens follow the steps S20 if belonging to, if being not belonging to, be determined as second
Protocol type collection simultaneously executes the corresponding request response operation of the preset second protocol set of types.
Step S20: it when the request protocol type belongs to the preset protocol set of types, reads the interface calling and asks
The request path for including in asking;
It should be understood that the request path can be the uniform resource locator for including in interface call request
(Uniform Resource Locator, URL), such as: request path described in this step is htt ps: //
www.xxx.xx/sysName/productName/mehodName/interfaceName/[...].It can wrap in request path
Interface identifier " interfaceName " and the corresponding service identification " sysName/ of interface to be called containing interface to be called
ProductName/methodName ", such as " sysName " are insuran ce (insurance) or bank (bank);
" productName " is " Life Insurance " (life insurance) or " Property Insurance " (producing danger);
" methodName " is " Property Insurance Detail s " (producing dangerous details) etc., and in the actual process, main system can
The business logic objects responded to the interface call request are determined according to the request path for including in interface call request.
It should be noted that developer can be corresponding by the preset protocol set of types in advance before executing this step
The setting of gateway interface match pattern are as follows: fuzzy, variable length matching carries out preliminary screening to the request received;So-called mould
Paste, i.e., the required parameter carried to interface call request are not specifically limited, can also as long as which kind of parameter main system no matter be passed to
Normal externally offer service can respond request;The variable length matching, i.e. variable length parameter match, the variable length
Parameter is a kind of parameter sets, and the quantity of parameter is uncertain in set, may be one or more, it is also possible to not have
Parameter;Each parameter type in this parameter sets be it is uncertain, the form of expression is generally as in above-mentioned request path
" [...] " shown in.
In the concrete realization, main system is detecting that the corresponding request protocol type of interface call request belongs to preset protocol
When set of types, the request path for including in interface call request is read.
Further, in this embodiment if main system is detecting that the corresponding request protocol type of interface call request do not belong to
When the preset protocol set of types, determine that the request protocol type belongs to second protocol set of types, and by the interface tune
Default common protocol management module is mapped to request, so that the common protocol management module is wrapped according in interface call request
Request is directly distributed to corresponding business logic objects by the interface identifier (such as interface name, interface index) contained, by business
Object logic handles request.
Step S30: the corresponding business logic objects of the request path are searched in the database, and the interface is called
Request is sent to the business logic objects.
It should be understood that the business logic objects can be the difference that developer is related to according to third party's external system
The operation flow of business and the service logic class write, so-called class, i.e. Object-oriented Programming Design (OOP, Object-
Oriented Programming) realize Information encapsulation basis, a kind of user defined type, also referred to as Class Type, each class packet
Illustrate with one group of operation data or transmit the function of message containing data, the example of class is known as object.The business logic objects can
To obtain the corresponding evidence of parameter out according to the required parameter carried in request path and feed back to request originator.
It should be noted that developer will can first be directed to third party's external system or association before executing this step
Business logic codes/object that system is write is classified according to the difference of type of service, such as according to bank, insurance, interconnection
The types of service such as net, investment are classified all for the code that third party's external system is write, and are then patrolled sorted
Code/object is collected to be layered.For example, the corresponding business logic objects of insurance business can be divided into life insurance, endowment insurance and production
The object logics such as danger, the method (method) or function for including in each logic of class object can also be according to interface attributes or definition
Difference continue to divide, carry additionally automatically comprising producing danger for example, producing in dangerous object logic and asset search interface and produce dangerous details
Interface, and producing danger and carrying additionally automatically can be divided into asset search interface: it produces dangerous carry additionally automatically and is normally provided with asset search interface-
It is sky that production inquiry, production danger, which are carried additionally automatically with asset search interface-clientNo, produces dangerous carry additionally automatically and asset search interface-
PartyNo is sky, dangerous carried additionally automatically with asset search interface-serviceId of production is sky etc..
In the concrete realization, it after the request path that main system includes in getting interface call request, can be stored with
The corresponding business logic objects of the request path are searched in the database of business logic objects, then send out interface call request
It send to the business logic objects found, interface call request is responded by it.
The present embodiment obtains the corresponding request protocol type of interface call request by receiving interface call request, and examines
Survey whether request protocol type belongs to preset protocol set of types;When request protocol type belongs to preset protocol set of types, read
The request path for including in interface call request;The corresponding business logic objects in search request path in the database, and will connect
Mouth call request is sent to business logic objects, and request processing method provided in this embodiment is when receiving any request, first
Detection requests whether corresponding request protocol type belongs to preset protocol set of types, if then according to the request road for including in request
Diameter determines the subsequent business logic objects for making requests processing, compared to the request response mode of existing one-to-one mapping,
Caused response obstruction when can effectively avoid individual certain protocol data transmission error, improve request handle fault-tolerance with
And treatment effeciency.
With reference to Fig. 3, Fig. 3 is the flow diagram of request processing method second embodiment of the present invention.
Based on above-mentioned first embodiment, the present embodiment request processing method, before the step S30 further include:
Step S201: reading the interface parameters for including in the request path, according to the industry for including in the interface parameters
Business mark and interface identifier determine Object Query parameter;
It should be understood that the interface parameters can be virtual directory part and/or file names portion in request path
Corresponding data, such as "/sysName/productName/mehodName/interfaceName/ [...] ";The business
Mark can be the service feature information that can distinguish different business, for example, "/sysName/productName/ "
Business Name/project name or business number/project number, the interface identifier, which can be, to carry out different interfaces
The interface characteristics information of differentiation, for example, "/i nterfaceName/ " interface name, interface index etc..
In the concrete realization, the service identification and interface identifier for including in the interface parameters, root can be read in main system
The corresponding destination node of the service identification is searched according to the service logic tree structure pre-established;Obtain the destination node pair
The interface path collection answered determines destination path from interface path concentration according to the interface identifier, and by the target
Path is as Object Query parameter.
Wherein, the inquiry foundation of the Object Query parameter, that is, business logic objects, the service logic tree structure can
Being constructed according to the business characteristic and type of service of different business, the data structure with hierarchical relationship, the present embodiment
Service logic tree structure can be as shown in figure 4, Fig. 4 be the tree-like knot of service logic in request processing method second embodiment of the present invention
Structure schematic diagram.
In service logic tree structure shown in Fig. 4, total business is root node;Bank, insurance, internet and investment etc.
For father node, every one kind father node may include one or more child nodes such as " orange bank produces danger, life insurance " again, certainly
Leaf node or terminal node where father node or child node in the present embodiment are also possible in branch.
In practical applications, developer can connect accordingly for leaf node (terminal node) configuration in tree structure
The corresponding leaf node of mouth path set, for example, father node " producing danger " " producing danger to carry additionally automatically and asset search interface " configures corresponding
Interface path collection produce danger carry additionally automatically with the inquiry of asset search interface-normal assets, produce danger and carry additionally automatically and asset search
Interface-clientNo be it is empty, produce danger carry additionally automatically with asset search interface-partyNo be it is empty, produce danger and carry additionally automatically and looked into assets
It is empty or null that it is empty for, which asking interface-serviceId ..., which produces danger and carried additionally automatically with asset search interface-assets return value, } so that
Main system can determine destination path according to the interface identifier for including in interface parameters from path set, and by the destination path
As Object Query parameter.
Correspondingly, step S30 described in the present embodiment, may particularly include:
Step S30 ': the corresponding service logic pair of the Object Query parameter is searched in the mapping relations of database purchase
As the interface call request is sent to the business logic objects.
It should be understood that improve request response efficiency, developer can pre-establish an object in main system and look into
Ask the corresponding relationship between parameter and business logic objects, i.e., the described mapping relations, so that main system is determining Object Query
After parameter, the quick determination to business logic objects is realized.
Further, the present embodiment request processing method is before the step S10, further includes:
Step: obtaining business object to be sorted, carries out business to the business object using towards tangent plane programming technology
Logical division obtains several business logic objects;
It should be noted that the business object can be the business write for third party's external system or interconnected system
Logical code/object, it is described towards tangent plane programming (Aspect Oriented Programming, AOP) technology, it can be used to
The various pieces of service logic are isolated, so that the degree of coupling between service logic each section reduces, the present embodiment
Middle main system can carry out service logic classification to business object according to different classs of service by AOP technology, obtain several
Business logic objects.
Step: reading the service identification carried in the business logic objects, determines institute according to the service identification read
State class of service belonging to business logic objects;
It will be appreciated that after getting business logic objects, main system can be read to be carried in each business logic objects
Service identification, such as Business Name, number etc., then according to the service identification read determine business logic objects belonging to industry
Business classification, as can determine business belonging to the business logic objects according to the service identification " producing danger " carried in business logic objects
Classification is " insurance ".
Step: being father node by child node, the class of service of the corresponding service identification of each business logic objects, establishes
Service logic tree structure.
In the concrete realization, main system can the corresponding service identification of each business logic objects (such as " producing danger ", " longevity
Danger ") be child node, the class of service (such as insure) is that father node establishes service logic tree structure, so as to subsequent basis
The service logic attribute structure obtains the corresponding interface path collection of interface call request, further increases the treatment effeciency of request.
The present embodiment passes through the interface parameters for including in read requests path, according to the service identification for including in interface parameters
And interface identifier determines Object Query parameter, and the corresponding industry of Object Query parameter is searched in the mapping relations of database purchase
Business object logic, is sent to business logic objects for interface call request, can be realized the accurate lookup to business logic objects,
Further increase request treatment effeciency.
With reference to Fig. 5, Fig. 5 is the flow diagram of request processing method 3rd embodiment of the present invention.
Based on the various embodiments described above, in the present embodiment, the step S10 be may particularly include:
Step S101: in receiving interface call request, the interface call request is intercepted, and ask to interface calling
It asks and carries out cross-domain access detection;
It should be understood that the interface call request that main system receives may be by third party's external system in practical application
It sends, it is also possible to be sent by the corresponding front-end application of main system or subsystem, in the present embodiment, for the letter for guaranteeing main system
Safety and structure safety are ceased, main system all will carry out cross-domain access detection to request when receiving any request, to guarantee to ask
Ask the safety of processing.Under normal conditions, when two domain agreements having the same (such as HTTP), identical port (such as 80), phase
Same host (such as www.***.com), then it is assumed that they are identical domains (i.e. agreement, domain name, port all must be identical).
In the concrete realization, main system can receive interface call request, obtain the corresponding request of the interface call request
Domain name field and peer-port field are read in path from the request path;It is corresponding with home domain name to detect domain name field
Domain name field it is whether identical, and/or whether detection peer-port field peer-port field corresponding with local port identical;If institute
It states domain name field and the corresponding domain name field of home domain name is identical and/or peer-port field end corresponding with local port
Mouth field is not identical, then determines that the interface call request belongs to cross-domain access request.
It should be understood that it is several to generally comprise agreement, domain name, port, virtual directory, filename, anchor and parameter in the address URL
A part, domain name field described in the present embodiment, i.e., the corresponding character data of domain name part in the address URL;The peer-port field
It is located at the character data after domain name field i.e. in the address URL, uses ": " as separator between domain name and port.In addition, port
It is not the necessary part URL, if omitting port section, default port will be used.
It will be appreciated that the home domain name can be the corresponding the machine domain name of main system, which can be by exploit person
Member is configured according to the address the corresponding network protocol of main system (Internet Protocol, IP);The local port can be with
It is that developer is preset, for detecting cross-domain access main system local port.
Step S102: it when detecting that the interface call request belongs to cross-domain access request, obtains the interface and calls
Request corresponding request protocol type.
In the concrete realization, main system connects described in acquisition when detecting that interface call request belongs to cross-domain access request
The corresponding request protocol type (such as HTTP, HTTPS etc.) of mouth call request, then detects whether the request protocol type belongs to
In preset protocol set of types.
Further, in the present embodiment, if main system is detecting that the interface call request is not belonging to cross-domain access
When request, the required parameter and request path for including in the interface call request are obtained;According to the request path determine to
The required parameter is sent to the corresponding target service object logic of the target interface to be called by invocation target interface, with
So that the target service object logic is obtained out parameter evidence according to the required parameter and feeds back the parameter evidence out.
It should be noted that the required parameter, which can be the input parameter carried in interface call request, (enters parameter
According to), business logic objects can obtain corresponding output parameter (going out parameter evidence) according to the input parameter, and this is gone out parameter evidence
Feed back to request originator.
The present embodiment is asked by receiving interface call request, intercepting the interface call request, and to interface calling
It asks and carries out cross-domain access detection, when detecting that interface call request belongs to cross-domain access request, obtain interface call request pair
The request protocol type answered, the present embodiment can guarantee the letter of main system by carrying out cross-domain access detection to the request received
Safety and structure safety are ceased, ensure that the stability of main system.
In addition, the embodiment of the present invention also proposes a kind of storage medium, it is stored with request handler on the storage medium,
The request handler realizes the step of request processing method as described above when being executed by processor.
It is the structural block diagram of present invention request processing unit first embodiment referring to Fig. 6, Fig. 6.
As shown in fig. 6, the request processing unit that the embodiment of the present invention proposes includes:
Request receiving module 501 is used for receiving interface call request, obtains the corresponding request association of the interface call request
Type is discussed, and detects whether the request protocol type belongs to preset protocol set of types;
Protocol detection module 502, for reading institute when the request protocol type belongs to the preset protocol set of types
State the request path for including in interface call request;
Object searching module 503, for searching the corresponding business logic objects of the request path in the database, and will
The interface call request is sent to the business logic objects.
The present embodiment obtains the corresponding request protocol type of interface call request by receiving interface call request, and examines
Survey whether request protocol type belongs to preset protocol set of types;When request protocol type belongs to preset protocol set of types, read
The request path for including in interface call request;The corresponding business logic objects in search request path in the database, and will connect
Mouth call request is sent to business logic objects, and request processing method provided in this embodiment is when receiving any request, first
Detection requests whether corresponding request protocol type belongs to preset protocol set of types, if then according to the request road for including in request
Diameter determines the subsequent business logic objects for making requests processing, compared to the request response mode of existing one-to-one mapping,
Caused response obstruction when can effectively avoid individual certain protocol data transmission error, improve request handle fault-tolerance with
And treatment effeciency.
Based on the above-mentioned request processing unit first embodiment of the present invention, propose that the second of request processing unit of the present invention is implemented
Example.
In the present embodiment, the request processing unit further includes parameter determination module, for reading the request path
In include interface parameters, according to the service identification and interface identifier that include in the interface parameters determine Object Query join
Number;Correspondingly, the object searching module 503 is also used to search the Object Query in the mapping relations of database purchase
The corresponding business logic objects of parameter, storage has pair between Object Query parameter and business logic objects in the mapping relations
It should be related to.
Further, the parameter determination module, be also used to read the service identification in the interface parameters included and
Interface identifier searches the corresponding destination node of the service identification according to the service logic tree structure pre-established;Obtain institute
The corresponding interface path collection of destination node is stated, destination path is determined from interface path concentration according to the interface identifier,
And using the destination path as Object Query parameter.
Further, in this embodiment the request processing unit further include: tree structure module, it is to be sorted for obtaining
Business object, using towards tangent plane programming technology to the business object carry out service logic classification, obtain several business
Object logic;The service identification carried in the business logic objects is read, the industry is determined according to the service identification read
Class of service belonging to business object logic;Using the corresponding service identification of each business logic objects as child node, the class of service
For father node, service logic tree structure is established.
Further, request receiving module 501 are also used in receiving interface call request, are intercepted the interface and are called
Request, and cross-domain access detection is carried out to the interface call request;Detecting that the interface call request belongs to cross-domain visit
When asking request, the corresponding request protocol type of the interface call request is obtained.
Further, request receiving module 501 are also used to receiving interface call request, obtain the interface call request
Corresponding request path reads domain name field and peer-port field from the request path;Detect domain name field and this
Whether the corresponding domain name field of region name is identical, and/or detection peer-port field peer-port field corresponding with local port is
It is no identical;If domain name field domain name field corresponding with home domain name is identical and/or the peer-port field and local side
The corresponding peer-port field of mouth is not identical, then determines that the interface call request belongs to cross-domain access request.
Further, the object searching module 503 is also used to detecting that it is cross-domain that the interface call request is not belonging to
When access request, the required parameter and request path for including in the interface call request are obtained;It is true according to the request path
Fixed target interface to be called, is sent to the corresponding target service logic pair of the target interface to be called for the required parameter
As so that the target service object logic obtains out parameter evidence according to the required parameter and feeds back the parameter evidence out.
The present invention requests the other embodiments of processing unit or specific implementation to can refer to above-mentioned each method embodiment, this
Place repeats no more.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row
His property includes, so that the process, method, article or the system that include a series of elements not only include those elements, and
And further include other elements that are not explicitly listed, or further include for this process, method, article or system institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do
There is also other identical elements in the process, method of element, article or system.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in a storage medium
In (such as read-only memory/random access memory, magnetic disk, CD), including some instructions are used so that a terminal device (can
To be mobile phone, computer, server, air conditioner or the network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair
Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills
Art field, is included within the scope of the present invention.
Claims (10)
1. a kind of request processing method, which is characterized in that the described method includes:
Receiving interface call request obtains the corresponding request protocol type of the interface call request, and detects the request association
Whether view type belongs to preset protocol set of types;
When the request protocol type belongs to the preset protocol set of types, asking of including in the interface call request is read
Ask path;
The corresponding business logic objects of the request path are searched in the database, and the interface call request is sent to institute
State business logic objects.
2. the method as described in claim 1, which is characterized in that described to search the corresponding industry of the request path in the database
Before the step of business object logic, the method also includes:
The interface parameters for including in the request path is read, according to the service identification and interface for including in the interface parameters
It identifies and determines Object Query parameter;
Described the step of searching the corresponding business logic objects of the request path in the database, comprising:
The corresponding business logic objects of the Object Query parameter are searched in the mapping relations of database purchase, the mapping is closed
Storage has the corresponding relationship between Object Query parameter and business logic objects in system.
3. method according to claim 2, which is characterized in that it is described according to the service identification for including in the interface parameters with
And interface identifier determines the step of Object Query parameter, comprising:
The service identification and interface identifier for including in the interface parameters are read, according to the tree-like knot of the service logic pre-established
Structure searches the corresponding destination node of the service identification;
The corresponding interface path collection of the destination node is obtained, is determined according to the interface identifier from interface path concentration
Destination path, and using the destination path as Object Query parameter.
4. method as claimed in claim 3, which is characterized in that the receiving interface call request obtains the interface and calls
Request corresponding request protocol type, and detect the step of whether the request protocol type belongs to preset protocol set of types it
Before, the method also includes:
Business object to be sorted is obtained, service logic classification is carried out to the business object using towards tangent plane programming technology,
Obtain several business logic objects;
The service identification carried in the business logic objects is read, the service logic is determined according to the service identification read
Class of service belonging to object;
It is father node by child node, the class of service of the corresponding service identification of each business logic objects, establishes service logic
Tree structure.
5. such as the described in any item methods of Claims 1-4, which is characterized in that the receiving interface call request, described in acquisition
The step of interface call request corresponding request protocol type, comprising:
In receiving interface call request, the interface call request is intercepted, and cross-domain visit is carried out to the interface call request
Ask detection;
When detecting that the interface call request belongs to cross-domain access request, the corresponding request of the interface call request is obtained
Protocol type.
6. method as claimed in claim 5, which is characterized in that interface calling is asked in the receiving interface call request
Ask the step of carrying out cross-domain access detection, comprising:
Receiving interface call request obtains the corresponding request path of the interface call request, reads from the request path
Domain name field and peer-port field;
Whether identical detect corresponding with the home domain name domain name field of domain name field, and/or the detection peer-port field and
Whether the corresponding peer-port field of local port is identical;
If domain name field domain name field corresponding with home domain name is identical and/or the peer-port field and local port
Corresponding peer-port field is not identical, then determines that the interface call request belongs to cross-domain access request.
7. method as claimed in claim 5, which is characterized in that interface calling is asked in the receiving interface call request
After asking the step of carrying out cross-domain access detection, the method also includes:
When detecting that the interface call request is not belonging to cross-domain access request, obtains in the interface call request and include
Required parameter and request path;
Target interface to be called is determined according to the request path, and the required parameter is sent to the target interface to be called
Corresponding target service object logic, so that the target service object logic obtains out parameter according to simultaneously according to the required parameter
The feedback parameter evidence out.
8. a kind of request processing unit, which is characterized in that described device includes:
Request receiving module is used for receiving interface call request, obtains the corresponding request protocol type of the interface call request,
And detect whether the request protocol type belongs to preset protocol set of types;
Protocol detection module, for reading the interface when the request protocol type belongs to the preset protocol set of types
The request path for including in call request;
Object searching module connects for searching the corresponding business logic objects of the request path in the database, and by described
Mouth call request is sent to the business logic objects.
9. a kind of request processing equipment, which is characterized in that the equipment includes: memory, processor and is stored in the storage
On device and the request handler that can run on the processor, the request handler are arranged for carrying out such as claim
The step of request processing method described in any one of 1 to 7.
10. a kind of storage medium, which is characterized in that be stored with request handler, the request processing on the storage medium
The step of request processing method as described in any one of claim 1 to 7 is realized when program is executed by processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811246136.5A CN109635019B (en) | 2018-10-23 | 2018-10-23 | Request processing method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811246136.5A CN109635019B (en) | 2018-10-23 | 2018-10-23 | Request processing method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109635019A true CN109635019A (en) | 2019-04-16 |
CN109635019B CN109635019B (en) | 2023-08-22 |
Family
ID=66066645
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811246136.5A Active CN109635019B (en) | 2018-10-23 | 2018-10-23 | Request processing method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109635019B (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110099122A (en) * | 2019-05-07 | 2019-08-06 | 北京字节跳动网络技术有限公司 | Method and apparatus for sending network request |
CN110298650A (en) * | 2019-05-21 | 2019-10-01 | 深圳壹账通智能科技有限公司 | Interface calls charging method, device, equipment and storage medium |
CN111045750A (en) * | 2019-12-19 | 2020-04-21 | 飞天诚信科技股份有限公司 | Method for automatically matching application programs on multi-application equipment and electronic equipment |
CN112351059A (en) * | 2020-07-30 | 2021-02-09 | 中兴通讯股份有限公司 | Request processing method and device, electronic equipment and computer-readable storage medium |
CN112950370A (en) * | 2021-02-25 | 2021-06-11 | 未鲲(上海)科技服务有限公司 | Service processing method, device, equipment and storage medium |
CN113079198A (en) * | 2021-03-18 | 2021-07-06 | 青岛海信智慧生活科技股份有限公司 | Method and device for converting cloud platform interface protocol |
CN113722621A (en) * | 2021-08-30 | 2021-11-30 | 康键信息技术(深圳)有限公司 | Service processing method, device and storage medium based on URL |
CN114095585A (en) * | 2022-01-21 | 2022-02-25 | 武汉中科通达高新技术股份有限公司 | Data transmission method, device, storage medium and electronic equipment |
CN114297219A (en) * | 2021-09-15 | 2022-04-08 | 湖北中科网络科技股份有限公司 | Multi-service query processing method for quickly realizing data cross-domain |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101286845A (en) * | 2008-05-12 | 2008-10-15 | 华中科技大学 | Control system for access between domains based on roles |
CN101673272A (en) * | 2008-09-08 | 2010-03-17 | 华为技术有限公司 | Method, system and device for searching information and method for registering vertical search engine |
US20130166595A1 (en) * | 2004-08-25 | 2013-06-27 | Deneb Meketa | System and method for controlling access to files |
CN105488172A (en) * | 2015-11-30 | 2016-04-13 | 北京奇艺世纪科技有限公司 | Location-based data query method and device |
CN106790206A (en) * | 2017-01-05 | 2017-05-31 | 厦门中控生物识别信息技术有限公司 | The protocol analysis method and device of operation system |
CN107835226A (en) * | 2017-09-27 | 2018-03-23 | 五八有限公司 | The HTTP interface processing method and processing device of application program |
-
2018
- 2018-10-23 CN CN201811246136.5A patent/CN109635019B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130166595A1 (en) * | 2004-08-25 | 2013-06-27 | Deneb Meketa | System and method for controlling access to files |
CN101286845A (en) * | 2008-05-12 | 2008-10-15 | 华中科技大学 | Control system for access between domains based on roles |
CN101673272A (en) * | 2008-09-08 | 2010-03-17 | 华为技术有限公司 | Method, system and device for searching information and method for registering vertical search engine |
CN105488172A (en) * | 2015-11-30 | 2016-04-13 | 北京奇艺世纪科技有限公司 | Location-based data query method and device |
CN106790206A (en) * | 2017-01-05 | 2017-05-31 | 厦门中控生物识别信息技术有限公司 | The protocol analysis method and device of operation system |
CN107835226A (en) * | 2017-09-27 | 2018-03-23 | 五八有限公司 | The HTTP interface processing method and processing device of application program |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110099122B (en) * | 2019-05-07 | 2020-05-15 | 北京字节跳动网络技术有限公司 | Method and apparatus for sending network request |
CN110099122A (en) * | 2019-05-07 | 2019-08-06 | 北京字节跳动网络技术有限公司 | Method and apparatus for sending network request |
CN110298650A (en) * | 2019-05-21 | 2019-10-01 | 深圳壹账通智能科技有限公司 | Interface calls charging method, device, equipment and storage medium |
CN111045750A (en) * | 2019-12-19 | 2020-04-21 | 飞天诚信科技股份有限公司 | Method for automatically matching application programs on multi-application equipment and electronic equipment |
CN112351059B (en) * | 2020-07-30 | 2021-09-10 | 中兴通讯股份有限公司 | Request processing method and device, electronic equipment and computer-readable storage medium |
CN112351059A (en) * | 2020-07-30 | 2021-02-09 | 中兴通讯股份有限公司 | Request processing method and device, electronic equipment and computer-readable storage medium |
CN112950370A (en) * | 2021-02-25 | 2021-06-11 | 未鲲(上海)科技服务有限公司 | Service processing method, device, equipment and storage medium |
CN113079198A (en) * | 2021-03-18 | 2021-07-06 | 青岛海信智慧生活科技股份有限公司 | Method and device for converting cloud platform interface protocol |
CN113722621A (en) * | 2021-08-30 | 2021-11-30 | 康键信息技术(深圳)有限公司 | Service processing method, device and storage medium based on URL |
CN113722621B (en) * | 2021-08-30 | 2023-11-14 | 康键信息技术(深圳)有限公司 | URL-based service processing method, equipment and storage medium |
CN114297219A (en) * | 2021-09-15 | 2022-04-08 | 湖北中科网络科技股份有限公司 | Multi-service query processing method for quickly realizing data cross-domain |
CN114297219B (en) * | 2021-09-15 | 2024-04-26 | 湖北中科网络科技股份有限公司 | Multi-service query processing method for rapidly realizing data cross-domain |
CN114095585A (en) * | 2022-01-21 | 2022-02-25 | 武汉中科通达高新技术股份有限公司 | Data transmission method, device, storage medium and electronic equipment |
CN114095585B (en) * | 2022-01-21 | 2022-05-20 | 武汉中科通达高新技术股份有限公司 | Data transmission method, device, storage medium and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN109635019B (en) | 2023-08-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109635019A (en) | Request processing method, device, equipment and storage medium | |
US11677812B2 (en) | Lightweight IoT information model | |
CN102741845B (en) | URL reputation system | |
KR101362469B1 (en) | Adaptive gateway for switching transactions and data on unreliable networks using context-based rules | |
US20180089249A1 (en) | Remote policy validation for managing distributed system resources | |
US10454786B2 (en) | Multi-party updates to distributed systems | |
CN104699718A (en) | Method and device for rapidly introducing business data | |
US8332524B2 (en) | Information on demand process framework to generate, manage, secure, and deploy browsers and application accessible web services | |
TWI658418B (en) | Business implementation method, device and system of financial information exchange (FIX) protocol | |
US20200236168A1 (en) | Decentralized data flow valuation and deployment | |
WO2002091107A2 (en) | System and method for determining relevancy of query responses in a distributed network search mechanism | |
CN104322010A (en) | Systems and methods for comparing configuration files and generating corrective commands | |
WO2002091238A2 (en) | System and method for resolving distributed network search queries to information providers | |
WO2002091243A2 (en) | Method and system of routing messages in a distributed search network | |
US10397051B1 (en) | Configuration and testing of network-based service platform resources using a service platform specific language | |
CN113301116A (en) | Cross-network communication method, device, system and equipment for microservice application | |
CN113079198B (en) | Method and device for converting cloud platform interface protocol | |
US10182104B1 (en) | Automatic propagation of resource attributes in a provider network according to propagation criteria | |
CN115544548A (en) | Internet financial wind control incoming system interface field checking and managing system and method | |
CN111782428B (en) | Data calling system and method | |
US11100454B1 (en) | CDD with heuristics for automated variable use-case based constrained logistics route optimization | |
CN114866416A (en) | Multi-cluster unified management system and deployment method | |
CN113869982A (en) | Product recommendation system | |
KR101040891B1 (en) | System for Providing of Complex Service in Wireless Internet | |
US20140025632A1 (en) | Computer implemented systems and methods to augment data from data sources by simultaneously adding enhancements generated by different technologies |
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 |