Node degradation processing methods, devices, storage media and electronic equipment
By receiving a call request carrying an environment identifier, obtaining the hardware deployment purpose identifier of the application node, and generating a call request, the problem of the inability to dynamically downgrade application nodes in real time in the existing technology is solved. This achieves dynamic routing for environment isolation and downgrade, and improves processing efficiency.
Patent Information
- Application Number
- CN202311533931.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-16
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2043-11-16
AI Technical Summary
Existing technologies cannot dynamically downgrade application nodes in real time, resulting in inaccurate environment isolation and downgrading, and the inability to automatically downgrade to the predetermined environment node for consumption. This is especially problematic in integrated environment deployment models.
By receiving call requests carrying environment identifiers, the hardware deployment purpose identifiers of multiple application nodes are obtained. If no match is found, the application node is determined to be downgraded, and a call request is generated to forward data traffic until the predetermined termination node. The environment identifiers are parsed and shared using gateway layer coloring and interceptors to achieve dynamic node routing.
It implements dynamic degradation node routing based on environment identifiers, improves the processing efficiency of application nodes, solves the technical problem of real-time dynamic application node degradation, and ensures the isolation and degradation effect of message traffic in different environments.
Smart Images

Figure CN117579702B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of Internet technology, and more specifically, to a node degradation processing method, apparatus, storage medium, and electronic device. Background Technology
[0002] The existing technologies for message environment isolation and degradation achieve this by creating different message topic names. For example, environment producer node A can only send messages to message topic A, and environment subscriber A can only subscribe to message topic A. This achieves message environment isolation. However, the message topic model in these technologies is not only difficult to maintain but also generates a large number of abandoned message topics. Furthermore, this method of message environment isolation and degradation cannot accurately and dynamically degrade to a predetermined environment for consumption when a specified environment node is not available. For example, if environment subscriber A is offline, it cannot automatically degrade to a backup predetermined environment node for processing.
[0003] There is currently no effective solution to the above problems. Summary of the Invention
[0004] This invention provides a node degradation processing method, apparatus, storage medium, and electronic device to at least solve the technical problem in related technologies that cannot perform application node degradation processing in real time.
[0005] According to one aspect of the present invention, a node degradation processing method is provided, comprising: receiving a first call request for acquiring data traffic, wherein the first call request carries a first environment identifier, the first environment identifier being determined by a gateway layer receiving the first call request by coloring the data traffic; acquiring second environment identifiers corresponding to a plurality of first application nodes respectively, wherein the second environment identifier is determined by the hardware deployment purpose corresponding to the plurality of first application nodes respectively, the plurality of first application nodes being different from the current application node; if there is no application node among the plurality of first application nodes whose second environment identifier matches the first environment identifier, determining that the second environment identifier among the plurality of first application nodes is a degraded application node of a predetermined identifier type; generating a second call request based on the first environment identifier for the current application node to call the degraded application node, and sending the second call request to the degraded application node, wherein the degraded application node is used to acquire the data traffic from the next application node of the degraded application node based on the second call request, until the next application node is a predetermined termination node of the first call request, and the termination node performs the acquisition of the data traffic.
[0006] Optionally, after receiving the first call request for obtaining data traffic, the method further includes: using a first provider-side interceptor set in the current application node to parse the first call request, obtain the first environment identifier, and store the first environment identifier in the thread context variable of the current application node; using a first consumer-side interceptor set in the current application node to obtain the first environment identifier from the thread context variable, wherein the thread context variable is used for parameter sharing between the first provider-side interceptor and the first consumer-side interceptor; generating a second call request based on the first environment identifier for the current application node to call the downgraded application node, and sending the second call request to the downgraded application node includes: using the first consumer-side interceptor to generate the second call request based on the first environment identifier, and sending the second call request to a second provider-side interceptor set in the downgraded application node through the first consumer-side interceptor, wherein the second provider-side interceptor is used to parse the second call request so that the downgraded application node obtains the first environment identifier.
[0007] Optionally, the current application node corresponds to a predetermined transmission strategy. After receiving a first call request for obtaining data traffic, the method further includes: if the predetermined transmission strategy corresponding to the current application node is a call strategy, obtaining second environment identifiers corresponding to the plurality of first application nodes respectively; if the predetermined transmission strategy corresponding to the current application node is a message strategy, generating a target message based on the first call request, and sending the target message to a message server, wherein the target message is used to be pulled from the message server by a second application node, and the second application node is used to continue to obtain the data traffic from the next application node of the second application node based on the target message, and the execution time of the message strategy is greater than the execution time of the call strategy.
[0008] Optionally, generating a target message based on the first call request includes: parsing the first call request using a first provider-side interceptor set in the current application node to obtain a first environment identifier, and storing the first environment identifier in the thread context variable of the current application node; generating a message header based on the first environment identifier in the thread context variable; and generating the target message using the message header.
[0009] Optionally, the second application node corresponds to a predetermined transmission strategy. After the target message is sent to the message server, the second application node performs the following processing: obtains the target message from the message server; parses the target message to obtain the first environment identifier; if the predetermined transmission strategy corresponding to the second application node is a calling strategy, obtains third environment identifiers corresponding to multiple third application nodes respectively, wherein the third environment identifier is determined by the hardware system attributes corresponding to the multiple third application nodes respectively, and the multiple third application nodes are different from the second application node; if there is a target application node among the multiple third application nodes whose third environment identifier matches the first environment identifier, determines the target application node; based on the first environment identifier, generates a third calling request for the current application node to call the target application node, and sends the third calling request to the target application node.
[0010] Optionally, the predetermined identifier type includes offline identifiers and online identifiers. Determining the degraded application node among the plurality of first application nodes whose second environment identifier is the predetermined identifier type includes: determining the application scenario of the first call request; if the application scenario is a test scenario, determining the application node among the plurality of first application nodes whose second environment identifier is the offline identifier as the degraded application node; if the application scenario is a release scenario, determining the application node among the plurality of first application nodes whose second environment identifier is the online identifier as the degraded application node.
[0011] Optionally, before obtaining the second environment identifiers corresponding to the plurality of first application nodes, each of the plurality of first application nodes performs the following processing: determining the system attribute parameters corresponding to each application node, wherein the system attribute parameters are used to represent the hardware deployment purpose of each application node; determining the Uniform Resource Locator (URL) including the system attribute parameters corresponding to each application node; and registering each application node to the registration center server using the URL corresponding to each application node. To obtain the second environment identifiers corresponding to the plurality of first application nodes, the current application node performs the following processing: querying the registration center server for registered application nodes, determining the plurality of first application nodes, and the second environment identifiers corresponding to the plurality of first application nodes.
[0012] According to another aspect of the present invention, a node degradation processing apparatus is provided, comprising: a receiving module, configured to receive a first call request for acquiring data traffic, wherein the first call request carries a first environment identifier, the first environment identifier being determined by a gateway layer receiving the first call request by coloring the data traffic; an acquiring module, configured to acquire second environment identifiers corresponding to a plurality of first application nodes respectively, wherein the second environment identifier is determined by the hardware deployment purpose corresponding to the plurality of first application nodes respectively, and the plurality of first application nodes are different from the current application node; a determining module, configured to determine, in the case that there is no application node among the plurality of first application nodes whose second environment identifier matches the first environment identifier, that the second environment identifier among the plurality of first application nodes is a degradation application node of a predetermined identifier type; and a degradation module, configured to generate a second call request based on the first environment identifier, wherein the current application node calls the degradation application node, and sends the second call request to the degradation application node, wherein the degradation application node acquires the data traffic from the next application node of the degradation application node based on the second call request, until the next application node is a predetermined termination node of the first call request, and the termination node performs the acquisition of the data traffic.
[0013] According to another aspect of the present invention, a non-volatile storage medium is provided, the non-volatile storage medium storing a plurality of instructions adapted for loading by a processor and executing any one of the node degradation processing methods described herein.
[0014] According to another aspect of the present invention, an electronic device is provided, comprising: one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement any of the node degradation processing methods described above.
[0015] In this embodiment of the invention, a first call request for acquiring data traffic is received, wherein the first call request carries a first environment identifier, which is determined by the gateway layer receiving the first call request by coloring the data traffic; second environment identifiers corresponding to multiple first application nodes are acquired, wherein the second environment identifier is determined by the hardware deployment purpose corresponding to the multiple first application nodes, and the multiple first application nodes are different from the current application node; if there is no application node among the multiple first application nodes whose second environment identifier matches the first environment identifier, the second environment identifier among the multiple first application nodes is determined to be a degraded application node of a predetermined identifier type; based on the first environment identifier, a second call request is generated for the current application node to call the degraded application node, and the second call request is sent to the degraded application node, wherein the degraded application node is used to acquire the data traffic from the next application node of the degraded application node based on the second call request, until the next application node is a predetermined termination node of the first call request, and the termination node performs the acquisition of the data traffic. This achieves the goal of dynamically degrading node routing using environmental identifiers, improves the technical efficiency of application node processing, and solves the technical problem of not being able to dynamically degrade application nodes in real time in related technologies. Attached Figure Description
[0016] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0017] Figure 1 This is a flowchart of an optional node degradation processing method provided according to an embodiment of the present invention;
[0018] Figure 2 This is a schematic diagram illustrating the invocation of an optional node degradation processing method provided by an embodiment of the present invention;
[0019] Figure 3 This is a schematic diagram illustrating an optional node degradation processing method provided by an embodiment of the present invention.
[0020] Figure 4 This is a schematic diagram illustrating the identification transmission of an optional node degradation processing method provided by an embodiment of the present invention;
[0021] Figure 5 This is a flowchart illustrating an optional node degradation processing method provided according to an embodiment of the present invention;
[0022] Figure 6This is a schematic diagram of an optional node degradation processing device provided according to an embodiment of the present invention. Detailed Implementation
[0023] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0025] For ease of description, the following explains some of the nouns or terms used in the embodiments of this application:
[0026] An integrated environment, also known as an integrated environment deployment, is a current service deployment model. Conceptually, it is divided into two types of environments: online and offline, where networks and resources are isolated from each other. In the case of middleware deployment, all online environments share the same set of middleware services, and all offline environments share the same set of middleware services.
[0027] Offline environments can be logically divided into three categories: Development Environment (DEV), Testing Environment (SIT), and Stable Environment (STB). Due to parallel business needs, multiple Development and Testing environments often coexist; for example, Development Environments DEV_A and DEV_B, and Testing Environments SIT_A and SIT_B may exist simultaneously (A and B are used for differentiation). The Development Environment (DEV) is where developers perform software development, coding, and debugging. In the Development Environment, developers can write code, test, debug, and integrate. The Testing Environment (SIT) is where software testing is conducted. In the Testing Environment, testers can perform various tests on the completed software, including functional testing, performance testing, and security testing, to verify the software's correctness, stability, and reliability. The Stable Environment (STB) is a software runtime environment that has been tested and achieved a high level of stability. In the Stable Environment, the software has undergone sufficient testing and verification and can be provided to users or deployed to the production environment. In summary, the Development Environment is used by developers for software development and debugging, the Testing Environment is used for software testing, and the Stable Environment is used to deploy tested and verified software.
[0028] The online environment can be logically divided into three categories: pre-production (PRE), gray-scale (GRY), and production (PRD). The pre-production environment is typically used for initial validation of internal business operations. The gray-scale environment is used when releasing to the production environment, with only a small number of nodes deployed at a time for verification; in this case, the traffic source is real user traffic. This allows for quick review if problems arise during the upgrade.
[0029] Environment isolation refers to the principle that messages from different production environments should be consumed within the same consumer application node in the same environment to avoid mutual interference. For example, messages from the development environment DEV_A should not be consumed by the consumer application node of the development environment DEV_B, otherwise it will increase the difficulty of development integration testing and make it impossible to implement functions such as canary releases and pre-release verification. For example, messages generated in the pre-release environment should be consumed by the pre-release environment consumer application node first. If they are directly consumed by the production environment node, they may not be able to process the message and cause errors. If an application is not in the development or release process and is already in a stable running state, and only needs to provide services externally, then this application will only exist on the stable environment STB node (offline) or the production environment PRD node (online). When other upstream applications, such as the development environment DEV_A environment node, need to depend on this downstream application, they should automatically be downgraded to the stable environment STB environment node or the generation environment PRD environment node of this application. The pre-release environment (PRE) refers to the environment used for final testing and verification before being officially released to the production environment. The pre-release environment is usually an environment similar to the production environment, used to test and verify the stability and functionality of the deployed application or system. A canary release environment (GRY) refers to an environment where a portion of user traffic is redirected to a newly released version for testing and verification before the software is released to production. Canary release environments can be used to evaluate the performance, stability, and user experience of a new version, as well as to identify and resolve potential issues without affecting all users. A production environment (PRD) is the environment where the software is officially provided to the public and is used by end users. In a production environment, the software has undergone thorough testing and verification, possessing stability, reliability, and security, meeting user needs, and capable of handling normal business operations. In summary, the pre-release environment is used for final testing and verification of stability and functionality before release; the canary release environment is used to gradually verify new versions before production; and the production environment is where the software is officially provided to the public.
[0030] Environment degradation refers to the process where messages generated in the development environment (DEV) and test environment (SIT) can be degraded to the stable environment (STB) for consumption when there are no consumer application nodes in the same environment. Similarly, messages generated in the production pre-release environment (PRE) and canary environment (GRY) can be degraded to the production environment (PRD) for consumption when there are no consumer application nodes in the same environment. In other words, messages in environment X are preferentially consumed by consumers in environment X. If there are no consumers in environment X, then the message is degraded to the stable environment STB in production or to consumers in the production environment PRD in online production.
[0031] RPC (Remote Procedure Call) is a protocol that allows a computer to request services from a remote computer over a network without needing to understand the underlying network technology. In the OSI seven-layer network model, RPC spans the transport and application layers. RPC makes developing applications, including network-distributed multiprogramming, easier, allowing business processes and computational tasks to invoke procedures on remote computers as if they were local methods.
[0032] Dubbo is a specific implementation framework for the RPC protocol. Through the Dubbo framework, it is extremely convenient for request initiator nodes and service provider nodes to conduct network communication and interaction, that is, to initiate network request calls.
[0033] The existing technologies for message environment isolation and degradation achieve this by creating different message topic names. For example, environment producer node A can only send messages to message topic A, and environment subscriber A can only subscribe to message topic A. This achieves message environment isolation. However, the message topic model in these technologies is not only difficult to maintain but also generates a large number of abandoned message topics. Furthermore, this method of message environment isolation and degradation cannot accurately and dynamically degrade to a predetermined environment for consumption when a specified environment node is not available. For example, if environment subscriber A is offline, it cannot automatically degrade to a backup predetermined environment node for processing.
[0034] The aforementioned technologies cannot accurately and in real-time downgrade to a stable environment STB or a production environment PRD for consumption when a specified environment node is not present. For example, if environment subscriber A has gone offline, it cannot automatically downgrade to a backup stable environment STB or a production environment PRD node for consumption, which presents a serious technical flaw.
[0035] The aforementioned two technical defects are significantly amplified in the deployment mode of an integrated environment. In development, joint debugging and testing, as well as online verification and canary release scenarios, there is an urgent need to solve the problem of environmental isolation of message traffic.
[0036] To address the aforementioned problems, this invention provides a method embodiment for node degradation processing. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0037] Figure 1 This is a flowchart of a node degradation processing method according to an embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps:
[0038] Step S102: Receive a first call request for obtaining data traffic, wherein the first call request carries a first environment identifier, and the first environment identifier is determined by the gateway layer receiving the first call request by coloring the data traffic;
[0039] Step S104: Obtain the second environment identifier corresponding to each of the multiple first application nodes. The second environment identifier is determined by the hardware deployment purpose corresponding to each of the multiple first application nodes. The multiple first application nodes are different from the current application node.
[0040] Step S106: If there is no application node among the multiple first application nodes whose second environment identifier matches the first environment identifier, determine that the second environment identifier among the multiple first application nodes is a downgraded application node of a predetermined identifier type.
[0041] Step S108: Based on the first environment identifier, generate a second call request for the current application node to call the downgraded application node, and send the second call request to the downgraded application node. The downgraded application node is used to obtain data traffic from the next application node of the downgraded application node based on the second call request, until the next application node is the predetermined termination node of the first call request, and the termination node performs the data traffic acquisition.
[0042] It's understandable that data traffic is sent by the user end. The gateway layer receives the data traffic and colors it to determine the first environment identifier for the first call request. Multiple first application nodes each correspond to a second environment identifier. To select the next application node to continue acquiring data traffic, the current application node obtains the second environment identifiers corresponding to each of the multiple first application nodes. The second environment identifier is based on the hardware deployment purpose of each of the multiple first application nodes. If the current application node cannot find an application node among the multiple first application nodes whose second environment identifier matches its first environment identifier, it is considered that node degradation is required, replacing the node in the same environment for processing. Among the multiple first application nodes, the degraded application node has a predetermined identifier type for its second environment identifier. The current application node calls the degraded application node to continue acquiring data traffic, and the current application node generates a second call request based on the first environment identifier. The degraded application node also continues to acquire data traffic from its next application node until the next application node is the predetermined termination node for the first call request, at which point the termination node completes the acquisition of data traffic.
[0043] It should be noted that the aforementioned first call request has a predetermined processing flow, therefore the predetermined termination node is definite, and the aforementioned execution entity can be the current application node. The aforementioned current application node, multiple first application nodes, and degraded application nodes are all microservice application nodes. A microservice application node refers to an independently running service instance in a microservice architecture, which can be independently deployed, scaled, and managed. A microservice application node is typically a lightweight service with specific functions, communicating with other microservices over the network to collaboratively complete complex business logic. Each of the aforementioned application nodes has its own corresponding predetermined transmission strategy.
[0044] Optionally, the gateway layer's role in coloring data traffic and identifying environment identifiers is to manage and control traffic in different environments. It can limit traffic to the test environment to avoid excessive load, or prioritize traffic to the production environment to ensure the stability of critical business operations. By coloring data traffic and identifying environment identifiers at the gateway layer, functions such as traffic isolation, control, canary releases, troubleshooting, and monitoring can be achieved, improving system availability and stability. Each microservice application node can have multiple different environments.
[0045] Optionally, the aforementioned user terminal can be a mobile application (APP), a mobile terminal, etc. Dubbo services are used to implement the RPC protocol for calls between application nodes. For example... Figure 2 As shown, assume that the gateway layer colors the data traffic as the development environment DEV_B, and the gateway layer uses Dubbo to call the route microservice application A. Microservice application A is assumed to have two environments, such as microservice application A node 1 in the stable environment STB, and microservice application A node 2 in the development environment DEV_B.
[0046] exist Figure 2 Since microservice application A has a development environment DEV_B (i.e., microservice application A node 2), the gateway layer can match data traffic with the first environment identifier being the development environment DEV_B. If the matched traffic is found to be in microservice application A node 2 with the environment identifier DEV_B, it will be designated as the current application node. The next application node after the current application node can be one of three nodes: microservice application B node 1 in the stable environment STB, microservice application B node 2 in the development environment DEV_E, and microservice application B node 3 in the development environment DEV_F (i.e., multiple first application nodes). The current service node can match the first environment identifier with the second environment identifier. Since there is no node in microservice application B that is identical to the development environment DEV_B, the current service node will need to perform node degradation, and microservice application B node 1 in the stable environment STB will be designated as the degradation application node.
[0047] The degraded application node will continue to select the next application node based on the first environment identifier of the development environment DEV_B. The options are: microservice application D node 1 with a stable environment STB, microservice application D node 2 with the development environment DEV_E, and microservice application D node 3 with the development environment DEV_B. Microservice application D node 3, matching the first environment identifier, will be selected. If microservice application D node 3 is the predetermined termination node, it will handle the acquisition of data traffic.
[0048] In an optional embodiment, the method further includes: if there is an application node among the plurality of first application nodes whose second environment identifier matches the first environment identifier, determining a fourth application node whose second environment identifier matches the first environment identifier; generating a fourth call request based on the first environment identifier for the current application node to call the fourth application node, and having the current application node send the fourth call request to the fourth application node.
[0049] It is understandable that if a second environment identifier matches a first environment identifier among multiple first application nodes, node degradation is not required, and the next application node in the same environment can be determined as the fourth application node. After generating the fourth call request, if the fourth application node is not the predetermined termination node, it will continue to acquire and process data traffic from the fourth application node to its next application node.
[0050] Optionally, specific examples are provided for ease of understanding, such as... Figure 3 As shown, assume that the gateway layer colors the data traffic as the development environment DEV_E, and the gateway layer uses Dubbo to call the route to the microservice application A. In the microservice application A, there are two environments: microservice application A node 1 in the stable environment STB, and microservice application A node 2 in the development environment DEV_B.
[0051] exist Figure 3Since microservice application A lacks a development environment (DEV_E), node degradation is required. Node 1 of microservice application A in the stable environment (STB) is selected as the current application node. The next application node after the current node can be selected from three nodes: microservice application B node 1 in the stable environment (STB), microservice application B node 2 in the development environment (DEV_E), and microservice application B node 3 in the development environment (DEV_F) (i.e., multiple first application nodes). The current application node can match the first environment identifier with the second environment identifier, selecting microservice application B node 2 in the development environment (DEV_E) as the fourth application node. The fourth application node continues environment identifier matching, selecting microservice application D node 2 that matches the first environment identifier (DEV_E). If microservice application D node 2 is the predetermined termination node, then microservice application D node 2 will handle data traffic acquisition.
[0052] In an optional embodiment, after receiving a first call request for obtaining data traffic, the method further includes: parsing the first call request using a first provider-side interceptor set in the current application node to obtain a first environment identifier, and storing the first environment identifier in a thread context variable of the current application node; obtaining the first environment identifier from the thread context variable using a first consumer-side interceptor set in the current application node, wherein the thread context variable is used for parameter sharing between the first provider-side interceptor and the first consumer-side interceptor; generating a second call request based on the first environment identifier for the current application node to call a downgraded application node, and sending the second call request to the downgraded application node, including: generating a second call request based on the first environment identifier using the first consumer-side interceptor, and sending the second call request to a second provider-side interceptor set in the downgraded application node through the first consumer-side interceptor, wherein the second provider-side interceptor is used to parse the second call request so that the downgraded application node obtains the first environment identifier.
[0053] It is understandable that the current application node has a first provider-side interceptor and a first consumer-side interceptor. The first provider-side interceptor parses the first call request and stores the parsed first environment identifier in the thread context variable of the current application node. The thread context variable is used for parameter sharing between the first provider-side interceptor and the first consumer-side interceptor in the current application node. The first consumer-side interceptor obtains the first environment identifier from the thread context variable and generates a second call request based on the first environment identifier. The current application node and the degraded application node use the second call request for parameter pass-through, so that the degraded application node obtains the first environment identifier. The degraded application node has a second provider-side interceptor and a second consumer-side interceptor. Through the above processing, by using the environment identifier field passed through the entire link in conjunction with custom route extension, the next application node for invocation is dynamically selected, thereby realizing message forwarding and invocation, and thus achieving environment isolation and environment degradation effects when consuming message traffic.
[0054] Optionally, specific examples are provided for ease of understanding, such as... Figure 4 As shown, Dubbo is used to implement RPC calls between application nodes. Taking the call between microservice application A and microservice application B as an example, the call processing is not affected regardless of the application node environment. Microservice application A parses the first call request to obtain the first environment identifier, which is stored in the thread context variable. The first consumer-side interceptor obtains the first environment identifier from the thread context variable and passes it through using the Dubbo call request. During the Dubbo call between microservice application A and microservice application B, the generated second call request carries the first environment identifier. The second provider-side interceptor of microservice application B parses the second call request to obtain the first environment identifier, which is stored in the thread context variable of that node. The second consumer-side interceptor of microservice application B obtains the first environment identifier from the thread context variable. If microservice application B is not the predetermined termination node, the call will continue to the next application node after microservice application B.
[0055] In an optional embodiment, the current application node corresponds to a predetermined transmission strategy. After receiving a first call request for obtaining data traffic, the method further includes: if the predetermined transmission strategy corresponding to the current application node is a call strategy, obtaining second environment identifiers corresponding to multiple first application nodes respectively; if the predetermined transmission strategy corresponding to the current application node is a message strategy, generating a target message based on the first call request, and sending the target message to a message server, wherein the target message is used to be pulled from the message server by a second application node, and the second application node is used to continue to obtain data traffic from the next application node of the second application node based on the target message, and the execution time of the message strategy is greater than the execution time of the call strategy.
[0056] It's understandable that each application node has a pre-defined transmission strategy according to existing procedures. The current application node can obtain data traffic according to its own pre-defined transmission strategy. If the pre-defined transmission strategy is a call strategy, then the current application node will obtain data traffic by calling the next application node (or a degraded application node). If the pre-defined transmission strategy is a message strategy, then the current application node will generate a target message and send it to the message server. The target message in the message server is used by the second application node to retrieve messages, enabling the second application node to continue obtaining data traffic from its next application node. Of these two pre-defined transmission strategies, the call strategy involves real-time invocation, while the execution time of the message strategy is longer than that of the call strategy; therefore, the message service does not provide real-time feedback.
[0057] It's important to note that messages (referring to message services) are not limited to real-time request-and-response communication between microservice applications. They can also send messages to a message center, which can be considered a message server. Consumer application nodes then retrieve this message from the message center for consumption. This is generally used for peak shaving and valley filling. After sending the message, the sending application node does not need to wait for confirmation from the consumer application node; it only needs to forward it to the message center.
[0058] In one optional embodiment, generating a target message based on a first call request includes: parsing the first call request using a first provider-side interceptor set in the current application node to obtain a first environment identifier, and storing the first environment identifier in the thread context variable of the current application node; generating a message header based on the first environment identifier in the thread context variable; and generating the target message using the message header.
[0059] Under normal circumstances, in a message-based strategy, the first provider-side interceptor of the current application node will parse the first call request to obtain the first environment identifier. The current application node will then include the first environment identifier, stored in the thread context variable, as a custom message header field in the message header. After generating the message header, the target message to be sent to the message server will be obtained.
[0060] In one optional embodiment, the second application node corresponds to a predetermined transmission strategy. After sending the target message to the message server, the second application node performs the following processing: obtaining the target message from the message server; parsing the target message to obtain a first environment identifier; if the predetermined transmission strategy corresponding to the second application node is a calling strategy, obtaining third environment identifiers corresponding to multiple third application nodes respectively, wherein the third environment identifier is determined by the hardware system attributes corresponding to the multiple third application nodes, and the multiple third application nodes are different from the second application node; if there is a target application node among the multiple third application nodes whose third environment identifier matches the first environment identifier, determining the target application node; based on the first environment identifier, generating a third calling request for the current application node to call the target application node, and sending the third calling request to the target application node.
[0061] It can be understood that the second application node, as the execution entity, pulls the target message from the message server and parses the target message to obtain the first environment identifier. If the predetermined transmission strategy corresponding to the second application node is a calling strategy, it is considered that the second application node needs to call the next application node, and the third environment identifiers corresponding to multiple third application nodes after the second application node can be obtained. If a target application node exists among the multiple third application nodes whose third environment identifier matches the first environment identifier, it is considered that an application node in the same environment has been selected, thus determining the target application node. Based on the first environment identifier, a third call request is generated for the current application node to call the target application node, and the third call request is sent to the target application node. Through the above processing, the application node after the message service can continue to perform environment identifier routing matching for other application nodes to select the next target application node.
[0062] In one optional embodiment, the predetermined identifier type includes offline identifier and online identifier. Determining the second environment identifier among multiple first application nodes as a degraded application node of the predetermined identifier type includes: determining the application scenario of the first call request; if the application scenario is a test scenario, determining the application node among multiple first application nodes with the second environment identifier as an offline identifier as a degraded application node; if the application scenario is a release scenario, determining the application node among multiple first application nodes with the second environment identifier as an online identifier as a degraded application node.
[0063] It's understandable that different node degradation methods can be used depending on the application scenario of the first call request. In a testing scenario, the application node with the second environment identifier set to "offline" among multiple first application nodes is designated as the degradation application node. In a deployment scenario, the application node with the second environment identifier set to "online" among multiple first application nodes is designated as the degradation application node. Through these methods, appropriate degradation application nodes can be determined according to different application scenarios.
[0064] Optionally, the test scenario refers to the offline environment. The offline identifier can be of various types, such as: development environment is denoted as DEV, test environment is denoted as SIT, and stable environment is denoted as STB.
[0065] Optionally, the release scenario refers to the offline environment, and the above online identifiers can be of various types, such as: PRE for pre-release environment, GRY for grayscale environment, and PRD for production environment.
[0066] In an optional embodiment, before obtaining the second environment identifiers corresponding to the multiple first application nodes, each of the multiple first application nodes performs the following processes: determining the system attribute parameters corresponding to each application node, wherein the system attribute parameters are used to represent the hardware deployment purpose of each application node; determining the Uniform Resource Locator (URL) corresponding to each application node, including the system attribute parameters; registering each application node to the registration center server using the URL corresponding to each application node; obtaining the second environment identifiers corresponding to the multiple first application nodes, and the current application node performs the following processes: querying the registration center server for the registered application nodes, determining the multiple first application nodes, and the second environment identifiers corresponding to the multiple first application nodes.
[0067] It is understandable that, for each application node among multiple first application nodes as the execution subject, the following processes can be performed: The system attribute parameters corresponding to each application node can be determined. These system attribute parameters represent the hardware deployment purpose of each application node. When the hardware machine of each application node starts up, it performs environment tagging to determine the same resource locator (RLOC) corresponding to each application node, including the system attribute parameters. This RLOC is used to register the corresponding application node with the registry center server. Afterwards, the current application node, as the execution subject, can perform the following processes: Query the registry center server for the registered application nodes to obtain the second environment identifiers corresponding to each of the multiple first application nodes.
[0068] Optionally, the second environment identifiers corresponding to the aforementioned multiple first application nodes can be considered as a list of service providers for the current application node. When matching environment identifiers, each application node will query the service provider list from the registry server.
[0069] Optionally, the above system attribute parameters can be the "java -D" parameter, which assigns environment identifier information to the machine node. The "java -D" parameter is used to set system attributes. By using the "-D" parameter, system attributes can be set when running a Java program, and these attributes can be accessed and used within the program. A Uniform Resource Locator (URL) is a string used to identify the location of resources on the Internet. Registering a microservice application with a registry typically involves using a specific registry client library or framework, and the implementation will vary depending on the specific microservice framework and the chosen registry. In the microservice application's configuration file, the registry connection information is configured, including the registry's address and port. The registry server generates a unique identifier for the microservice application, namely the Uniform Resource Locator (URL).
[0070] It should be noted that since Dubbo's custom route filtering environment is used for forwarding, the core technology is completely equivalent, whether a separate middleware service is deployed to fetch messages and forward them to the target application node, or the application node itself is allowed to fetch messages and forward them to the target node. The emphasis is on using this Dubbo custom route filtering end-to-end environment identifier mechanism to achieve message traffic environment isolation and degradation effects. It is not limited to technical details such as whether message fetching and forwarding services are deployed independently, nor is it limited to whether microservice application nodes use Dubbo as the means of implementing RPC calls, or what method is used to pass through environment identifiers. Therefore, as long as the core mechanism of message traffic environment isolation and degradation uses environment identifiers for application node matching, it should fall within the scope of patent protection of this invention.
[0071] Through the above steps S102, a first call request for acquiring data traffic is received, wherein the first call request carries a first environment identifier, which is determined by the gateway layer receiving the first call request by coloring the data traffic; in step S104, second environment identifiers corresponding to multiple first application nodes are acquired, wherein the second environment identifier is determined by the hardware deployment purpose corresponding to the multiple first application nodes, and the multiple first application nodes are different from the current application node; in step S106, if there is no application node among the multiple first application nodes whose second environment identifier matches the first environment identifier, it is determined that the second environment identifier among the multiple first application nodes is a degraded application node of a predetermined identifier type; in step S108, based on the first environment identifier, a second call request is generated for the current application node to call the degraded application node, and the second call request is sent to the degraded application node, wherein the degraded application node is used to acquire data traffic from the next application node of the degraded application node based on the second call request, until the next application node is the predetermined termination node of the first call request, and the termination node performs the acquisition of data traffic. This technology enables dynamic degradation of node routing using environmental identifiers, thereby improving the processing efficiency of application nodes and solving the technical problem of not being able to dynamically degrade application nodes in real time in related technologies.
[0072] Based on the above embodiments and optional embodiments, the present invention proposes an optional implementation method, specifically comprising the following steps, as follows: Figure 5 As shown, in step S1, the user's mobile application (APP) needs to obtain data traffic. After receiving the data traffic, the gateway layer will color the data traffic to determine the first environment identifier of the first call request. The Dubbo service is executing the RPC call. Microservice application A node obtains the first environment identifier and generates a second call request to microservice application B node according to the predetermined transmission strategy. The second call request carries the first environment identifier.
[0073] In step S2, the first environment identifier can be transparently transmitted during the Dubbo call, allowing the microservice application B node to obtain the first environment identifier. The microservice application B node can then generate the target message based on the first environment identifier as the message header, according to the message strategy indicated by the predetermined transmission strategy. The microservice application B node then sends the target message to the message server.
[0074] Step S3: The microservice application C node pulls the target message from the message server to its local machine. The microservice application C node parses the message header in the target message to obtain the first environment identifier.
[0075] In step S4, the microservice application C node performs route matching on the first environment identifier. The possible next application nodes for microservice application C node include: microservice application D node 1 in the stable environment STB, microservice application D node 2 in the development environment DEV_A, and microservice application D node 3 in the development environment DEV_B. Assuming the first environment identifier is DEV_E, microservice application C node cannot match an application node with the same first environment identifier DEV_E. Therefore, node degradation processing is required, causing microservice application C node to make a Dubbo call to microservice application D node 1, acting as the degraded application node. If the degraded application node is the predetermined termination node, the degraded application node will handle the data traffic acquisition.
[0076] The above optional implementation methods achieve at least the following effects: by utilizing the environment identifier transmitted across the entire link in conjunction with the custom routing extension of the Dubbo service, the calling node is dynamically selected to achieve Dubbo forwarding of messages, thereby enabling environment isolation and degradation effects during message traffic consumption. This specific implementation method solves the problem of difficulty in accurately managing message traffic and achieving environment isolation and degradation in an integrated environment deployment mode. It is helpful for development, joint debugging, testing, and online pre-release canary verification of message traffic.
[0077] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0078] This embodiment also provides a node degradation processing apparatus for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the terms "module" and "apparatus" can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0079] According to embodiments of the present invention, an apparatus embodiment for implementing a node degradation processing method is also provided. Figure 6 This is a schematic diagram of a node degradation processing device according to an embodiment of the present invention, as shown below. Figure 6 As shown, the above-mentioned node degradation processing device includes: a receiving module 602, an acquisition module 604, a determination module 606, and a degradation module 608. The device will be described below.
[0080] The receiving module 602 is used to receive a first call request for obtaining data traffic, wherein the first call request carries a first environment identifier, which is determined by the gateway layer receiving the first call request by coloring the data traffic;
[0081] The acquisition module 604, connected to the receiving module 602, is used to acquire the second environment identifiers corresponding to the multiple first application nodes respectively. The second environment identifiers are determined by the hardware deployment purpose corresponding to the multiple first application nodes respectively, and the multiple first application nodes are different from the current application node.
[0082] The determination module 606, connected to the acquisition module 604, is used to determine, in the case that there is no application node among the multiple first application nodes whose second environment identifier matches the first environment identifier, that is a downgraded application node of a predetermined identifier type among the multiple first application nodes.
[0083] The degradation module 608, connected to the determination module 606, is used to generate a second call request based on the first environment identifier, which is used to call the degradation application node from the current application node, and send the second call request to the degradation application node. The degradation application node is used to obtain data traffic from the next application node of the degradation application node based on the second call request, until the next application node is the predetermined termination node of the first call request, and the termination node performs the data traffic acquisition.
[0084] In a node degradation processing device provided in this embodiment of the invention, a receiving module 602 is used to receive a first call request for acquiring data traffic, wherein the first call request carries a first environment identifier, which is determined by the gateway layer receiving the first call request through coloring the data traffic; an acquisition module 604, connected to the receiving module 602, is used to acquire second environment identifiers corresponding to multiple first application nodes, wherein the second environment identifier is determined by the hardware deployment purpose corresponding to the multiple first application nodes, and the multiple first application nodes are different from the current application node; a determining module 606, connected to the acquisition module 604, is used to determine... If no application node among multiple first application nodes has a second environment identifier that matches the first environment identifier, a degraded application node with a predetermined identifier type is identified among the multiple first application nodes. A degraded module 608, connected to the determining module 606, is used to generate a second call request based on the first environment identifier, allowing the current application node to invoke the degraded application node, and sends the second call request to the degraded application node. The degraded application node uses the second call request to obtain data traffic from the next application node of the degraded application node, until the next application node is the predetermined termination node of the first call request, at which point the termination node executes the data traffic acquisition. This achieves the goal of dynamically degrading node routing using environment identifiers, improving the technical effect of application node processing efficiency, and thus solving the technical problem in related technologies where application node degradation cannot be performed dynamically in real time.
[0085] It should be noted that the above modules can be implemented by software or hardware. For example, for the latter, it can be implemented in the following ways: the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0086] It should be noted that the receiving module 602, obtaining module 604, determining module 606, and downgrading module 608 mentioned above correspond to steps S102 to S108 in the embodiments. The instances and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the content disclosed in the above embodiments. It should be noted that the above modules, as part of the device, can run in a computer terminal.
[0087] It should be noted that the optional or preferred implementation methods of this embodiment can be found in the relevant descriptions in the embodiments, and will not be repeated here.
[0088] The aforementioned node degradation processing device may further include a processor and a memory. The receiving module 602, the acquisition module 604, the determination module 606, the degradation module 608, etc., are all stored in the memory as program units, and the processor executes the aforementioned program units stored in the memory to realize the corresponding functions.
[0089] The processor contains a core that retrieves the corresponding program unit from memory. One or more cores may be configured. Memory may include non-persistent memory in computer-readable media, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory includes at least one memory chip.
[0090] This invention provides a non-volatile storage medium storing a program that, when executed by a processor, implements a node degradation processing method.
[0091] This invention provides an electronic device including a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs the following steps: receiving a first call request for acquiring data traffic, wherein the first call request carries a first environment identifier, which is determined by the gateway layer receiving the first call request through coloring the data traffic; acquiring second environment identifiers corresponding to multiple first application nodes, wherein the second environment identifiers are determined by the hardware deployment purpose corresponding to the multiple first application nodes, and the multiple first application nodes are different from the current application node; if no application node among the multiple first application nodes has a second environment identifier matching the first environment identifier, determining that the second environment identifier among the multiple first application nodes is a degraded application node of a predetermined identifier type; based on the first environment identifier, generating a second call request for the current application node to call the degraded application node, and sending the second call request to the degraded application node, wherein the degraded application node is used to acquire data traffic from the next application node of the degraded application node based on the second call request, until the next application node is a predetermined termination node of the first call request, and the termination node performs the acquisition of data traffic. The device in this document can be a server, PC, etc.
[0092] This invention also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having the following method steps: receiving a first call request for acquiring data traffic, wherein the first call request carries a first environment identifier, the first environment identifier being determined by the gateway layer receiving the first call request through coloring the data traffic; acquiring second environment identifiers corresponding to multiple first application nodes respectively, wherein the second environment identifiers are determined by the hardware deployment purpose corresponding to the multiple first application nodes respectively, and the multiple first application nodes are different from the current application node; in the case that there is no application node among the multiple first application nodes whose second environment identifier matches the first environment identifier, determining that the second environment identifier among the multiple first application nodes is a degraded application node of a predetermined identifier type; based on the first environment identifier, generating a second call request for the current application node to call the degraded application node, and sending the second call request to the degraded application node, wherein the degraded application node is used to acquire data traffic from the next application node of the degraded application node based on the second call request, until the next application node is a predetermined termination node of the first call request, and the termination node performs the acquisition of data traffic.
[0093] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0094] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0095] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0096] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0097] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0098] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0099] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, 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 technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0100] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0101] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0102] The above are merely embodiments of the present invention and are not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the present invention should be included within the scope of the claims of the present invention.
Claims
1. A node degradation processing method, characterized in that, include: Receive a first call request for obtaining data traffic, wherein the first call request carries a first environment identifier, and the first environment identifier is determined by the gateway layer receiving the first call request by coloring the data traffic; Obtain the second environment identifier corresponding to each of the multiple first application nodes, wherein the second environment identifier is determined by the hardware deployment purpose corresponding to each of the multiple first application nodes, and the multiple first application nodes are different from the current application node; If there is no application node among the plurality of first application nodes whose second environment identifier matches the first environment identifier, then the second environment identifier among the plurality of first application nodes is determined to be a downgraded application node of a predetermined identifier type; Based on the first environment identifier, a second call request is generated for the current application node to call the degraded application node, and the second call request is sent to the degraded application node. The degraded application node is used to obtain the data traffic from the next application node of the degraded application node based on the second call request, until the next application node is the predetermined termination node of the first call request, and the predetermined termination node performs the acquisition of the data traffic. The predetermined identifier type includes offline identifiers and online identifiers. Determining the degraded application node among the plurality of first application nodes whose second environment identifier is the predetermined identifier type includes: determining the application scenario of the first call request; if the application scenario is a test scenario, determining the application node among the plurality of first application nodes whose second environment identifier is the offline identifier as the degraded application node; if the application scenario is a release scenario, determining the application node among the plurality of first application nodes whose second environment identifier is the online identifier as the degraded application node.
2. The method according to claim 1, characterized in that, After receiving the first call request for obtaining data traffic, the method further includes: The first provider interceptor set in the current application node is used to parse the first call request, obtain the first environment identifier, and store the first environment identifier in the thread context variable of the current application node; The first consumer-side interceptor set in the current application node is used to obtain the first environment identifier from the thread context variable, wherein the thread context variable is used for parameter sharing between the first provider-side interceptor and the first consumer-side interceptor; The step of generating a second invocation request based on the first environment identifier to invoke the degraded application node by the current application node, and sending the second invocation request to the degraded application node, includes: The first consumer-side interceptor generates the second call request based on the first environment identifier, and sends the second call request to the second provider-side interceptor set in the degraded application node through the first consumer-side interceptor. The second provider-side interceptor is used to parse the second call request so that the degraded application node obtains the first environment identifier.
3. The method according to claim 1, characterized in that, The current application node corresponds to a predetermined transmission strategy. After receiving the first call request for obtaining data traffic, the method further includes: When the predetermined transmission strategy corresponding to the current application node is a calling strategy, the second environment identifiers corresponding to the plurality of first application nodes are obtained respectively; When the predetermined transmission strategy corresponding to the current application node is a message strategy, a target message is generated based on the first call request, and the target message is sent to the message server. The target message is used to be pulled from the message server by the second application node, and the second application node is used to continue to obtain the data traffic from the next application node of the second application node based on the target message. The execution time of the message strategy is greater than the execution time of the call strategy.
4. The method according to claim 3, characterized in that, The step of generating the target message based on the first call request includes: The first provider interceptor set in the current application node is used to parse the first call request, obtain the first environment identifier, and store the first environment identifier in the thread context variable of the current application node; Generate a message header based on the first environment identifier in the thread context variable; The target message is generated using the message header.
5. The method according to claim 3, characterized in that, The second application node has a predetermined transmission strategy. After the target message is sent to the message server, the second application node performs the following processing: Obtain the target message from the message server; The target message is parsed to obtain the first environment identifier; When the predetermined transmission strategy corresponding to the second application node is the calling strategy, the third environment identifiers corresponding to the multiple third application nodes are obtained respectively. The third environment identifiers are determined by the hardware system attributes corresponding to the multiple third application nodes respectively. The multiple third application nodes are different from the second application node. If, among the plurality of third application nodes, there exists a target application node whose third environment identifier matches the first environment identifier, the target application node is determined; Based on the first environment identifier, a third call request is generated for the current application node to invoke the target application node, and the third call request is sent to the target application node.
6. The method according to any one of claims 1 to 5, characterized in that, Before obtaining the second environment identifiers corresponding to the multiple first application nodes, each of the multiple first application nodes performs the following processing: determining the system attribute parameters corresponding to each application node, wherein the system attribute parameters are used to represent the hardware deployment purpose of each application node; determining the Uniform Resource Locator (URL) corresponding to each application node, including the system attribute parameters; and registering each application node to the registration center server using the URL corresponding to each application node. To obtain the second environment identifiers corresponding to the multiple first application nodes, the current application node performs the following processing: querying the registration center server for registered application nodes, determining the multiple first application nodes, and the second environment identifiers corresponding to the multiple first application nodes.
7. A node degradation processing device, characterized in that, include: A receiving module is configured to receive a first call request for acquiring data traffic, wherein the first call request carries a first environment identifier, and the first environment identifier is determined by the gateway layer receiving the first call request by coloring the data traffic; The acquisition module is used to acquire the second environment identifiers corresponding to multiple first application nodes, wherein the second environment identifiers are determined by the hardware deployment purpose corresponding to the multiple first application nodes, and the multiple first application nodes are different from the current application node; The determination module is configured to determine, when there is no application node among the plurality of first application nodes whose second environment identifier matches the first environment identifier, that the second environment identifier among the plurality of first application nodes is a downgraded application node of a predetermined identifier type. The degradation module is used to generate a second call request based on the first environment identifier, so as to call the degradation application node by the current application node, and send the second call request to the degradation application node. The degradation application node is used to obtain the data traffic from the next application node of the degradation application node based on the second call request, until the next application node is the predetermined termination node of the first call request, and the predetermined termination node performs the acquisition of the data traffic. The determining module is further configured to: determine the application scenario of the first call request, wherein the predetermined identifier type includes offline identifier and online identifier; if the application scenario is a test scenario, determine the application node among the plurality of first application nodes whose second environment identifier is the offline identifier, as the downgraded application node; if the application scenario is a release scenario, determine the application node among the plurality of first application nodes whose second environment identifier is the online identifier, as the downgraded application node.
8. A non-volatile storage medium, characterized in that, The non-volatile storage medium stores multiple instructions, which are adapted to be loaded by a processor and executed by the node degradation processing method according to any one of claims 1 to 6.
9. An electronic device, characterized in that, include: One or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the node degradation processing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Devices And Methods Supporting Content Delivery With Delivery Services
US20140173046A1
Detection of outlier nodes in a cluster
US20200036596A1
