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

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

Info

Publication number
CN112751935A
CN112751935A CN202011626488.0A CN202011626488A CN112751935A CN 112751935 A CN112751935 A CN 112751935A CN 202011626488 A CN202011626488 A CN 202011626488A CN 112751935 A CN112751935 A CN 112751935A
Authority
CN
China
Prior art keywords
configuration information
routing configuration
information
target
node
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
CN202011626488.0A
Other languages
Chinese (zh)
Other versions
CN112751935B (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.)
Nanjing Cloud Cabinet Network Technology Co ltd
Original Assignee
Jiangsu Cloudbox Network 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 Jiangsu Cloudbox Network Technology Co ltd filed Critical Jiangsu Cloudbox Network Technology Co ltd
Priority to CN202011626488.0A priority Critical patent/CN112751935B/en
Publication of CN112751935A publication Critical patent/CN112751935A/en
Application granted granted Critical
Publication of CN112751935B publication Critical patent/CN112751935B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • 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
    • H04L67/63Routing a service request depending on the request content or context

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application provides a request processing method and device, electronic equipment and a storage medium, and relates to the technical field of computers. The method is applied to a server node in a distributed system, and comprises the steps of receiving a call request sent by a sending end, wherein the sending end is a user terminal initiating the call request or a server corresponding to an application service in the distributed system; if the calling request does not carry the target route configuration information, taking the local route configuration information of the current node as the target route configuration information; and if the current node has a downstream node with the routing configuration information matched with the target routing configuration information, forwarding the invoking request to the downstream node with the highest matching degree of the routing configuration information and the target routing configuration information. The request processing method, the request processing device, the electronic equipment and the storage medium can avoid waste of server resources and reduce maintenance cost.

Description

