CN112104640A - Data processing method, device and equipment of gateway and readable storage medium - Google Patents

Data processing method, device and equipment of gateway and readable storage medium Download PDF

Info

Publication number
CN112104640A
CN112104640A CN202010952347.1A CN202010952347A CN112104640A CN 112104640 A CN112104640 A CN 112104640A CN 202010952347 A CN202010952347 A CN 202010952347A CN 112104640 A CN112104640 A CN 112104640A
Authority
CN
China
Prior art keywords
gateway
service
external request
internal
data processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010952347.1A
Other languages
Chinese (zh)
Other versions
CN112104640B (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.)
WeBank Co Ltd
Original Assignee
WeBank 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 WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN202010952347.1A priority Critical patent/CN112104640B/en
Publication of CN112104640A publication Critical patent/CN112104640A/en
Application granted granted Critical
Publication of CN112104640B publication Critical patent/CN112104640B/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
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • 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

Abstract

The invention discloses a data processing method, a device, equipment and a readable storage medium of a gateway, wherein the method is applied to a gateway component, the gateway component is embedded in a service system, and the method comprises the following steps: receiving an external request, and converting a message of the external request into an internal standard internal message according to a preset gateway conversion rule; initiating internal calling in the service system according to the internal message and acquiring a calling result; and returning the calling result to the initiator of the external request. The invention realizes the decentralization of the gateway, thereby realizing service isolation, avoiding link failure caused by the influence of non-core large-flow service on core service, and ensuring the stability of a service system.

Description

