CN113014640B - Request processing method, request processing device, electronic equipment and storage medium - Google Patents

Request processing method, request processing device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113014640B
CN113014640B CN202110202139.4A CN202110202139A CN113014640B CN 113014640 B CN113014640 B CN 113014640B CN 202110202139 A CN202110202139 A CN 202110202139A CN 113014640 B CN113014640 B CN 113014640B
Authority
CN
China
Prior art keywords
network domain
service
routing
gateway
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110202139.4A
Other languages
Chinese (zh)
Other versions
CN113014640A (en
Inventor
李永刚
喻波
王志海
安鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Wondersoft Technology Co Ltd
Original Assignee
Beijing Wondersoft Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Wondersoft Technology Co Ltd filed Critical Beijing Wondersoft Technology Co Ltd
Priority to CN202110202139.4A priority Critical patent/CN113014640B/en
Publication of CN113014640A publication Critical patent/CN113014640A/en
Application granted granted Critical
Publication of CN113014640B publication Critical patent/CN113014640B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/1066Session management
    • H04L65/1073Registration or de-registration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services

Abstract

The application provides a request processing method, a request processing device, an electronic device and a storage medium, wherein the service call request sent by a terminal is received, and the service call request at least comprises: checking parameters and routing information, and after the authentication of the checking parameters is passed, inquiring a routing address corresponding to the routing information in a routing relation, wherein the routing relation is generated through the negotiation of a gateway of a first network domain and a gateway of a second network domain. And when the routing address points to the gateway of the second network domain, the service call request is forwarded to the gateway of the second network domain to acquire a service call response, and the service call response is sent to the terminal. The routing address is generated through the service call request and the routing relationship, the service call response is obtained according to the network domains pointed by the routing address, the network domains can be mutually connected without arranging a set of devices in each network domain, the application environment requirement is reduced, the occupation of the resources of the network domains is avoided, the use cost is low, the existing resources are fully utilized, and the resource redundancy is not generated.

Description

Request processing method, request processing device, electronic equipment and storage medium
Technical Field
The application belongs to the technical field of network domains, and particularly relates to a request processing method, a request processing device, electronic equipment and a storage medium.
Background
As enterprise data evolves, different domain support is often required when doing work. In the related art, in order to protect part of data security, a physical isolation device is generally used to divide a network domain into an internal network domain, an external network domain, or more, and an Enterprise Service Bus (ESB) is used for request processing.
However, in the related art, a set of ESBs needs to be deployed in each of the internal network domain and the external network domain to implement request processing, and the deployed ESBs inevitably occupy resources of the internal network domain and the external network domain, so that the use cost is high, and resource redundancy is generated.
Disclosure of Invention
In view of this, the embodiments of the present application provide a method, an apparatus, an electronic device, and a storage medium for processing a request, which can solve the problems in the related art that, because an internal network domain and an external network domain are required to be deployed with a set of ESBs to implement the request processing, the deployed ESBs inevitably occupy the resources of the internal network domain and the external network domain, the use cost is high, and resource redundancy is generated.
According to a first aspect of the present application, there is provided a request processing method, the method being applied to a gateway of a first network domain, the gateway of the first network domain being communicatively connected to a gateway of a second network domain, the method comprising:
Receiving a service call request sent by a terminal, wherein the service call request at least comprises: checking parameters and routing information;
after the verification parameter passes the authentication, inquiring a routing address corresponding to the routing information in a routing relation, wherein the routing relation is generated through the negotiation between the gateway of the first network domain and the gateway of the second network domain;
and when the routing address points to the gateway of the second network domain, obtaining a service call response by forwarding the service call request to the gateway of the second network domain, and sending the service call response to the terminal.
Optionally, the method further comprises:
receiving a service registration request, wherein the service registration request at least comprises: service information;
generating route information according to the service information, and determining a service network domain corresponding to the route information;
establishing a corresponding relation between the routing information and a routing address of a gateway in the service network domain to obtain a routing relation;
and synchronizing the routing relationship to a gateway of the second network domain.
Optionally, the routing relationship further includes: the retry threshold and the fusing address corresponding to the routing information, and before the service call response is acquired, the method further comprises:
And when the number of times of forwarding the service call response to the gateway of the second network domain is greater than or equal to the retry threshold, acquiring fusing information from the fusing address and sending the fusing information to the terminal.
Optionally, the method further comprises:
receiving a heartbeat message sent by a gateway of the second network domain, wherein the heartbeat message at least comprises: service status information;
generating a service suspension instruction when the service state information is abnormal state information, wherein the service suspension instruction is used for indicating a gateway of the first network domain and a gateway of the second network domain to suspend providing services;
and when the service state information is normal state information, generating a service restoration instruction, wherein the service restoration instruction is used for indicating the gateway of the first network domain and the gateway of the second network domain to restore and provide services.
Optionally, the routing relationship further includes: the routing weight corresponding to the routing information, the method further comprises:
when a service suspension instruction is detected, modifying the routing weight corresponding to the service information from the forwarding weight to the suspension weight, and synchronizing the modified routing relationship to a gateway of the second network domain;
when a service restoration instruction is detected, modifying the routing weight corresponding to the service information from a pause weight to a forwarding weight, and synchronizing the modified routing relationship to a gateway of the second network domain;
After the service call request sent by the receiving terminal, the method further comprises:
stopping processing the service call request when the routing weight corresponding to the routing information is a pause weight;
and when the routing weight corresponding to the routing information is forwarding weight, continuing to process the service call request.
Optionally, after the receiving the heartbeat message sent by the gateway of the second network domain, the method further includes:
when the difference value between the time of last receiving the heartbeat message and the current time is greater than or equal to a time threshold value, displaying prompt information, wherein the heartbeat message further comprises: routing state information.
Optionally, after the routing address corresponding to the routing information is queried in the routing relationship, the method further includes:
when the routing address points to the gateway of the first network domain, a service call response is obtained from the local according to the routing address, and the service call response is sent to the terminal;
after the sending the service invocation response to the terminal, the method further comprises:
and obtaining a processing record of the service call request from the gateway of the second network domain, and generating a management log.
According to a second aspect of the present application, there is provided a request processing apparatus, the apparatus being applied to a gateway of a first network domain, the gateway of the first network domain being communicatively connected to a gateway of a second network domain, the apparatus comprising:
the receiving module is used for receiving a service call request sent by the terminal, and the service call request at least comprises: checking parameters and routing information;
and the inquiring module is used for inquiring the routing address corresponding to the routing information in the routing relation after the verification parameter passes the authentication, wherein the routing relation is generated through the negotiation between the gateway of the first network domain and the gateway of the second network domain. The gateway of the first network domain is in communication connection with the gateway of the second network domain;
and the sending module is used for obtaining a service call response by forwarding the service call request to the gateway of the second network domain when the routing address points to the gateway of the second network domain, and sending the service call response to the terminal.
Optionally, the apparatus further includes:
the establishing module is configured to receive a service registration request, where the service registration request at least includes: service information;
generating route information according to the service information, and determining a service network domain corresponding to the route information;
Establishing a corresponding relation between the routing information and a routing address of a gateway in the service network domain to obtain a routing relation;
and synchronizing the routing relationship to a gateway of the second network domain.
Optionally, the routing relationship further includes: the sending module is further configured to obtain the fusing information from the fusing address and send the fusing information to the terminal when the number of times of forwarding the service call response to the gateway of the second network domain is greater than or equal to the retry threshold.
Optionally, the apparatus includes:
the detection module is configured to receive a heartbeat message sent by a gateway of the second network domain, where the heartbeat message at least includes: service status information;
generating a service suspension instruction when the service state information is abnormal state information, wherein the service suspension instruction is used for indicating a gateway of the first network domain and a gateway of the second network domain to suspend providing services;
and when the service state information is normal state information, generating a service restoration instruction, wherein the service restoration instruction is used for indicating the gateway of the first network domain and the gateway of the second network domain to restore and provide services.
Optionally, the routing relationship further includes: the detection module is further configured to modify, when a service suspension instruction is detected, a routing weight corresponding to the service information from a forwarding weight to a suspension weight, and synchronize the modified routing relationship to a gateway of the second network domain;
when a service restoration instruction is detected, modifying the routing weight corresponding to the service information from a pause weight to a forwarding weight, and synchronizing the modified routing relationship to a gateway of the second network domain;
after the service call request sent by the receiving terminal, the detecting module is further configured to stop processing the service call request when the routing weight corresponding to the routing information is a pause weight;
and when the routing weight corresponding to the routing information is forwarding weight, continuing to process the service call request.
Optionally, after the receiving the heartbeat message sent by the gateway of the second network domain, the detection module is further configured to display a prompt message when a difference between a time of last receiving the heartbeat message and a current time is greater than or equal to a time threshold, where the heartbeat message further includes: routing state information.
Optionally, the query module is further configured to obtain a service call response from a local location according to the routing address when the routing address points to the gateway of the first network domain, and send the service call response to the terminal;
the sending module is further configured to obtain a processing record of the service call request from a gateway of the second network domain, and generate a management log.
According to a third aspect of the present application, there is provided an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the request processing method according to the first aspect when executing the computer program.
According to a fourth aspect of the present application, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the request processing method according to the first aspect described above.
Aiming at the related technology, the application has the following advantages:
the application provides a request processing method, a request processing device, an electronic device and a storage medium, wherein the service call request sent by a terminal is received, and the service call request at least comprises: checking parameters and routing information, and after the authentication of the checking parameters is passed, inquiring a routing address corresponding to the routing information in a routing relation, wherein the routing relation is generated through the negotiation of a gateway of a first network domain and a gateway of a second network domain. And when the routing address points to the gateway of the second network domain, the service call request is forwarded to the gateway of the second network domain to acquire a service call response, and the service call response is sent to the terminal. The routing address is generated through the service call request and the routing relationship, the service call response is obtained according to the network domains pointed by the routing address, the network domains can be mutually connected without arranging a set of devices in each network domain, the application environment requirement is reduced, the occupation of the resources of the network domains is avoided, the use cost is low, the existing resources are fully utilized, and the resource redundancy is not generated.
The foregoing description is only an overview of the technical solutions of the present application, and may be implemented according to the content of the specification in order to make the technical means of the present application more clearly understood, and in order to make the above-mentioned and other objects, features and advantages of the present application more clearly understood, the following detailed description of the present application will be given.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
FIG. 1 is a flowchart illustrating steps of a method for processing a request according to an embodiment of the present application;
FIG. 2 is a second flowchart illustrating steps of a method for processing a request according to an embodiment of the present application;
fig. 3 is a schematic diagram of an application scenario of a request processing method according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating a third step of a request processing method according to an embodiment of the present disclosure;
fig. 5 is a second application scenario schematic diagram of a request processing method provided in the embodiment of the present application;
Fig. 6 is a third application scenario schematic diagram of a request processing method provided in the embodiment of the present application;
FIG. 7 is a block diagram of a request processing device according to an embodiment of the present application;
fig. 8 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
With the progress of enterprise data and micro-service transformation, application program interfaces (Application Programming Interface, APIs) in different fields are endless, and a large-scale API management system becomes a core development trend. However, in some large enterprises or government enterprises and institutions, in order to protect part of data security, physical isolation devices are still used, the network domain is divided into an internal network domain and an external network domain, and the like, request processing of a plurality of network domains is realized through enterprise service buses (Enterprise Service Bus, ESBs), when the request processing is carried out through the ESBs, a set of ESBs needs to be deployed in the involved network domains respectively, the ESBs are connected with each other through the ESBs of the network domains, resources of each network domain are inevitably occupied, the application environment requirement is high, the use cost is high, and resource redundancy is generated. Therefore, the application provides a request processing method, a device, electronic equipment and a storage medium, wherein the request processing of the network domain is realized through the gateway of the network domain, the interconnection of the network domains can be realized without arranging a set of devices in each network domain, the occupation of the resources of the network domains is avoided, the application environment requirement is reduced, the use cost is low, the existing resources are fully utilized, and the resource redundancy is reduced.
Fig. 1 is a flowchart illustrating steps of a request processing method according to an embodiment of the present application, as shown in fig. 1, where the method is applied to a gateway of a first network domain, and the gateway of the first network domain is communicatively connected to a gateway of a second network domain, and the method includes S101-S103:
s101, receiving a service call request sent by a terminal, wherein the service call request at least comprises: checking parameters and routing information.
In this embodiment of the present application, a gateway of a first network domain is connected to a terminal, and the gateway of the first network domain receives a service call request sent by the terminal, where the service call request at least includes: checking parameters and routing information. In practical applications, the first network domain may be an internal network domain, where the second network domain is an external network domain, or the first network domain may be an external network domain, where the second network domain is an internal network domain. In either case, the two cannot be directly connected due to physical isolation. The service invocation request sent by the terminal is used for making a service invocation, and the service may be in the first network domain or in the second network domain.
It should be noted that, the service invocation request is sent to the gateway of the first network domain by the user triggering the terminal, or may be sent to the gateway of the first network domain automatically or regularly for the terminal, or may be forwarded to the gateway of the first network domain by the terminal through other forwarding devices, where a specific source of the service invocation request may be determined according to an actual requirement, and embodiments of the present application are not limited specifically herein.
S102, after passing the authentication of the checking parameters, inquiring a routing address corresponding to the routing information in the routing relation, wherein the routing relation is generated through the negotiation between the gateway of the first network domain and the gateway of the second network domain.
In the embodiment of the application, when the gateway of the first network domain receives the service call request, the authentication is performed on the inspection parameters included in the service call request, and the authentication can verify whether the terminal has the right to access the gateway of the first network domain. After the authentication is passed, the gateway of the first network domain can query the routing address corresponding to the routing information in the routing relationship, and the routing relationship is generated through negotiation between the gateway of the first network domain and the gateway of the second network domain. The routing information is typically a network address (Uniform Resource Locator, URL) of the service that the service call request wants to call, and the routing address of the service can be complemented by the routing relationship. Optionally, the routing relationship includes a retry threshold and a fusing address corresponding to the routing information; or, the routing relationship further includes a routing weight corresponding to the routing information.
The retry threshold is the number of times that the gateway of the first network domain acquires the service, and when the number of times of acquisition is greater than or equal to the retry threshold, the gateway of the first network domain does not acquire the service any more. When the fusing address is the gateway of the first network domain to acquire the service, the address pointed when the process is abnormal is acquired, so that the network domain or system avalanche caused by unresponsiveness of the service is avoided, and the hardware equipment supporting the network domain is maintained. The routing weight is the specific weight of resources that need to be occupied when a gateway of one network domain performs the acquisition service.
It should be noted that the authentication process using the verification parameter may be implemented by referring to a related technology, for example, the verification parameter is a password, and the password may be used for authentication; or verifying the digital signature with the authentication authorization of the verification parameters. Different authentication modes can be specifically selected according to practical applications, and the embodiments of the present application are not described herein again.
S103, when the routing address points to the gateway of the second network domain, the service call request is forwarded to the gateway of the second network domain to obtain a service call response, and the service call response is sent to the terminal.
In the embodiment of the application, when the routing address points to the gateway of the second network domain, the gateway of the first network domain forwards the service call request to the gateway of the second network domain, the gateway of the second network domain obtains the service corresponding to the service call request in the network domain, feeds back the service call response to the gateway of the first network domain, and immediately obtains the service call response and sends the service call response to the terminal. The terminal realizes the service call according to the service call request without considering the service under the network domain.
Optionally, when the routing address points to the gateway of the first network domain, the gateway of the first network domain obtains the service call response from the local according to the routing address, and sends the service call response to the terminal. That is, the gateway of the first network domain does not forward the service call request any more, and directly queries and obtains the service corresponding to the service call request in the first network domain. Meanwhile, after the service call response is sent to the terminal, a processing record of the service call request can be acquired from the gateway of the second network domain, and a management log is generated. The process of checking the request processing in the future is convenient.
In this embodiment of the present application, a service invocation request sent by a receiving terminal includes at least: checking parameters and routing information, and after the authentication of the checking parameters is passed, inquiring a routing address corresponding to the routing information in a routing relation, wherein the routing relation is generated through the negotiation of a gateway of a first network domain and a gateway of a second network domain. And when the routing address points to the gateway of the second network domain, the service call request is forwarded to the gateway of the second network domain to acquire a service call response, and the service call response is sent to the terminal. The routing address is generated through the service call request and the routing relationship, the service call response is obtained according to the network domains pointed by the routing address, the network domains can be mutually connected without arranging a set of devices in each network domain, the application environment requirement is reduced, the occupation of the resources of the network domains is avoided, the use cost is low, the existing resources are fully utilized, and the resource redundancy is not generated.
Fig. 2 is a step flowchart two of a request processing method provided in the embodiment of the present application, which is applied to a gateway of a first network domain, and the method includes S201-S204:
s201, receiving a service registration request, wherein the service registration request at least comprises: service information.
In the embodiment of the present application, before executing S101-S103, the gateway of the first network domain needs to further receive a service registration request of any service, where the service registration request characterizes the service to reside in the first network domain or the second network domain. The service registration request at this time is a service registration request of all services in the first network domain and the second network domain. The service registration request at least comprises service information, and the service information can represent the network domain condition of the service. That is, at least the network domain in which the service corresponding to the service registration request is located may be determined according to the service information of the service registration request.
S202, generating route information according to the service information, and determining a service network domain corresponding to the route information.
In the embodiment of the present application, as known in S201, the service registration request includes at least service information. Therefore, the gateway of the first network domain can generate the routing information according to the service information, and determine the service network domain corresponding to the routing information. In practice, different service domains correspond to different internetworking protocols (Internet Protocol, IP).
And S203, establishing a corresponding relation between the routing information and the routing address of the gateway in the service network domain to obtain the routing relation.
As can be seen from S202, the routing information is obtained from the service information, which is the most basic address information of the service, but when the service is in a different service network domain, the service cannot be obtained only by means of the routing information. The service network domain corresponding to the routing information is determined, so that a new routing address is established, and the acquisition of the service at the network domain level is realized. Therefore, the present application establishes a correspondence between the routing information and the routing address of the gateway in the service network domain, and obtains the routing relationship. The routing relation is used for determining a routing address according to the subsequent routing information, so that the service is obtained.
S204, synchronizing the routing relationship to the gateway of the second network domain.
In the embodiment of the application, the gateway of the first network domain obtains the routing relationship, which is not only stored in the gateway of the first network domain, but also synchronized to the gateway of the second network domain. In S103, the gateway of the first network domain sends the service call request to the gateway of the second network domain, and the gateway of the second network domain queries the routing address according to the routing relationship, thereby obtaining the service. In addition, when the terminal under the second network domain needs to acquire the service, the terminal does not need to perform configuration of the routing relationship again, and the terminal can be directly used, so that the efficiency of request processing is improved.
In the embodiment of the application, a service registration request is received, where the service registration request at least includes: the service information generates route information according to the service information, determines a service network domain corresponding to the route information, establishes a corresponding relation between the route information and a route address of a gateway in the service network domain, obtains a route relation, and synchronizes the route relation to the gateway of the second network domain. The routing relationship is established through the service registration request, so that a support is provided for the subsequent determination of the routing address according to the routing relationship, further the service is acquired, the efficiency of request processing is improved, and the use cost is reduced.
Optionally, the routing relationship further includes: the retry threshold and the fusing address corresponding to the routing information, before the service call response is acquired in S103, the method further includes:
and when the number of times of forwarding the service call response to the gateway of the second network domain is greater than or equal to the retry threshold, acquiring the fusing information from the fusing address and sending the fusing information to the terminal.
The retry threshold is the number of times the gateway of the first network domain obtains the service, and when the number of times of obtaining is greater than or equal to the retry threshold, the gateway of the first network domain does not obtain the service any more. At this time, the gateway of the first network domain acquires fusing information from the fusing address and feeds the fusing information back to the terminal, so as to remind the user that the gateway of the first network domain is connected with the gateway of the second network domain by mistake, and adjustment and maintenance are needed. The method and the device facilitate the user to check the connection errors among the network domains, enable the user to know the current service acquisition condition in time, and improve the user experience.
Further, the service registration request in S201-S204 may be sent by the external device, where the gateway of the first network domain and the gateway of the second network domain determine the routing relationship respectively. Meanwhile, the display of the prompt information can also be realized by external equipment. Specifically, the gateway of the first network domain and the gateway of the second network domain respectively acquire respective heartbeat messages, the heartbeat messages at least comprise service state information, the respective heartbeat messages are sent to external equipment, and the external equipment respectively executes S201-S204 on the heartbeat information from different network domains, so that current request processing is controlled. When a service registration request is sent by an external device, referring to fig. 3 specifically, fig. 3 is a schematic diagram of an application scenario of a request processing method provided in an embodiment of the present application.
In the embodiment of the application, the gateway of the first network domain and the gateway of the second network domain also perform self-detection regularly, so that good working conditions of the gateway and the gateway are ensured, and the problems of request loss and incapability of acquisition caused by error of the gateway are avoided.
Fig. 4 is a flowchart of the third step of a request processing method, which is applied to a gateway of a first network domain and provided in an embodiment of the present application, where the method includes S401-S403:
401. Receiving a heartbeat message sent by a gateway of the second network domain, wherein the heartbeat message at least comprises: service status information.
In the embodiment of the present application, the gateway of the second network domain periodically performs the service of the area where the self-check is located, generates the heartbeat message, and sends the heartbeat message to the gateway of the first network domain. The gateway of the first network domain can receive the heartbeat message sent by the gateway of the second network domain, and meanwhile, the gateway of the first network domain can also acquire the heartbeat message of the gateway of the first network domain periodically. The heartbeat message at least comprises service state information reflecting the state of each service in each network domain. For example, the gateway of the second network domain sends a heartbeat message to the gateway of the first network domain every 3 seconds. To determine whether to continue to acquire one or more services under the respective network domain.
The service state information includes at least two cases, namely normal state information and abnormal state information. The normal state information indicates that the service under each network domain works well, and the corresponding service can be acquired. The abnormal state information indicates that the service under each network domain has a problem, and the corresponding service cannot be obtained.
And S402, when the service state information is abnormal state information, generating a service suspension instruction, wherein the service suspension instruction is used for indicating the gateway of the first network domain and the gateway of the second network domain to suspend providing services.
In the embodiment of the present application, when the service status information is abnormal status information, the gateway of the first network domain generates a service suspension instruction, where the service suspension instruction indicates that the gateway of the first network domain and the gateway of the second network domain suspend providing services, that is, service acquisition or service call across network domains cannot be performed at this time.
It should be noted that, based on the above, the routing relationship further includes: when the route weight corresponds to the route information, the suspension providing service can be realized by the forwarding weight.
When the service suspension instruction is detected, the gateway of the first network domain modifies the routing weight corresponding to the service information from the forwarding weight to the suspension weight, and synchronizes the modified routing relationship to the gateway of the second network domain. After receiving a service call request sent by a terminal, a gateway of a first network domain stops processing the service call request when a routing weight corresponding to the routing information is a pause weight. Here, the suspension weight is generally set to 0, so that the service reflected as abnormal state information is avoided from being acquired.
Further, S402 may further include: and when the number of times that the service state information is abnormal state information exceeds a preset threshold value, generating a service suspension instruction, wherein the service suspension instruction is used for indicating a gateway of the first network domain and a gateway of the second network domain to suspend providing services.
And S403, when the service state information is normal state information, generating a service restoration instruction, wherein the service restoration instruction is used for indicating the gateway of the first network domain and the gateway of the second network domain to restore to provide services.
In this embodiment of the present application, the heartbeat message is uploaded periodically, so when the service status information in the heartbeat message is normal status information, the gateway of the first network domain generates a service restoration instruction, where the service restoration instruction is used to instruct the gateway of the first network domain and the gateway of the second network domain to restore to provide services.
S401 to S403 are heartbeat detection by the gateway. Based on the above, when the routing relationship further includes: when the routing weight corresponding to the routing information is the routing weight, the gateway recovery providing service can be realized by controlling the forwarding weight.
When the service restoration instruction is detected, the gateway of the first network domain modifies the routing weight corresponding to the service information from the pause weight to the forwarding weight, and synchronizes the modified routing relationship to the gateway of the second network domain. After receiving a service call request sent by a terminal, the gateway of the first network domain continues to process the service call request when the routing weight corresponding to the routing information is forwarding weight. Wherein the forwarding weight is typically a preceding forwarding weight, at least greater than the pause weight. For example, when the pause weight is 0, the forwarding weight here may be 50.
Optionally, after the gateway of the first network domain receives the heartbeat message sent by the gateway of the second network domain, when the difference between the time of last receiving the heartbeat message and the current time is greater than or equal to the time threshold, the gateway of the first network domain may display the prompt information, where the heartbeat message further includes: routing state information.
The display prompt information is displayed through the liquid crystal display, or is informed to the user through an instant messaging mode such as mail and short message, or is rapidly informed to the user through an audio warning mode and the like to maintain the core channel, so that the display prompt information has a good user experience effect.
Further, S401 to S403 may be executed not only by the gateway of the first network domain, but also by an external device. Meanwhile, the display of the prompt information can also be realized by external equipment. Specifically, the gateway of the first network domain and the gateway of the second network domain respectively acquire respective heartbeat messages, the heartbeat messages at least comprise service state information, the respective heartbeat messages are sent to external equipment, and the external equipment respectively executes S402-S403 on the heartbeat information from different network domains, so as to control the current request processing. In the case that the external device determines that the service is continued or suspended according to the heartbeat detection result, referring specifically to fig. 5, fig. 5 is a second application scenario schematic diagram of the request processing method provided in the embodiment of the present application.
In the embodiment of the application, a routing relationship is established through a service registration request, a foundation is laid for obtaining a routing address for a subsequent routing relationship, and meanwhile, when the routing relationship also comprises a retry threshold value and a fusing address corresponding to routing information, when the number of times of forwarding service call response to a gateway of a second network domain is greater than or equal to the retry threshold value, the fusing information is obtained from the fusing address and sent to a terminal, so that the avalanche phenomenon of the network domain is avoided. Further, the gateway of each network domain can perform periodic self-checking, determine service state information of the service under each network domain according to respective heartbeat messages, and generate different instructions according to different service state information, so as to ensure smooth execution of request processing, avoid occupying respective resources of the network domain, fully utilize the existing resources, and avoid generating resource redundancy.
It should be noted that the first network domain and the second network domain mentioned above are described differently, and when any one network domain is the first network domain in the case that two network domains are configured due to the relationship of physical devices, the other network domain is the second network domain. Or the network domain where the terminal is located is regarded as a first network domain, and the other network domain is a second network domain. Referring specifically to fig. 6, fig. 6 is a third application scenario diagram of a request processing method according to an embodiment of the present application.
Fig. 7 is a block diagram of a request processing apparatus 70 according to an embodiment of the present application, where the apparatus is applied to a gateway of a first network domain, and the gateway of the first network domain is communicatively connected to a gateway of a second network domain, and the apparatus includes:
the receiving module 701 is configured to receive a service invocation request sent by a terminal, where the service invocation request at least includes: checking parameters and routing information.
And the query module 702 is configured to query a routing relationship for a routing address corresponding to the routing information after the verification parameter passes the authentication, where the routing relationship is generated by negotiating a gateway of the first network domain and a gateway of the second network domain.
And the sending module 703 is configured to obtain a service call response by forwarding the service call request to the gateway of the second network domain when the routing address points to the gateway of the second network domain, and send the service call response to the terminal.
Optionally, the apparatus further comprises:
the establishing module is configured to receive a service registration request, where the service registration request at least includes: service information; generating route information according to the service information, and determining a service network domain corresponding to the route information; establishing a corresponding relation between the routing information and a routing address of a gateway in a service network domain to obtain a routing relation; synchronizing the routing relationship to a gateway of the second network domain.
Optionally, the routing relationship further includes: the sending module 703 is further configured to obtain the fusing information from the fusing address and send the fusing information to the terminal when the number of times of forwarding the service call response to the gateway of the second network domain is greater than or equal to the retry threshold.
Optionally, the apparatus comprises:
the detection module is configured to receive a heartbeat message sent by a gateway of the second network domain, where the heartbeat message at least includes: service status information; when the service state information is abnormal state information, generating a service suspension instruction, wherein the service suspension instruction is used for indicating a gateway of a first network domain and a gateway of a second network domain to suspend providing services; and when the service state information is normal state information, generating a service restoration instruction, wherein the service restoration instruction is used for indicating the gateway of the first network domain and the gateway of the second network domain to restore and provide services.
Optionally, the routing relationship further includes: the detection module is further used for modifying the routing weight corresponding to the service information from the forwarding weight to the pause weight when the service pause instruction is detected, and synchronizing the modified routing relationship to the gateway of the second network domain; when the service restoration instruction is detected, the routing weight corresponding to the service information is modified from the pause weight to the forwarding weight, and the modified routing relationship is synchronized to the gateway of the second network domain.
Optionally, after receiving the service call request sent by the terminal, the detection module is further configured to stop processing the service call request when the routing weight corresponding to the routing information is a pause weight; and when the routing weight corresponding to the routing information is forwarding weight, continuing to process the service call request.
Optionally, after receiving the heartbeat message sent by the gateway of the second network domain, the detection module is further configured to display the prompt message when a difference between a time of last receiving the heartbeat message and a current time is greater than or equal to a time threshold, where the heartbeat message further includes: routing state information.
Optionally, the query module 702 is further configured to obtain a service call response from the local location according to the routing address when the routing address points to the gateway of the first network domain, and send the service call response to the terminal.
The sending module 703 is further configured to obtain a processing record for the service call request from the gateway of the second network domain, and generate a management log.
Receiving a service call request sent by a terminal, wherein the service call request at least comprises: checking parameters and routing information, and after the authentication of the checking parameters is passed, inquiring a routing address corresponding to the routing information in a routing relation, wherein the routing relation is generated through the negotiation of a gateway of a first network domain and a gateway of a second network domain. And when the routing address points to the gateway of the second network domain, the service call request is forwarded to the gateway of the second network domain to acquire a service call response, and the service call response is sent to the terminal. The routing address is generated through the service call request and the routing relationship, the service call response is obtained according to the network domains pointed by the routing address, the network domains can be mutually connected without arranging a set of devices in each network domain, the application environment requirement is reduced, the occupation of the resources of the network domains is avoided, the use cost is low, the existing resources are fully utilized, and the resource redundancy is not generated.
For the embodiment of the server described above, since it is substantially similar to the method embodiment, the description is relatively simple, and reference is made to the description of the method embodiment in part.
The embodiment of the present application further provides an electronic device, as shown in fig. 8, including a processor 801, a communication interface 802, a memory 803, and a communication bus 804, where the processor 801, the communication interface 802, and the memory 803 complete communication with each other through the communication bus 804,
a memory 803 for storing a computer program;
the processor 801, when executing the program stored in the memory 803, implements the following steps: the steps of any of the above request processing methods.
The communication bus mentioned by the above terminal may be a peripheral component interconnect standard (Peripheral Component Interconnect, abbreviated as PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated as EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the terminal and other devices.
The memory may include random access memory (Random Access Memory, RAM) or non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (Digital Signal Processing, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In yet another embodiment provided herein, a computer readable storage medium having instructions stored therein that, when executed on a computer, cause the computer to perform the request processing method of any of the above embodiments is also provided.
In yet another embodiment provided herein, there is also provided a computer program product containing instructions that, when run on a computer, cause the computer to perform the request processing method of any of the above embodiments.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the scope of the present application. Any modifications, equivalent substitutions, improvements, etc. that are within the spirit and principles of the present application are intended to be included within the scope of the present application.

Claims (9)

1. A method for processing a request, the method being applied to a gateway of a first network domain, the gateway of the first network domain being communicatively connected to a gateway of a second network domain, the method comprising:
receiving a service call request sent by a terminal, wherein the service call request at least comprises: checking parameters and routing information;
after the verification parameter passes the authentication, inquiring a routing address corresponding to the routing information in a routing relation, wherein the routing relation is generated through the negotiation between the gateway of the first network domain and the gateway of the second network domain;
when the routing address points to the gateway of the second network domain, the service calling request is forwarded to the gateway of the second network domain to obtain a service calling response, and the service calling response is sent to the terminal;
before the step of receiving the service invocation request sent by the terminal, the method further includes:
Receiving a service registration request, wherein the service registration request at least comprises: service information, wherein the service registration request is a service registration request of all services in the first network domain and the second network domain; generating the routing information according to the service information, and determining a service network domain corresponding to the routing information; establishing a corresponding relation between the routing information and a routing address of a gateway in the service network domain to obtain a routing relation; and synchronizing the routing relationship to a gateway of the second network domain.
2. The method according to claim 1, wherein the routing relationship further comprises: the retry threshold and the fusing address corresponding to the routing information, and before the service call response is acquired, the method further comprises:
and when the number of times of forwarding the service call response to the gateway of the second network domain is greater than or equal to the retry threshold, acquiring fusing information from the fusing address and sending the fusing information to the terminal.
3. The method according to claim 1, wherein the method further comprises:
receiving a heartbeat message sent by a gateway of the second network domain, wherein the heartbeat message at least comprises: service status information;
Generating a service suspension instruction when the service state information is abnormal state information, wherein the service suspension instruction is used for indicating a gateway of the first network domain and a gateway of the second network domain to suspend providing services;
and when the service state information is normal state information, generating a service restoration instruction, wherein the service restoration instruction is used for indicating the gateway of the first network domain and the gateway of the second network domain to restore and provide services.
4. The method of claim 3, wherein the routing relationship further comprises: the routing weight corresponding to the routing information, the method further comprises:
when a service suspension instruction is detected, modifying the routing weight corresponding to the service information from the forwarding weight to the suspension weight, and synchronizing the modified routing relationship to a gateway of the second network domain;
when a service restoration instruction is detected, modifying the routing weight corresponding to the service information from a pause weight to a forwarding weight, and synchronizing the modified routing relationship to a gateway of the second network domain;
after the service call request sent by the receiving terminal, the method further comprises:
stopping processing the service call request when the routing weight corresponding to the routing information is a pause weight;
And when the routing weight corresponding to the routing information is forwarding weight, continuing to process the service call request.
5. A method according to claim 3, wherein after said receiving the heartbeat message sent by the gateway of the second network domain, the method further comprises:
when the difference value between the time of last receiving the heartbeat message and the current time is greater than or equal to a time threshold value, displaying prompt information, wherein the heartbeat message further comprises: routing state information.
6. The method of claim 1, wherein after said querying the routing relationship for the routing address corresponding to the routing information, the method further comprises:
when the routing address points to the gateway of the first network domain, a service call response is obtained from the local according to the routing address, and the service call response is sent to the terminal;
after the sending the service invocation response to the terminal, the method further comprises:
and obtaining a processing record of the service call request from the gateway of the second network domain, and generating a management log.
7. A request processing apparatus, the apparatus being applied to a gateway of a first network domain, the gateway of the first network domain being communicatively coupled to a gateway of a second network domain, the apparatus comprising:
The receiving module is used for receiving a service call request sent by the terminal, and the service call request at least comprises: checking parameters and routing information;
the query module is used for querying a routing address corresponding to the routing information in a routing relation after the verification parameter passes the authentication, wherein the routing relation is generated through the negotiation between a gateway of a first network domain and a gateway of a second network domain;
the sending module is used for obtaining a service call response by forwarding the service call request to the gateway of the second network domain when the routing address points to the gateway of the second network domain, and sending the service call response to the terminal;
the apparatus further comprises:
the establishing module is configured to receive a service registration request, where the service registration request at least includes: service information, wherein the service registration request is a service registration request of all services in the first network domain and the second network domain; generating the routing information according to the service information, and determining a service network domain corresponding to the routing information; establishing a corresponding relation between the routing information and a routing address of a gateway in the service network domain to obtain the routing relation; and synchronizing the routing relationship to a gateway of a second network domain.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the request processing method of any of claims 1 to 6 when the computer program is executed.
9. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the request processing method of any of claims 1 to 6.
CN202110202139.4A 2021-02-23 2021-02-23 Request processing method, request processing device, electronic equipment and storage medium Active CN113014640B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110202139.4A CN113014640B (en) 2021-02-23 2021-02-23 Request processing method, request processing device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110202139.4A CN113014640B (en) 2021-02-23 2021-02-23 Request processing method, request processing device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113014640A CN113014640A (en) 2021-06-22
CN113014640B true CN113014640B (en) 2023-06-20

Family

ID=76407906

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110202139.4A Active CN113014640B (en) 2021-02-23 2021-02-23 Request processing method, request processing device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113014640B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114531485A (en) * 2021-12-28 2022-05-24 望海康信(北京)科技股份公司 Data transmission method, system and corresponding equipment and storage medium
CN114285852B (en) * 2021-12-28 2023-12-26 杭州数梦工场科技有限公司 Service calling method and device based on multi-stage service platform

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017017503A1 (en) * 2015-07-30 2017-02-02 Telefonaktiebolaget Lm Ericsson (Publ) Method and apparatus for using sip-based communications in machine-to-machine networks
CN110493352A (en) * 2019-08-30 2019-11-22 南京联创互联网技术有限公司 A kind of unified gateway service system and its method of servicing based on WEB middleware
CN110661836A (en) * 2018-06-29 2020-01-07 杭州海康威视系统技术有限公司 Message routing method, device and system, and storage medium
CN110740187A (en) * 2019-10-25 2020-01-31 家乡互动(厦门)网络科技有限公司 micro service architecture realization method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8626879B2 (en) * 2009-12-22 2014-01-07 Sling Media, Inc. Systems and methods for establishing network connections using local mediation services

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017017503A1 (en) * 2015-07-30 2017-02-02 Telefonaktiebolaget Lm Ericsson (Publ) Method and apparatus for using sip-based communications in machine-to-machine networks
CN110661836A (en) * 2018-06-29 2020-01-07 杭州海康威视系统技术有限公司 Message routing method, device and system, and storage medium
CN110493352A (en) * 2019-08-30 2019-11-22 南京联创互联网技术有限公司 A kind of unified gateway service system and its method of servicing based on WEB middleware
CN110740187A (en) * 2019-10-25 2020-01-31 家乡互动(厦门)网络科技有限公司 micro service architecture realization method

Also Published As

Publication number Publication date
CN113014640A (en) 2021-06-22

Similar Documents

Publication Publication Date Title
US10050899B2 (en) Data processing method, apparatus, client, server and system
CN108737132B (en) Alarm information processing method and device
CN108400904B (en) Health examination method and device based on micro-service architecture
CN113014640B (en) Request processing method, request processing device, electronic equipment and storage medium
JP2002108728A (en) Method for inserting fault information and provider facility
CN111046310B (en) Page processing method, device, server and computer readable storage medium
CN110851290A (en) Data synchronization method and device, electronic equipment and storage medium
CN111953770B (en) Route forwarding method and device, route equipment and readable storage medium
CN108366098B (en) Data interaction method and device for network nodes
CN116302352A (en) Cluster disaster recovery processing method and device, electronic equipment and storage medium
CN109600254B (en) Method for generating full-link log and related system
CN114363334A (en) Network configuration method, device and equipment for cloud system and cloud desktop virtual machine
JP5610654B2 (en) Apparatus for providing terminal management package and method for receiving terminal management package
CN110572857B (en) Network connection processing method and device, electronic equipment and storage medium
CN109495319B (en) Method, device and equipment for determining fault information of CDN node
CN109729159B (en) Method and device for reminding loss of network equipment
US20130179569A1 (en) Systems and methods for gateway status information handling
CN107066373B (en) Control processing method and device
CN113296911B (en) Cluster calling method, cluster calling device, electronic equipment and readable storage medium
CN114185804A (en) Interface testing method and device and terminal equipment
CN108880994B (en) Method and device for retransmitting mails
US8352553B2 (en) Electronic mail connector
US8412817B1 (en) Load balancing voicemail server system
CN114041130A (en) URL management in image forming apparatus
CN112261051B (en) User registration method, device and system

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