Request processing method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a request processing method and apparatus, an electronic device, and a storage medium.
Background
With the development of computer technology and internet technology, a single application that packages each component related to one system into an integrated structure and performs deployment and operation cannot meet the requirements of a large-scale system, so that a distributed system is gradually widely applied, the distributed system splits one large-scale system into a plurality of different subsystems, each subsystem is deployed and operated on different network computers, and communication and coordination can be completed only through message transmission among the subsystems.
The development of a distributed system usually needs multiple sets of environments, such as a development environment, a test environment, a regression environment and the like, each set of environment may have multiple concurrent versions at the same time in the development and test stages, application services among the versions cannot be serially adjusted, most services generally tend to be stable and cannot be frequently changed, therefore, a set of complete system needs to be deployed for each environment to meet the use requirements of each stage, not only is server resources wasted, but also the maintenance cost of each environment is increased.
Therefore, how to provide an effective solution to avoid the waste of server resources and reduce the maintenance cost has become an urgent problem in the prior art.
Disclosure of Invention
The embodiment of the application provides a request processing method, which is used for solving the problems of resource waste and high maintenance cost of a server in a distributed system in the prior art.
The embodiment of the application provides a request processing device, which is used for solving the problems of resource waste and high maintenance cost of a server in a distributed system in the prior art.
The embodiment of the application also provides the electronic equipment and a computer readable storage medium.
The embodiment of the application adopts the following technical scheme:
in a first aspect, an embodiment of the present application provides a request processing method, which is applied to a server node in a distributed system, and includes:
receiving a calling request sent by a sending end, wherein the sending end is a user terminal initiating the calling request or a server corresponding to an application service in a distributed system;
if the calling request does not carry target route configuration information, taking local route configuration information of the current node as the target route configuration information;
if the current node has a downstream node with the routing configuration information matched with the target routing configuration information, forwarding the calling request to the downstream node with the highest matching degree of the routing configuration information and the target routing configuration information;
the routing configuration information is preconfigured by the registration center for the server corresponding to each application service in the distributed system, the target routing configuration information is routing configuration information of one node, and the application services of the nodes corresponding to the two matched routing configuration information are two application services invoked when the same function is requested.
In one possible design, the routing configuration information includes context information and packet information of the application service, and the routing configuration information matches with the target routing configuration information, including:
the environment information in the routing configuration information is the same as the environment information in the target routing configuration information, and the grouping information in the routing configuration information is different from the grouping information in the target routing configuration information; or
The environment information in the routing configuration information is the same as the environment information in the target routing configuration information, and the grouping information in the routing configuration information is the same as the grouping information in the target routing configuration information.
In a possible design, the forwarding the invocation request to the downstream node whose routing configuration information matches the target routing configuration information with the highest degree includes:
if the environment information and the grouping information in the routing configuration information exist, and the first downstream node is matched with the environment information and the grouping information in the target routing configuration information in a one-to-one correspondence mode, forwarding the calling request to the first downstream node;
and if no downstream node with the grouping information in the routing configuration information matched with the grouping information in the target routing configuration information exists, forwarding the calling request to a second downstream node with the grouping information in the routing configuration information matched with the environment information in the target routing configuration information and the grouping information in the routing configuration information being preset reference grouping information.
In one possible design, the method further includes:
and if the sending end is the user terminal initiating the call request, judging that the call request does not carry the target route configuration information.
In one possible design, the method further includes:
and receiving the local routing configuration information sent by the registration center.
In a second aspect, an embodiment of the present application provides a request processing apparatus, which is applied to a server node in a distributed system, and includes:
a receiving unit, configured to receive a call request sent by a sending end, where the sending end is a user terminal initiating the call request or a server corresponding to an application service in a distributed system;
the first judging unit is used for judging whether the calling request carries target route configuration information or not;
an updating unit, configured to, if the invocation request does not carry target route configuration information, use local route configuration information of a current node as the target route configuration information;
the second judging unit is used for judging whether the current node has a downstream node of which the routing configuration information is matched with the target routing configuration information;
the forwarding unit is used for forwarding the calling request to a downstream node with the highest matching degree of the routing configuration information and the target routing configuration information if the downstream node with the routing configuration information matched with the target routing configuration information exists in the current node;
the routing configuration information is preconfigured by the registration center for the server corresponding to each application service in the distributed system, the target routing configuration information is routing configuration information of one node, and the application services of the nodes corresponding to the two matched routing configuration information are two application services invoked when the same function is requested.
In one possible design, the routing configuration information includes context information and packet information of the application service, and the routing configuration information matches with the target routing configuration information, including:
the environment information in the routing configuration information is the same as the environment information in the target routing configuration information, and the grouping information in the routing configuration information is different from the grouping information in the target routing configuration information; or
The environment information in the routing configuration information is the same as the environment information in the target routing configuration information, and the grouping information in the routing configuration information is the same as the grouping information in the target routing configuration information.
In a possible design, when the forwarding unit is configured to forward the invocation request to a downstream node having a highest matching degree between the routing configuration information and the target routing configuration information, the forwarding unit is specifically configured to:
if the environment information and the grouping information in the routing configuration information exist, and the first downstream node is matched with the environment information and the grouping information in the target routing configuration information in a one-to-one correspondence mode, forwarding the calling request to the first downstream node;
and if no downstream node with the grouping information in the routing configuration information matched with the grouping information in the target routing configuration information exists, forwarding the calling request to a second downstream node with the grouping information in the routing configuration information matched with the environment information in the target routing configuration information and the grouping information in the routing configuration information being preset reference grouping information.
In one possible design, the request processing apparatus further includes:
and a third determining unit, configured to determine that the target route configuration information is not carried in the call request if the sending end is the user terminal that initiates the call request.
In one possible design, the receiving unit is further configured to receive the local routing configuration information sent by the registry.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete mutual communication through the bus;
a memory for storing a computer program;
the processor is used for executing the program stored in the memory and realizing the following processes:
receiving a calling request sent by a sending end, wherein the sending end is a user terminal initiating the calling request or a server corresponding to an application service in a distributed system;
if the calling request does not carry target route configuration information, taking local route configuration information of the current node as the target route configuration information;
if the current node has a downstream node with the routing configuration information matched with the target routing configuration information, forwarding the calling request to the downstream node with the highest matching degree of the routing configuration information and the target routing configuration information;
the routing configuration information is preconfigured by the registration center for the server corresponding to each application service in the distributed system, the target routing configuration information is routing configuration information of one node, and the application services of the nodes corresponding to the two matched routing configuration information are two application services invoked when the same function is requested.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, and when executed by a processor, the computer program implements the following procedures:
receiving a calling request sent by a sending end, wherein the sending end is a user terminal initiating the calling request or a server corresponding to an application service in a distributed system;
if the calling request does not carry target route configuration information, taking local route configuration information of the current node as the target route configuration information;
if the current node has a downstream node with the routing configuration information matched with the target routing configuration information, forwarding the calling request to the downstream node with the highest matching degree of the routing configuration information and the target routing configuration information;
the routing configuration information is preconfigured by the registration center for the server corresponding to each application service in the distributed system, the target routing configuration information is routing configuration information of one node, and the application services of the nodes corresponding to the two matched routing configuration information are two application services invoked when the same function is requested.
The above-mentioned at least one technical scheme that this application one or more embodiments adopted can reach following beneficial effect:
when the calling request does not carry the target routing configuration information, the local routing configuration information of the current node is used as the target routing configuration information, and when the current node has a downstream node with the routing configuration information matched with the target routing configuration information, the calling request is forwarded to the downstream node with the highest matching degree of the routing configuration information and the target routing configuration information. Therefore, a complete system does not need to be deployed for each environment in the distributed system, so that the waste of server resources can be avoided, and the maintenance cost is reduced.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure in any way. In the drawings:
fig. 1 is a schematic application environment diagram of a request processing method, an apparatus, an electronic device, and a storage medium according to an embodiment of the present application.
Fig. 2 is a schematic diagram of call logic of an application service that needs to be called in different environments for the same function according to an embodiment of the present application.
Fig. 3 is a flowchart illustrating a request processing method according to an embodiment of the present application.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Fig. 5 is a schematic structural diagram of a request processing apparatus according to an embodiment of the present application.
Detailed Description
In order to make the purpose, technical solutions and advantages of this document more clear, the technical solutions of this document will be clearly and completely described below with reference to specific embodiments of this document and corresponding drawings. It is to be understood that the embodiments described are only a few embodiments of this document, and not all embodiments. All other embodiments obtained by a person skilled in the art without making creative efforts based on the embodiments in this document belong to the protection scope of this document.
In order to avoid waste of server resources and reduce maintenance cost, embodiments of the present application provide a request processing method, an apparatus, an electronic device, and a storage medium, where the request processing method, the apparatus, the electronic device, and the storage medium do not need to deploy a complete system for each environment in a distributed system, so that waste of server resources can be avoided and maintenance cost can be reduced.
First, in order to more intuitively understand the scheme provided by the embodiment of the present application, a system architecture of the request processing scheme provided by the embodiment of the present application is described below with reference to fig. 1.
Fig. 1 is a schematic application environment diagram of a request processing method, an apparatus, an electronic device, and a storage medium according to one or more embodiments of the present application. As shown in fig. 1, the distributed system is communicatively connected to the user terminal and the registry, respectively, for data exchange or communication. The distributed system comprises a plurality of servers respectively, and each server is provided with one application service. For convenience of description, in the embodiment of the present application, a server corresponding to an application service is referred to as a node.
The distributed system comprises a plurality of servers respectively, each server is provided with an application service, different versions can be deployed for the application service with the same function in the distributed system, and the application services with different versions correspond to different application environments respectively, such as a development environment, a test environment, a regression environment and the like. When a certain function is requested in different application environments, part of application services of different versions need to be called.
Fig. 2 is a schematic diagram illustrating the calling logic of the application service that needs to be called in different environments for the same function. As shown in fig. 2, for a certain function, the corresponding application service includes an application service a, an application service B, an application service C, an application service D, and an application service E, the application service a, the application service B, the application service C, the application service D, and the application service E are benchmark version application services in the software development process, an application service a1 for a first application environment (e.g., a test environment) is developed on the basis of the application service a, an application service D1 for the first application environment is developed on the basis of the application service D, an application service C2 for a second application environment (e.g., a regression environment) is developed on the basis of the application service C, and an application service E2 for the second application environment is developed on the basis of the application service E. The application services to be called in the first application environment requesting the function are application services a1, B, C, D1 and E in that order, and the application services to be called in the second application environment requesting the function are application services A, B, C2, D and E2 in that order.
If corresponding application services are configured for each application environment, for example, one application service B is configured for each of the first application environment and the second application environment in fig. 2, more server resources are occupied due to the configuration of the same application service, and the maintenance cost is increased.
Based on this, the embodiment of the present application provides a request processing method, which can be applied to one of the nodes in the distributed system.
Specifically, the flow of the request processing method is shown in fig. 3, and may include the following steps:
step S301, receiving a call request sent by a sending end.
The sending end is a user terminal initiating a call request or a server corresponding to an application service in the distributed system. The call request is used for requesting to call a function in an application environment (such as a test environment or a regression environment).
Step S302, if the calling request does not carry the target route configuration information, the local route configuration information of the current node is used as the target route configuration information.
The routing configuration information is pre-configured by the registry for the server corresponding to each application service in the distributed system, and the target routing configuration information may be routing configuration information of any one of the nodes.
In the embodiment of the application, the registry pre-configures routing configuration information for a server corresponding to each application service in the distributed system, wherein the routing configuration information includes environment information and grouping information of the application service. In the embodiment of the application, the environment information of each application service is the same. Each application service corresponds to different application environments, and the grouping information of the application services is different; the grouping information is the same corresponding to the same application environment. For example, the environment information between the application services for the test environment is the same, and the environment information between the application services for the regression environment is the same, but the group information of the application services for the test environment is different from the group information of the application services for the regression environment.
Still based on the example illustrated in fig. 2, the environment information of the application services A, B, C, D, E, A1, D1, C2, and E2 (in the routing information configured by the corresponding servers) are all the same, the grouping information of the application services A, B, C, D and E is the same, the grouping information of the application services a1 and D1 is the same, and the grouping information of C2 and E2 is the same. For example, the context information of the application services A, B, C, D, E, A1, D1, C2, and E2 may all be set to stg. The grouping information of the application services A, B, C, D and E may be set to group, the grouping information of the application services a1 and D1 may be set to group1, and the grouping information of the application services C2 and E2 may be set to group 2.
After the registry configures the routing configuration information for the server corresponding to each application service in the distributed system, the configured routing configuration information can be sent to the corresponding server (node).
After receiving the call request sent by the sending end, the current node (the node receiving the call request) calls the application service of the current node, and judges whether the call request carries target route configuration information.
When judging whether the calling request carries the target route configuration information, if the sending end is the user terminal initiating the calling request, the calling request can be judged not to carry the target route configuration information because the route configuration information is not configured for the user terminal in the registration. At this time, the current node may use the local routing configuration information as the target routing configuration information carried in the invocation request.
Still based on the above example, assuming that the current node is the server of the application service a1, the environment information in the local routing configuration information of the current node is stg, and the grouping information in the local routing configuration information of the current node is group1, the environment information in the target routing configuration information is set to stg at this time, and the grouping information in the target routing configuration information is set to group 1.
Step S303, if the current node has a downstream node whose routing configuration information matches with the target routing configuration information, the call request is forwarded to the downstream node whose routing configuration information matches with the target routing configuration information with the highest degree.
In the embodiment of the application, the application services of the nodes corresponding to the two matched routing configuration information are two application services called when the same function is requested. For example, still based on the example listed in step S302, for a certain function, the corresponding application services include application service a, application service B, application service C, application service D, and application service E. Since the application service a and the application service B are application services for the same function, and the application service a and the application service B are invoked when the function is requested, the routing configuration information of the node corresponding to the application service a is the same as the routing configuration information of the node corresponding to the application service B.
Specifically, the matching between the routing configuration information and the target routing configuration information may be that the environment information in the routing configuration information is the same as the environment information in the target routing configuration information, and the grouping information in the routing configuration information is different from the grouping information in the target routing configuration information; the context information in the routing configuration information may be the same as the context information in the target routing configuration information, and the grouping information in the routing configuration information may be the same as the grouping information in the target routing configuration information.
And if the current node has a downstream node with the routing configuration information matched with the target routing configuration information, forwarding the invoking request to the downstream node with the highest matching degree of the routing configuration information and the target routing configuration information.
Specifically, if there is a first downstream node in which the environment information and the grouping information in the routing configuration information are in one-to-one correspondence with the environment information and the grouping information in the target routing configuration information, the invocation request is forwarded to the first downstream node.
And if no downstream node with the grouping information in the routing configuration information matched with the grouping information in the target routing configuration information exists, forwarding the calling request to a second downstream node with the grouping information in the routing configuration information matched with the environment information in the target routing configuration information and the grouping information in the routing configuration information being preset reference grouping information.
In the embodiment of the present application, the packet information in the routing configuration information of the reference version application service is the reference packet information. The grouping information in the routing configuration information corresponding to the application service A, B, C, D and E as described in fig. 2 is reference grouping information, i.e. group.
When sending the configured routing configuration information to the corresponding node, the registry also sends node information of a downstream node of each node to each node, where the node information is related information for identifying the node, and for example, the node information may be routing configuration information or an IP or domain name for identifying the node. The node downstream of the node refers to a node (server) corresponding to an application service that is possibly called next to the application service corresponding to the current node when a certain function is requested. As shown in fig. 2, the next application service that may be invoked by application service B is application service C and application service C2, and therefore the downstream node of the node corresponding to application service B is the node corresponding to application service C and the node corresponding to application service C2.
Still based on the example in step S302, assuming that the user needs to request the function in the first application environment, a call request may be initiated to the server of the application service a1 through the user terminal, where the current node is the server of the application service a1, the sender of the current node is the user terminal initiating the request, the server of the application service a1 calls the application server a and determines that the call request does not carry the target route configuration information, and the local route configuration information (environment information stg and group information group1) is used as the target route configuration information carried in the call request. The downstream node of the current node is only the server of the application service B, and the environment information in the routing configuration information of the server of the application service B is stg, which is the same as the environment information in the target routing configuration information, so that the routing configuration information of the server corresponding to the application service B is matched with the target routing configuration information with the highest matching degree, and at this time, the call request is forwarded to the server corresponding to the application service B. At this time, the server corresponding to the application service B becomes the current node and calls the application service B, the downstream nodes of the servers corresponding to the application service B are the server corresponding to the application service C and the server corresponding to the application service C2, since the group information in the routing configuration information of the server corresponding to the application service C is group, the group information in the routing configuration information of the server corresponding to the application service C2 is group2, and both are different from the group information group1 in the target routing configuration information, the call request is forwarded to the second downstream node whose environment information in the routing configuration information matches the environment information in the target routing configuration information, and whose group information is the preset reference group information in the routing configuration information. And the packet information in the routing configuration information of the server corresponding to the application service C is preset reference packet information, so that the server corresponding to the application service C is a second downstream node, and the calling request is forwarded to the server corresponding to the application service C. And at the moment, the server corresponding to the application service C is the current node and calls the application service C. And repeating the above process until the current node has no downstream node with the route configuration information matched with the target route configuration information, and ending the whole process.
According to the request processing method provided by the embodiment of the application, when the calling request does not carry the target routing configuration information, the local routing configuration information of the current node is used as the target routing configuration information and an application server of the local node is called, and when the current node has the downstream node of which the routing configuration information is matched with the target routing configuration information, the calling request is forwarded to the downstream node of which the matching degree of the routing configuration information and the target routing configuration information is highest until the current node does not have the downstream node of which the routing configuration information is matched with the target routing configuration information. Therefore, when the same function is requested to be called in different environments, if the same application service needs to be called, only one server of the application service needs to be deployed in the distributed system, and one server of the application service does not need to be deployed for different environments, so that the occupation of server resources can be reduced, and the maintenance cost can be reduced.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application. Referring to fig. 4, at a hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 4, but that does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form the request processing device on the logic level. The processor is used for executing the program stored in the memory and is specifically used for executing the following operations:
receiving a calling request sent by a sending end, wherein the sending end is a user terminal initiating the calling request or a server corresponding to an application service in a distributed system;
if the calling request does not carry target route configuration information, taking local route configuration information of the current node as the target route configuration information;
if the current node has a downstream node with the routing configuration information matched with the target routing configuration information, forwarding the calling request to the downstream node with the highest matching degree of the routing configuration information and the target routing configuration information;
the routing configuration information is preconfigured by the registration center for the server corresponding to each application service in the distributed system, the target routing configuration information is routing configuration information of one node, and the application services of the nodes corresponding to the two matched routing configuration information are two application services invoked when the same function is requested.
The method executed by the request processing device according to the embodiment shown in fig. 4 of the present application may be applied to or implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in one or more embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with one or more embodiments of the present application may be embodied directly in the hardware decoding processor, or in a combination of the hardware and software modules included in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The electronic device may also execute the method of fig. 3 and implement the functions of the request processing apparatus in the embodiment shown in fig. 4, which are not described herein again in this embodiment of the present application.
Of course, besides the software implementation, the electronic device of the present application does not exclude other implementations, such as a logic device or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or a logic device.
Embodiments of the present application also provide a computer-readable storage medium storing one or more programs, where the one or more programs include instructions, which when executed by a portable electronic device including a plurality of application programs, enable the portable electronic device to perform the method of the embodiment shown in fig. 3, and are specifically configured to:
receiving a calling request sent by a sending end, wherein the sending end is a user terminal initiating the calling request or a server corresponding to an application service in a distributed system;
if the calling request does not carry target route configuration information, taking local route configuration information of the current node as the target route configuration information;
if the current node has a downstream node with the routing configuration information matched with the target routing configuration information, forwarding the calling request to the downstream node with the highest matching degree of the routing configuration information and the target routing configuration information;
the routing configuration information is preconfigured by the registration center for the server corresponding to each application service in the distributed system, the target routing configuration information is routing configuration information of one node, and the application services of the nodes corresponding to the two matched routing configuration information are two application services invoked when the same function is requested.
Fig. 5 is a schematic structural diagram of a request processing apparatus according to an embodiment of the present application, where the request processing apparatus is applied to a server node in a distributed system. Referring to fig. 5, in one software implementation, a request processing apparatus includes:
a receiving unit, configured to receive a call request sent by a sending end, where the sending end is a user terminal initiating the call request or a server corresponding to an application service in a distributed system;
the first judging unit is used for judging whether the calling request carries target route configuration information or not;
an updating unit, configured to, if the invocation request does not carry target route configuration information, use local route configuration information of a current node as the target route configuration information;
the second judging unit is used for judging whether the current node has a downstream node of which the routing configuration information is matched with the target routing configuration information;
the forwarding unit is used for forwarding the calling request to a downstream node with the highest matching degree of the routing configuration information and the target routing configuration information if the downstream node with the routing configuration information matched with the target routing configuration information exists in the current node;
the routing configuration information is preconfigured by the registration center for the server corresponding to each application service in the distributed system, the target routing configuration information is routing configuration information of one node, and the application services of the nodes corresponding to the two matched routing configuration information are two application services invoked when the same function is requested.
In one possible design, the routing configuration information includes context information and packet information of the application service, and the routing configuration information matches with the target routing configuration information, including:
the environment information in the routing configuration information is the same as the environment information in the target routing configuration information, and the grouping information in the routing configuration information is different from the grouping information in the target routing configuration information; or
The environment information in the routing configuration information is the same as the environment information in the target routing configuration information, and the grouping information in the routing configuration information is the same as the grouping information in the target routing configuration information.
In a possible design, when the forwarding unit is configured to forward the invocation request to a downstream node having a highest matching degree between the routing configuration information and the target routing configuration information, the forwarding unit is specifically configured to:
if the environment information and the grouping information in the routing configuration information exist, and the first downstream node is matched with the environment information and the grouping information in the target routing configuration information in a one-to-one correspondence mode, forwarding the calling request to the first downstream node;
and if no downstream node with the grouping information in the routing configuration information matched with the grouping information in the target routing configuration information exists, forwarding the calling request to a second downstream node with the grouping information in the routing configuration information matched with the environment information in the target routing configuration information and the grouping information in the routing configuration information being preset reference grouping information.
In one possible design, the request processing apparatus further includes:
and a third determining unit, configured to determine that the target route configuration information is not carried in the call request if the sending end is the user terminal that initiates the call request.
In one possible design, the receiving unit is further configured to receive the local routing configuration information sent by the registry.
The foregoing description of specific embodiments of the present application has been presented. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
In short, the above description is only a preferred embodiment of this document, and is not intended to limit the scope of protection of this document. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this document shall be included in the protection scope of this document.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that 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.
All the embodiments in this document are described in a progressive manner, and the same and similar parts among the embodiments can be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.