Data processing method, device and equipment of gateway and readable storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a data processing method, an apparatus, a device, and a readable storage medium for a gateway.
Background
The current communication architecture is divided into internal and external, and internal and external data exchange needs to pass through a gateway, which intercepts an external network request and converts the external network request into an internal network standard protocol for service calling. At present, centralized gateways are adopted, and one gateway corresponds to a plurality of service systems. A problem with centralized gateways is that: the complexity and priority of different service systems are different, the centralized gateway cannot understand the priority relationship of each service system, and the problem that a non-core large-flow service system affects a core link occurs, that is, service isolation cannot be achieved.
Disclosure of Invention
The invention mainly aims to provide a data processing method, a data processing device, data processing equipment and a readable storage medium of a gateway, and aims to solve the technical problem that the existing centralized gateway cannot realize service isolation.
In order to achieve the above object, the present invention provides a data processing method for a gateway, where the method is applied to a gateway component, the gateway component is embedded in a service system, and the method includes:
receiving an external request, and converting a message of the external request into an internal standard internal message according to a preset gateway conversion rule;
initiating internal calling in the service system according to the internal message and acquiring a calling result;
and returning the calling result to the initiator of the external request.
Optionally, the service system is deployed in a service server, and the step of receiving the external request includes:
monitoring a preset port of the service server to receive an external request forwarded by a preset route forwarding component, wherein the route forwarding component searches a target service server port corresponding to a target domain name of the external request after receiving the external request, and forwards the external request to the target service server port.
Optionally, the step of converting the externally requested message into an internally standard internal message according to a preset gateway conversion rule includes:
reading a service calling parameter in the external request message;
and converting the service calling parameter into a method calling parameter of an internal method in the service system according to a preset gateway conversion rule to obtain an internal standard internal message.
Optionally, the step of initiating an internal call in the service system according to the internal packet and obtaining a call result includes:
determining a target service requested by the external request;
searching a target internal method in the business system corresponding to the target service from a preset service forwarding rule;
and initiating the calling of the target internal method according to the method calling parameters in the internal message, and acquiring a calling result.
Optionally, after the step of searching for the target internal method in the business system corresponding to the target service from the preset service forwarding rule, the method further includes:
and if the target internal method corresponding to the target service is not found, returning the calling result of the calling failure to the initiator of the external request.
Optionally, the step of returning the call result to the initiator of the external request includes:
converting the calling result into external standard feedback information according to the preset gateway conversion rule;
and returning the feedback information to the initiator of the external request.
Optionally, after the step of receiving the external request, the method further includes:
searching whether a target gateway conversion rule corresponding to the service requested by the external request exists locally;
if the target gateway conversion rule is not found, acquiring the target gateway conversion rule from a preset gateway configuration component;
taking the target gateway conversion rule as the preset gateway conversion rule, and executing the steps of: and converting the message of the external request into an internal standard message according to a preset gateway conversion rule.
In order to achieve the above object, the present invention further provides a data processing apparatus for a gateway, where the apparatus is disposed in a gateway component, and the gateway component is embedded in a service system, and the apparatus includes:
the conversion module is used for receiving an external request and converting a message of the external request into an internal standard message according to a preset gateway conversion rule;
the initiating module is used for initiating internal calling in the service system according to the internal message and acquiring a calling result;
and the return module is used for returning the calling result to the initiator of the external request.
In order to achieve the above object, the present invention further provides a data processing device of a gateway, where the data processing device of the gateway includes: a memory, a processor and a data processing program of the gateway stored on the memory and operable on the processor, the data processing program of the gateway implementing the steps of the data processing method of the gateway as described above when executed by the processor.
Furthermore, to achieve the above object, the present invention also provides a computer readable storage medium, which stores a data processing program of a gateway, and the data processing program of the gateway, when executed by a processor, implements the steps of the data processing method of the gateway as described above.
In the invention, the gateway component is embedded in the service system, the external request is received by the gateway component, the message of the external request is converted into the internal standard message according to the gateway conversion rule, the internal calling of the service system is called according to the internal message, the calling result is obtained and returned to the initiator of the external request, and the decentralization of the gateway is realized. Namely, one gateway is responsible for one service system, and service requests of each service system cannot be influenced mutually, so that service isolation is realized, link failure caused by influence of non-core large-flow services on core services is avoided, and stability of the service system is ensured. In addition, the gateway component is embedded in the service system, so that the service logic of the gateway is executed by utilizing the redundancy performance of the service server, an independent gateway server does not need to be set, and the hardware cost is reduced. In addition, because the gateway component is embedded in the service system, the call of the service system initiated by the gateway component belongs to the call inside the system, rather than the call across the system, and therefore, compared with a centralized gateway or a separately deployed gateway server, the time spent on calling is reduced, and the efficiency of responding to an external request is improved.
Drawings
FIG. 1 is a schematic diagram of a hardware operating environment according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a data processing method of a gateway according to a first embodiment of the present invention;
fig. 3 is a data processing flow chart of a gateway according to an embodiment of the present invention;
fig. 4 is a functional block diagram of a data processing apparatus of a gateway according to a preferred embodiment of the invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, fig. 1 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present invention.
It should be noted that, the data processing device of the gateway in the embodiment of the present invention may be a smart phone, a personal computer, a server, and the like, and is not limited herein.
As shown in fig. 1, the data processing device of the gateway may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the device architecture shown in fig. 1 does not constitute a limitation of the data processing device of the gateway and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein data processing programs of an operating system, a network communication module, a user interface module, and a gateway. An operating system is a program that manages and controls the hardware and software resources of the device, the data processing programs that support the gateway, and the execution of other software or programs.
In the device shown in fig. 1, the user interface 1003 is mainly used for data communication with a client; the network interface 1004 is mainly used for establishing communication connection with a server; and the processor 1001 may be configured to invoke a data handler of the gateway stored in the memory 1005 and perform the following operations:
receiving an external request, and converting a message of the external request into an internal standard internal message according to a preset gateway conversion rule;
initiating internal calling in the service system according to the internal message and acquiring a calling result;
and returning the calling result to the initiator of the external request.
Further, the service system is deployed in a service server, and the step of receiving the external request includes:
monitoring a preset port of the service server to receive an external request forwarded by a preset route forwarding component, wherein the route forwarding component searches a target service server port corresponding to a target domain name of the external request after receiving the external request, and forwards the external request to the target service server port.
Further, the step of converting the externally requested message into an internally standard internal message according to a preset gateway conversion rule includes:
reading a service calling parameter in the external request message;
and converting the service calling parameter into a method calling parameter of an internal method in the service system according to a preset gateway conversion rule to obtain an internal standard internal message.
Further, the step of initiating an internal call in the service system according to the internal packet and obtaining a call result includes:
determining a target service requested by the external request;
searching a target internal method in the business system corresponding to the target service from a preset service forwarding rule;
and initiating the calling of the target internal method according to the method calling parameters in the internal message, and acquiring a calling result.
Further, after the step of searching for the target internal method in the business system corresponding to the target service from the preset service forwarding rule, the processor 1001 may be further configured to invoke a data processing program of a gateway stored in the memory 1005, and perform the following operations:
and if the target internal method corresponding to the target service is not found, returning the calling result of the calling failure to the initiator of the external request.
Further, the step of returning the call result to the initiator of the external request includes:
converting the calling result into external standard feedback information according to the preset gateway conversion rule;
and returning the feedback information to the initiator of the external request.
Further, after the step of receiving the external request, the processor 1001 may be further configured to call a data processing program of the gateway stored in the memory 1005, and perform the following operations:
searching whether a target gateway conversion rule corresponding to the service requested by the external request exists locally;
if the target gateway conversion rule is not found, acquiring the target gateway conversion rule from a preset gateway configuration component;
taking the target gateway conversion rule as the preset gateway conversion rule, and executing the steps of: and converting the message of the external request into an internal standard message according to a preset gateway conversion rule.
Based on the above structure, various embodiments of a data processing method of a gateway are proposed.
Referring to fig. 2, fig. 2 is a flowchart illustrating a data processing method of a gateway according to a first embodiment of the present invention.
Embodiments of the present invention provide an embodiment of a data processing method of a gateway, and it should be noted that, although a logical order is shown in a flowchart, in some cases, the steps shown or described may be performed in an order different from that here. The data processing method of the gateway is applied to the gateway component, and the gateway component is embedded in the business system, wherein the business system is a system capable of providing some business services, such as a background system of a shopping website, a banking business handling system and the like, and the services provided by the business system are not limited in each embodiment of the invention. The business system may be deployed in a server or a cluster of servers. In this embodiment, the data processing method of the gateway includes:
step S10, receiving an external request, and converting the message of the external request into an internal standard message according to a preset gateway conversion rule;
in this embodiment, to solve the problem that a centralized gateway cannot perform service isolation, a decentralized gateway is proposed, that is, one gateway is connected to one service system, and external requests of each service system are not affected by each other, so that good service isolation is performed, and a link fault of a core service is avoided. Specifically, since the service server generally has performance redundancy, the service logic of the gateway can be executed by using a part of the redundant performance, so that the gateway component executing the gateway service logic is embedded in the service system, and the service system is deployed in the service server. Wherein the gateway component may be a dependent packet embedded into the business system.
An external request is received by the gateway component for the business system for which it is responsible. The protocol standard of the external request is different from the protocol standard in the service system, for example, the external request is the http (hypertext transfer protocol) protocol standard, and the service system may use more efficient communication middleware for data exchange in the system. The gateway component may be preset with a gateway conversion rule, where the gateway conversion rule specifies a conversion rule between an external standard and an internal standard, and may include a conversion rule of a request parameter, a conversion rule of a message format, and the like. Further, the gateway conversion rule may be updated frequently, so a special gateway configuration component may be provided for developers to configure the gateway conversion rule, and the gateway component may pull the latest gateway conversion rule from the gateway configuration component periodically. The gateway configuration component may then be independent of the business system.
The gateway component converts the message of the external request into an internal standard message according to the gateway conversion rule, that is, the external request is a message adopting the external standard, and the gateway component converts the message into the internal standard message according to the rule. The specific conversion process is different according to different rule settings, and will not be described in detail herein.
Step S20, initiating internal calling in the service system according to the internal message and obtaining a calling result;
after the internal message is obtained by conversion, the gateway component initiates internal calling in the service system according to the internal message. Specifically, the external request may be for a certain service that can be provided by the service system, and after the external request is converted into the internal packet, the gateway component may determine which service of the service system is requested according to the internal packet, and initiate an internal call of the service system for the service, for example, if the service is implemented by a certain method in the service system, initiate an internal call of the method in the service system.
Because the gateway component is embedded in the service system, the call of the service system initiated by the gateway component belongs to the call inside the system, but not the call across the system, so that compared with a centralized gateway or a separately deployed gateway server, the time spent on calling is reduced, and the efficiency of responding to an external request is improved.
And the gateway component acquires a calling result returned by the service system after initiating the internal calling of the service system.
And step S30, returning the call result to the initiator of the external request.
And returning the calling result to the initiator of the external request. The initiator may be a client corresponding to the service system, or other device that requests service of the service system. The gateway component may return the call result to the initiator according to the original path for the initiator to obtain the result of the service request. It should be noted that the information of the calling result that needs to be converted into the external standard can be returned to the initiator through the protocol of the external network, and specifically, the information may be converted by the gateway component, or may be converted by other components in the service system.
Further, the step S30 includes:
step S301, converting the calling result into external standard feedback information according to the preset gateway conversion rule;
step S302, returning the feedback information to the initiator of the external request.
In an embodiment, after obtaining the call result, the gateway component may convert the call result into feedback information of the external standard according to a gateway conversion rule, that is, convert a message of the internal standard into a message of the external standard. And returning the feedback information to the initiator of the external request. Further, when the external request sent by the initiator is forwarded to the gateway component via one or more routes, the gateway component returns the feedback information to the previous route, and the feedback information is forwarded to the initiator via each route.
In this embodiment, a gateway component is embedded in a service system, an external request is received by the gateway component, a message of the external request is converted into an internal standard message according to a gateway conversion rule, an internal call of the service system is invoked according to the internal message, a call result is obtained and returned to an initiator of the external request, and decentralized processing of the gateway is achieved. Namely, one gateway is responsible for one service system, and service requests of each service system cannot be influenced mutually, so that service isolation is realized, link failure caused by influence of non-core large-flow services on core services is avoided, and stability of the service system is ensured. In addition, the gateway component is embedded in the service system, so that the service logic of the gateway is executed by utilizing the redundancy performance of the service server, an independent gateway server does not need to be set, and the hardware cost is reduced. In addition, because the gateway component is embedded in the service system, the call of the service system initiated by the gateway component belongs to the call inside the system, rather than the call across the system, and therefore, compared with a centralized gateway or a separately deployed gateway server, the time spent on calling is reduced, and the efficiency of responding to an external request is improved.
Further, based on the first embodiment described above, a second embodiment of the data processing method of the gateway of the present invention is provided, in this embodiment, the step of receiving the external request in step S10 includes:
step S101, monitoring a preset port of the service server to receive an external request forwarded by a preset routing forwarding component, where the routing forwarding component searches for a target service server port corresponding to a target domain name of the external request after receiving the external request, and forwards the external request to the target service server port.
In this embodiment, the service systems are deployed in the service servers, different service systems may be deployed in different service servers, or may be deployed in the same service server, but each service system has its own gateway component.
The routing forwarding component may be preset, and configured to forward the external request to a corresponding service server, specifically to a certain port of the service server. The route forwarding component may be implemented using a component capable of implementing route forwarding service logic, such as a Nginx load balancing server. The domain name is applied for each service system in advance, for example, a third-level domain name can be applied, and the external application accesses the service system through the domain name, that is, the domain name of the service system can be carried in the initiated external request. A port for receiving an external request is opened in the service server, and if a plurality of service systems are deployed in the service server, different ports can be allocated to each service system. The routing forwarding component can configure the mapping relationship between the domain name of each service system and the service server port.
After receiving the external request, the route forwarding component searches a service server port corresponding to the target domain name in the mapping relation according to the target domain name of the external request, namely the domain name carried in the external request, and forwards the external request to the target service server port after searching the target service server port. After the service system is started, the gateway component automatically monitors the port corresponding to the service system so as to receive the external request forwarded by the route forwarding component.
For example, assume that a certain website is www.cmake.com, which corresponds to a service system a, and is deployed in a server with an IP address of 172.16.152.3 to apply for 1 third-level domain name a.api.cmake.com for the service system a, and an external http request to a all walks around the a.api.cmake.com domain name. The route forwarding component is configured with a mapping relation: a. api. cmake. com domain name — 7044 port of 172.16.152.3. When the route forwarding component receives an external request for a.api.cmake.com, the external request is forwarded to the 7044 port of 172.16.152.3 according to the mapping relationship. The gateway component monitors the 7044 port after the service system a is started, and further receives the forwarded external request.
In this embodiment, a domain name is applied for a service system, a port for receiving an external request is set in a service server, a mapping relationship between the domain name and the port of the service system is configured in a routing forwarding component, the routing forwarding component forwards the external request to a corresponding service server port according to the mapping relationship, and a gateway component monitoring port is set to receive the external request forwarded by the routing forwarding component, so that the service logic of the gateway is implemented by using the performance redundancy of the service server, a new hardware system does not need to be added, and the cost is reduced.
Further, based on the first and/or second embodiments, a third embodiment of the data processing method of the gateway in the present invention is provided, in this embodiment, the step of converting the externally requested message into an internal standard internal message according to a preset gateway conversion rule in step S10 includes:
step S102, reading service calling parameters in the external request message;
in this embodiment, the preset gateway conversion rule may include a mapping relationship between a service invocation parameter in the external request and a method invocation parameter of an internal method in the business system. For example, the conversion rule configures a method call parameter name of the internal method corresponding to the service call parameter pName in the external request.
After receiving the external request, the gateway component reads the service invocation parameter in the external request message, for example, reads the pName.
Step S103, converting the service calling parameter into a method calling parameter of an internal method in the service system according to a preset gateway conversion rule, and obtaining an internal standard internal message.
And the gateway component converts the service calling parameters into method calling parameters of the internal method in the service system according to a preset gateway conversion rule, and obtains internal standard internal messages after parameter conversion. For example, the pName is mapped to the method call parameter name of the internal method.
Further, the step S20 includes:
step S201, determining a target service requested by the external request;
in an embodiment, after obtaining the internal packet, the gateway component may determine a target service requested by the external request, that is, the service system provides multiple services to the outside, where the external request carries an identifier or a name of the service to be requested, and the gateway component may extract the identifier or the name carried in the external request to determine the target service.
Step S202, searching a target internal method in the business system corresponding to the target service from a preset service forwarding rule;
the gateway component may be preconfigured with a service forwarding rule, where the service forwarding rule includes a mapping relationship between a service provided by the gateway component to the outside and an internal method, for example, a hellos service provided to the outside is correspondingly implemented by a sayhall method inside the service system. After determining the target service, the gateway component may search for an internal method in the service system corresponding to the target service from the preset service forwarding rule, and use the searched method as the target internal method.
Step S203, initiating the calling of the target internal method according to the method calling parameter in the internal message, and obtaining the calling result.
The gateway component initiates a call to a target internal method. Specifically, the internal message includes a method invocation parameter, and the gateway component initiates invocation of the target internal method according to the method invocation parameter, that is, the method invocation parameter is used as the invocation parameter of the target internal method. And obtaining the calling result returned by the target internal method.
It should be noted that both the service forwarding rule and the gateway conversion rule in the gateway component may be configured in the gateway configuration component, and the gateway component may periodically poll the gateway configuration component to update the service forwarding rule and the gateway conversion rule. For example, service forwarding rules may be configured in the gateway configuration component: { targetService: hellowService, targetMethod: sayHello, param [ { fieldmame: name, ref: pName } ] }.
Further, after the step S202, the method further includes:
step S204, if the target internal method corresponding to the target service is not found, returning the calling result of the calling failure to the initiator of the external request.
In an embodiment, if the gateway component does not find the target internal method corresponding to the target service from the service forwarding rule, the calling result of the call failure is returned to the initiator of the external request. In order to find out the target internal method corresponding to the target service, the service system does not provide the service, the initiator is probably a malicious attacker, and therefore the gateway component returns the calling result of the calling failure to the initiator.
Further, after the step of receiving the external request in step S10, the method further includes:
step S40, searching whether a target gateway conversion rule corresponding to the service requested by the external request exists locally;
in an embodiment, after receiving the external request, the gateway component may first search whether a target gateway conversion rule corresponding to the service requested by the external request exists locally, that is, detect whether a conversion rule for converting the external request is stored locally.
Step S50, if not found, obtaining the target gateway conversion rule from a preset gateway configuration component;
if not, the gateway component can obtain the target gateway conversion rule from a preset gateway configuration component. That is, the gateway translation rules have been updated in the gateway configuration component, but the gateway component may not be updated in time, so to avoid failure of the external request, the gateway component may obtain the target gateway translation rules from the gateway configuration component.
Step S60, the target gateway conversion rule is used as the preset gateway conversion rule, and the step S10 is executed to convert the externally requested message into an internally standard internal message according to the preset gateway conversion rule.
And taking the target gateway conversion rule as a preset gateway conversion rule to convert the external request according to the gateway conversion rule, and further executing the subsequent processing flow.
Further, if the target gateway conversion rule is not updated in the gateway configuration component, the gateway component cannot acquire the target gateway conversion rule, and at this time, the gateway component may return a call result of the call failure to the sender.
Further, the gateway component may perform a permission verification on the received external request, and when it is detected that the external request does not conform to the permission, the gateway component may not process the external request, or return a result of the request failure to the initiator. Specifically, some permission verification rules may be set in the gateway component, for example, different services are started for clients in different regions in the service system, and then the external request carries a region identifier of the client; after receiving an external request sent by a client, the gateway component can detect whether the region identifier has a corresponding service authority; if yes, converting the external request and carrying out internal calling; if not, the external request is not processed, or the result of the request failure is returned to the client.
In one embodiment, as shown in FIG. 3, a gateway component is embedded in a business application (business system) A. Nginx accesses the flow of an external network, and forwards an external request to a server where a service application A is located, and a gateway component monitors a port to receive the external request; searching a configuration rule, namely a gateway conversion rule; the gateway component can also poll a gateway configuration center (gateway configuration component) periodically to pull the latest gateway conversion rule and the latest service forwarding rule; if the gateway conversion rule is not found, the gateway component returns the result of the calling failure; if the external request is found, message conversion is carried out on the external request according to rules; after conversion, searching whether the requested service exists; if the local service exists, the service is called, namely calling is initiated to the local service (internal method) of the business system, and a calling result is obtained; if not, the gateway component returns the result of the call failure.
In addition, an embodiment of the present invention further provides a data processing apparatus for a gateway, where the apparatus is disposed in a gateway component, and the gateway component is embedded in a service system, and with reference to fig. 4, the apparatus includes:
a conversion module 10, configured to receive an external request, and convert a message of the external request into an internal standard internal message according to a preset gateway conversion rule;
the initiating module 20 is configured to initiate an internal call in the service system according to the internal packet and obtain a call result;
and a returning module 30, configured to return the call result to the initiator of the external request.
Further, the service system is deployed in a service server, and the conversion module 10 includes:
and the monitoring unit is used for monitoring a preset port of the service server so as to receive an external request forwarded by a preset route forwarding component, wherein the route forwarding component searches a target service server port corresponding to a target domain name of the external request after receiving the external request, and forwards the external request to the target service server port.
Further, the conversion module 10 includes:
a reading unit, configured to read a service invocation parameter in the external request message;
and the first conversion unit is used for converting the service calling parameter into a method calling parameter of an internal method in the service system according to a preset gateway conversion rule to obtain an internal standard internal message.
Further, the initiating module 20 includes:
a determination unit configured to determine a target service requested by the external request;
the searching unit is used for searching a target internal method in the business system corresponding to the target service from a preset service forwarding rule;
and the initiating unit is used for initiating the calling of the target internal method according to the method calling parameters in the internal message and acquiring a calling result.
Further, the returning module 30 is further configured to return a call result of the call failure to the initiator of the external request if the target internal method corresponding to the target service is not found.
Further, the return module 30 includes:
the second conversion unit is used for converting the calling result into external standard feedback information according to the preset gateway conversion rule;
and the return unit is used for returning the feedback information to the initiator of the external request.
Further, the apparatus further comprises:
the searching module is used for searching whether a target gateway conversion rule corresponding to the service requested by the external request exists locally;
the acquisition module is used for acquiring the target gateway conversion rule from a preset gateway configuration component if the target gateway conversion rule is not found;
the conversion module 10 is further configured to use the target gateway conversion rule as the preset gateway conversion rule, and convert the external request packet into an internal standard internal packet according to the preset gateway conversion rule.
The specific implementation of the data processing apparatus of the gateway of the present invention is basically the same as the embodiments of the data processing method of the gateway, and is not described herein again.
Furthermore, an embodiment of the present invention further provides a computer-readable storage medium, where a data processing program of a gateway is stored on the storage medium, and when the data processing program of the gateway is executed by a processor, the data processing method of the gateway includes the following steps.
The embodiments of the data processing device and the computer-readable storage medium of the gateway of the present invention can refer to the embodiments of the data processing method of the gateway of the present invention, and are not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A data processing method for a gateway is applied to a gateway component, the gateway component is embedded in a service system, and the method comprises the following steps:
receiving an external request, and converting a message of the external request into an internal standard internal message according to a preset gateway conversion rule;
initiating internal calling in the service system according to the internal message and acquiring a calling result;
and returning the calling result to the initiator of the external request.
2. The data processing method of the gateway according to claim 1, wherein the service system is deployed in a service server, and the step of receiving the external request comprises:
monitoring a preset port of the service server to receive an external request forwarded by a preset route forwarding component, wherein the route forwarding component searches a target service server port corresponding to a target domain name of the external request after receiving the external request, and forwards the external request to the target service server port.
3. The data processing method of the gateway according to claim 1, wherein the step of converting the externally requested message into an internally standard internal message according to a preset gateway conversion rule comprises:
reading a service calling parameter in the external request message;
and converting the service calling parameter into a method calling parameter of an internal method in the service system according to a preset gateway conversion rule to obtain an internal standard internal message.
4. The data processing method of the gateway according to claim 1, wherein the step of initiating an internal call in the service system according to the internal packet and obtaining a call result comprises:
determining a target service requested by the external request;
searching a target internal method in the business system corresponding to the target service from a preset service forwarding rule;
and initiating the calling of the target internal method according to the method calling parameters in the internal message, and acquiring a calling result.
5. The data processing method of the gateway according to claim 4, wherein after the step of searching for the target internal method in the business system corresponding to the target service from the preset service forwarding rule, the method further comprises:
and if the target internal method corresponding to the target service is not found, returning the calling result of the calling failure to the initiator of the external request.
6. The data processing method of the gateway according to claim 1, wherein the step of returning the call result to the originator of the external request comprises:
converting the calling result into external standard feedback information according to the preset gateway conversion rule;
and returning the feedback information to the initiator of the external request.
7. The data processing method of the gateway according to any of claims 1 to 6, wherein after the step of receiving the external request, further comprising:
searching whether a target gateway conversion rule corresponding to the service requested by the external request exists locally;
if the target gateway conversion rule is not found, acquiring the target gateway conversion rule from a preset gateway configuration component;
taking the target gateway conversion rule as the preset gateway conversion rule, and executing the steps of: and converting the message of the external request into an internal standard message according to a preset gateway conversion rule.
8. A data processing apparatus of a gateway, wherein the apparatus is deployed in a gateway component embedded in a business system, the apparatus comprising:
the conversion module is used for receiving an external request and converting a message of the external request into an internal standard message according to a preset gateway conversion rule;
the initiating module is used for initiating internal calling in the service system according to the internal message and acquiring a calling result;
and the return module is used for returning the calling result to the initiator of the external request.
9. A data processing device of a gateway, characterized in that the data processing device of the gateway comprises: memory, processor and data processing program of a gateway stored on the memory and executable on the processor, the data processing program of the gateway implementing the steps of the data processing method of the gateway according to any one of claims 1 to 7 when executed by the processor.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a data processing program of a gateway, which when executed by a processor implements the steps of the data processing method of the gateway according to any one of claims 1 to 7.
CN202010952347.1A 2020-09-11 2020-09-11 Data processing method, device and equipment of gateway and readable storage medium Active CN112104640B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010952347.1A CN112104640B (en) 2020-09-11 2020-09-11 Data processing method, device and equipment of gateway and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010952347.1A CN112104640B (en) 2020-09-11 2020-09-11 Data processing method, device and equipment of gateway and readable storage medium

Publications (2)

Publication Number Publication Date
CN112104640A true CN112104640A (en) 2020-12-18
CN112104640B CN112104640B (en) 2022-10-14

Family

ID=73752296

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010952347.1A Active CN112104640B (en) 2020-09-11 2020-09-11 Data processing method, device and equipment of gateway and readable storage medium

Country Status (1)

Country Link
CN (1) CN112104640B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113992382A (en) * 2021-10-22 2022-01-28 北京京东振世信息技术有限公司 Service data processing method and device, electronic equipment and storage medium
CN114567557A (en) * 2022-03-07 2022-05-31 上海数禾信息科技有限公司 Message processing method and device, computer equipment and storage medium
CN114844792A (en) * 2022-04-26 2022-08-02 深圳云创数安科技有限公司 Dynamic monitoring method, device, equipment and storage medium based on LUA language

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6529972B1 (en) * 1999-08-10 2003-03-04 Intel Corporation Message translation and data proxy service for remote data transport in a computer network
CN101022431A (en) * 2007-03-09 2007-08-22 中国移动通信集团福建有限公司 Interface gateway and interface gateway data processing method
EP1944932A1 (en) * 2007-01-09 2008-07-16 Industrial Technology Research Institute System and method for controlling the devices connected to control gateway
US20150081918A1 (en) * 2013-09-17 2015-03-19 Twilio, Inc. System and method for providing communication platform metadata
CN109784881A (en) * 2018-12-29 2019-05-21 广州蓝石信息技术有限公司 General across chain payment scheme based on decentralization gateway
CN110365751A (en) * 2019-06-26 2019-10-22 口碑(上海)信息技术有限公司 Method for processing business, device and the equipment of gateway system
US20200021609A1 (en) * 2018-07-13 2020-01-16 Ribbon Communications Operating Company, Inc. Communications methods and apparatus for dynamic detection and/or mitigation of threats and/or anomalies
CN110740187A (en) * 2019-10-25 2020-01-31 家乡互动(厦门)网络科技有限公司 micro service architecture realization method
CN110768914A (en) * 2019-10-23 2020-02-07 上海交通大学 Decentralized Internet of things gateway system based on semantic scene instance migration
CN110830442A (en) * 2019-10-09 2020-02-21 贝壳技术有限公司 Message processing method, device and gateway

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6529972B1 (en) * 1999-08-10 2003-03-04 Intel Corporation Message translation and data proxy service for remote data transport in a computer network
EP1944932A1 (en) * 2007-01-09 2008-07-16 Industrial Technology Research Institute System and method for controlling the devices connected to control gateway
CN101022431A (en) * 2007-03-09 2007-08-22 中国移动通信集团福建有限公司 Interface gateway and interface gateway data processing method
US20150081918A1 (en) * 2013-09-17 2015-03-19 Twilio, Inc. System and method for providing communication platform metadata
US20200021609A1 (en) * 2018-07-13 2020-01-16 Ribbon Communications Operating Company, Inc. Communications methods and apparatus for dynamic detection and/or mitigation of threats and/or anomalies
CN109784881A (en) * 2018-12-29 2019-05-21 广州蓝石信息技术有限公司 General across chain payment scheme based on decentralization gateway
CN110365751A (en) * 2019-06-26 2019-10-22 口碑(上海)信息技术有限公司 Method for processing business, device and the equipment of gateway system
CN110830442A (en) * 2019-10-09 2020-02-21 贝壳技术有限公司 Message processing method, device and gateway
CN110768914A (en) * 2019-10-23 2020-02-07 上海交通大学 Decentralized Internet of things gateway system based on semantic scene instance migration
CN110740187A (en) * 2019-10-25 2020-01-31 家乡互动(厦门)网络科技有限公司 micro service architecture realization method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113992382A (en) * 2021-10-22 2022-01-28 北京京东振世信息技术有限公司 Service data processing method and device, electronic equipment and storage medium
CN113992382B (en) * 2021-10-22 2024-04-05 北京京东振世信息技术有限公司 Service data processing method and device, electronic equipment and storage medium
CN114567557A (en) * 2022-03-07 2022-05-31 上海数禾信息科技有限公司 Message processing method and device, computer equipment and storage medium
CN114844792A (en) * 2022-04-26 2022-08-02 深圳云创数安科技有限公司 Dynamic monitoring method, device, equipment and storage medium based on LUA language

Also Published As

Publication number Publication date
CN112104640B (en) 2022-10-14

Similar Documents

Publication Publication Date Title
EP3886404B1 (en) Domain name server allocation method and device
CN110098947B (en) Application deployment method, device and system
EP3629552B1 (en) Method, registration center and device for service discovery
CN112104640B (en) Data processing method, device and equipment of gateway and readable storage medium
JP6275837B2 (en) Method and apparatus for performing subscription notification
CN110351283B (en) Data transmission method, device, equipment and storage medium
CN111290865A (en) Service calling method and device, electronic equipment and storage medium
CN113572838B (en) Network access method, device, equipment and medium based on Kubernetes
CN113301166B (en) Service calling method and device, storage medium and electronic device
US11540244B2 (en) MEC information obtaining method and apparatus
EP4106271A1 (en) Application discovery method, apparatus, and system
EP3439425B1 (en) Network function communication
CN109474713B (en) Message forwarding method and device
US20230008647A1 (en) Connection establishment method, communication apparatus, and system
JP2003141002A (en) Url length conversion system and program
CN111726400A (en) Reverse connection method, device and server-side system
EP4068132A1 (en) Methods for application login and application visiting application server, and electronic device
CN112787947B (en) Network service processing method, system and gateway equipment
CN113014560A (en) Dynamic dubbo service calling method, computer equipment and storage medium
EP4311280A1 (en) Communication method and device
CN114650271B (en) Global load DNS neighbor site learning method and device
CN116980480B (en) Method and system for processing fusing information based on micro-service network model
JP6001512B2 (en) Communication control system and communication control method
CN113068223B (en) Local distribution method, device and equipment based on slice information and storage medium
WO2024038561A1 (en) Network information processing device, network information processing method, and program

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