Claims (10)

1. A request processing method is applied to a server node in a distributed system, and is characterized by comprising the following steps:
receiving a calling request sent by a sending end, wherein the sending end is a user terminal initiating the calling request or a server corresponding to an application service in a distributed system;
if the calling request does not carry target route configuration information, taking local route configuration information of the current node as the target route configuration information;
if the current node has a downstream node with the routing configuration information matched with the target routing configuration information, forwarding the calling request to the downstream node with the highest matching degree of the routing configuration information and the target routing configuration information;
the routing configuration information is preconfigured by the registration center for the server corresponding to each application service in the distributed system, the target routing configuration information is routing configuration information of one node, and the application services of the nodes corresponding to the two matched routing configuration information are two application services invoked when the same function is requested.
2. The method of claim 1, wherein the routing configuration information comprises context information and packet information of the application service, and wherein the routing configuration information is matched with the target routing configuration information, and wherein the method comprises:
the environment information in the routing configuration information is the same as the environment information in the target routing configuration information, and the grouping information in the routing configuration information is different from the grouping information in the target routing configuration information; or
The environment information in the routing configuration information is the same as the environment information in the target routing configuration information, and the grouping information in the routing configuration information is the same as the grouping information in the target routing configuration information.
3. The method of claim 2, wherein forwarding the invocation request to a downstream node having a highest matching degree between the routing configuration information and the target routing configuration information comprises:
if the environment information and the grouping information in the routing configuration information exist, and the first downstream node is matched with the environment information and the grouping information in the target routing configuration information in a one-to-one correspondence mode, forwarding the calling request to the first downstream node;
and if no downstream node with the grouping information in the routing configuration information matched with the grouping information in the target routing configuration information exists, forwarding the calling request to a second downstream node with the grouping information in the routing configuration information matched with the environment information in the target routing configuration information and the grouping information in the routing configuration information being preset reference grouping information.
4. The method of claim 1, further comprising:
and if the sending end is the user terminal initiating the call request, judging that the call request does not carry the target route configuration information.
5. The method of claim 1, further comprising:
and receiving the local routing configuration information sent by the registration center.
6. A request processing apparatus applied to a server node in a distributed system, comprising:
a receiving unit, configured to receive a call request sent by a sending end, where the sending end is a user terminal initiating the call request or a server corresponding to an application service in a distributed system;
the first judging unit is used for judging whether the calling request carries target route configuration information or not;
an updating unit, configured to, if the invocation request does not carry target route configuration information, use local route configuration information of a current node as the target route configuration information;
the second judging unit is used for judging whether the current node has a downstream node of which the routing configuration information is matched with the target routing configuration information;
the forwarding unit is used for forwarding the calling request to a downstream node with the highest matching degree of the routing configuration information and the target routing configuration information if the downstream node with the routing configuration information matched with the target routing configuration information exists in the current node;
the routing configuration information is preconfigured by the registration center for the server corresponding to each application service in the distributed system, the target routing configuration information is routing configuration information of one node, and the application services of the nodes corresponding to the two matched routing configuration information are two application services invoked when the same function is requested.
7. The request processing apparatus of claim 6, wherein the routing configuration information comprises context information and packet information of the application service, and the routing configuration information is matched with the target routing configuration information, and comprises:
the environment information in the routing configuration information is the same as the environment information in the target routing configuration information, and the grouping information in the routing configuration information is different from the grouping information in the target routing configuration information; or
The environment information in the routing configuration information is the same as the environment information in the target routing configuration information, and the grouping information in the routing configuration information is the same as the grouping information in the target routing configuration information.
8. The device according to claim 7, wherein the forwarding unit, when configured to forward the invocation request to the downstream node whose routing configuration information matches the target routing configuration information with the highest degree, is specifically configured to:
if the environment information and the grouping information in the routing configuration information exist, and the first downstream node is matched with the environment information and the grouping information in the target routing configuration information in a one-to-one correspondence mode, forwarding the calling request to the first downstream node;
and if no downstream node with the grouping information in the routing configuration information matched with the grouping information in the target routing configuration information exists, forwarding the calling request to a second downstream node with the grouping information in the routing configuration information matched with the environment information in the target routing configuration information and the grouping information in the routing configuration information being preset reference grouping information.
9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing the communication between the processor and the memory through the bus;
a memory for storing a computer program;
the processor is used for executing the program stored in the memory and realizing the following processes:
receiving a calling request sent by a sending end, wherein the sending end is a user terminal initiating the calling request or a server corresponding to an application service in a distributed system;
if the calling request does not carry target route configuration information, taking local route configuration information of the current node as the target route configuration information;
if the current node has a downstream node with the routing configuration information matched with the target routing configuration information, forwarding the calling request to the downstream node with the highest matching degree of the routing configuration information and the target routing configuration information;
the routing configuration information is preconfigured by the registration center for the server corresponding to each application service in the distributed system, the target routing configuration information is routing configuration information of one node, and the application services of the nodes corresponding to the two matched routing configuration information are two application services invoked when the same function is requested.
10. A computer-readable storage medium, in which a computer program is stored, which computer program, when being executed by a processor, carries out the following procedure:
receiving a calling request sent by a sending end, wherein the sending end is a user terminal initiating the calling request or a server corresponding to an application service in a distributed system;
if the calling request does not carry target route configuration information, taking local route configuration information of the current node as the target route configuration information;
if the current node has a downstream node with the routing configuration information matched with the target routing configuration information, forwarding the calling request to the downstream node with the highest matching degree of the routing configuration information and the target routing configuration information;
the routing configuration information is preconfigured by the registration center for the server corresponding to each application service in the distributed system, the target routing configuration information is routing configuration information of one node, and the application services of the nodes corresponding to the two matched routing configuration information are two application services invoked when the same function is requested.
CN202011626488.0A 2020-12-31 2020-12-31 Request processing method and device, electronic equipment and storage medium Active CN112751935B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011626488.0A CN112751935B (en) 2020-12-31 2020-12-31 Request processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011626488.0A CN112751935B (en) 2020-12-31 2020-12-31 Request processing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112751935A true CN112751935A (en) 2021-05-04
CN112751935B CN112751935B (en) 2022-08-12

Family

ID=75650542

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011626488.0A Active CN112751935B (en) 2020-12-31 2020-12-31 Request processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112751935B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115277862A (en) * 2022-06-21 2022-11-01 阿里巴巴(中国)有限公司 Container-based resource scheduling method and device
CN115866092A (en) * 2022-11-24 2023-03-28 中国联合网络通信集团有限公司 Data forwarding method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070230485A1 (en) * 2006-03-30 2007-10-04 Fujitsu Limited Service providing method, computer-readable recording medium containing service providing program, and service providing apparatus
WO2015184840A1 (en) * 2014-09-30 2015-12-10 中兴通讯股份有限公司 Method, apparatus and system for acquiring response message, and method, apparatus and system for routing response message
CN106656650A (en) * 2016-10-08 2017-05-10 腾讯科技(深圳)有限公司 Business test environment generation method and system and business test method, device and system
CN110557445A (en) * 2019-08-22 2019-12-10 上海艾融软件股份有限公司 Access request routing method and device, storage medium and electronic equipment
CN110958306A (en) * 2019-11-18 2020-04-03 广西电网有限责任公司电力科学研究院 Data request unified exchange mechanism based on micro-service

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070230485A1 (en) * 2006-03-30 2007-10-04 Fujitsu Limited Service providing method, computer-readable recording medium containing service providing program, and service providing apparatus
WO2015184840A1 (en) * 2014-09-30 2015-12-10 中兴通讯股份有限公司 Method, apparatus and system for acquiring response message, and method, apparatus and system for routing response message
CN106656650A (en) * 2016-10-08 2017-05-10 腾讯科技(深圳)有限公司 Business test environment generation method and system and business test method, device and system
CN110557445A (en) * 2019-08-22 2019-12-10 上海艾融软件股份有限公司 Access request routing method and device, storage medium and electronic equipment
CN110958306A (en) * 2019-11-18 2020-04-03 广西电网有限责任公司电力科学研究院 Data request unified exchange mechanism based on micro-service

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115277862A (en) * 2022-06-21 2022-11-01 阿里巴巴(中国)有限公司 Container-based resource scheduling method and device
CN115866092A (en) * 2022-11-24 2023-03-28 中国联合网络通信集团有限公司 Data forwarding method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN112751935B (en) 2022-08-12

Similar Documents

Publication Publication Date Title
CN108600326B (en) Communication method, device and equipment
CN111461887B (en) Block chain consensus processing method and device and electronic equipment
CN109639636B (en) Service data forwarding method, service data processing method, service data forwarding device, service data processing device and electronic equipment
CN107577629B (en) Data interface processing method, device, server and medium
CN110557445A (en) Access request routing method and device, storage medium and electronic equipment
CN111786984B (en) Pod communication connection method and device, electronic equipment and storage medium
CN109391512B (en) Service publishing method and device and electronic equipment
CN112751935B (en) Request processing method and device, electronic equipment and storage medium
CN111163130B (en) Network service system and data transmission method thereof
CN111651467B (en) Block chain node interface issuing and calling method and device
CN113141405B (en) Service access method, middleware system, electronic device, and storage medium
CN113746928B (en) Cross-cloud service calling method, device and system
CN113612686A (en) Traffic scheduling method and device and electronic equipment
CN112153143A (en) Kubernetes cluster flow scheduling method and device and electronic equipment
CN111694639B (en) Updating method and device of process container address and electronic equipment
CN111225018A (en) Request message processing method and device and electronic equipment
US10986066B2 (en) Systems, apparatuses, methods, and non-transitory computer readable media for efficient call processing
CN113422772B (en) Private network terminal access processing method and device and electronic equipment
CN111949297B (en) Block chain intelligent contract upgrading method and device and electronic equipment
CN112073215B (en) Method for realizing application and service controller
CN113485758A (en) Micro-service issuing method and device, electronic equipment and storage medium
CN114527983A (en) Interface adaptation method and device based on middleware and electronic equipment
CN114363254B (en) Tenant isolation method and device and electronic equipment
CN111651469B (en) Method and device for managing blockchain system contracts
CN110750271B (en) Service aggregation, method and device for executing aggregated service and electronic equipment

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20210512

Address after: 210000 Room 301, 3rd floor, 138 Fengtai South Road, Yuhuatai District, Nanjing City, Jiangsu Province

Applicant after: Nanjing cloud cabinet Network Technology Co.,Ltd.

Address before: Room 1501, building 1, Tianhe Plaza, 146 Fengtai South Road, Yuhuatai District, Nanjing, Jiangsu Province 210000

Applicant before: JIANGSU CLOUDBOX NETWORK TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant