Anti-corrosion isolation method and system for external system interface under micro-service architecture
By building anti-corrosion layer and exit gateway layer in the microservice architecture, isolating the service layer from the third-party system, abstracting the encapsulation interface and performing fault analysis, the problem of third-party dependency on code is solved, and the system reliability and security is improved.
Patent Information
- Application Number
- CN202411349657.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2024-12-27
AI Technical Summary
In the prior art, the code dependent on third-party is closely bound to the business code, resulting in the system being susceptible to third-party system failures, complex maintenance, poor security, and difficult to replace and integrate.
Under the microservice architecture, build a system layered architecture, build an anti-corrosion layer and an exit gateway layer, isolate the business layer and the third-party system through the anti-corrosion layer, abstractly encapsulate the third-party interface, uniformly record the interface call log, and trigger the fuse mechanism and fault analysis , use long and short-term memory neural network for fault diagnosis.
It reduces the dependence of business systems on third-party systems, improves the reliability, maintainability, scalability and security of the system, and simplifies the maintenance and fault analysis process.
Smart Images

Figure CN119210855A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of communication technology, and in particular, relates to an external system interface anti-corrosion isolation method and system under a microservice architecture. Background Art
[0002] In the actual development process, it is inevitable to connect to some third-party systems, which usually involves integration with external services such as payment gateways, social media APIs, email services, authentication services, etc. Although this integration can provide additional functionality, it also brings some challenges, such as reliability, security, version management, etc.
[0003] However, due to the current negligence in the management of third-party codes, the third-party dependent code is tightly bound to the target business code, making the system more vulnerable to failures or errors in the third-party system, thereby reducing the reliability and stability of the system. When a third-party system updates its version or service agreement, since the third-party dependent code is tightly bound to the target business code, the code related to the system needs to be modified, which increases the complexity of maintenance work and is difficult to predict the extent of this impact. The tight binding between the system and the third-party system causes the system to be highly dependent on the third-party system, making it difficult to replace the third-party system and integrate it with other systems. The security of the system will be threatened, and these dependencies may be maliciously exploited or attacked, making the security and maintainability of the system worse. Summary of the invention
[0004] In view of the above-mentioned deficiencies in the prior art, the purpose of the invention is to provide an anti-corrosion isolation method for external system interfaces under a microservice architecture, which can decouple the business system from the third-party system, build an anti-corrosion layer, and isolate the business layer from the third-party system through the anti-corrosion layer, so that the business layer can indirectly call the third-party system through the anti-corrosion layer, thereby reducing the close dependence of the business system on the third-party system and improving the system reliability, maintainability, scalability and security.
[0005] In a first aspect of the present invention, a method for anti-corrosion isolation of external system interfaces under a microservice architecture is proposed, comprising:
[0006] S1, building a system layered architecture, wherein the system layered architecture includes a business layer, an anti-corrosion layer, an export gateway layer, and a third-party system;
[0007] S2, building the anti-corrosion layer, isolating the business layer from the third-party system through the anti-corrosion layer, so that the business layer indirectly calls the third-party system through the anti-corrosion layer;
[0008] S3, constructing the export gateway layer so that the anti-corrosion layer uniformly calls the interface of the third-party system through the export gateway layer.
[0009] Further, after S2, the external system interface anti-corrosion isolation method under the microservice architecture also includes:
[0010] S21, in the anti-corrosion layer, abstractly encapsulate the interface of the third-party system.
[0011] Further, after S3, the external system interface anti-corrosion isolation method under the microservice architecture also includes:
[0012] S4, in the egress gateway layer, uniformly record all interface call logs with third-party systems, the interface call logs including request parameters, response time, return value, and error information;
[0013] S5, when a fault occurs, the fuse mechanism is triggered, and the fault analysis is performed based on all recorded interface call logs with third-party systems.
[0014] Furthermore, the fault analysis in S5 according to all recorded interface call logs with the third-party system specifically includes:
[0015] S501: Preliminarily determine the type of fault based on the error information recorded in the log;
[0016] S502: Determine a specific analysis direction based on the initially determined fault type. The specific analysis direction includes: interface performance issues, request parameter issues, and return value issues.
[0017] S503: When the specific analysis direction is the interface performance problem, the interface delay and performance problem are determined by analyzing the response time of each call;
[0018] S504: When the specific analysis direction is a request parameter problem, compare the request parameters before and after the failure to confirm whether the parameters passed to the third-party system are correct;
[0019] S505: When the specific analysis direction is a return value problem, the return value is analyzed to confirm whether the data returned by the third-party system meets expectations.
[0020] Furthermore, the fault analysis in S5 according to all recorded interface call logs with the third-party system specifically includes:
[0021] A system status data sequence is obtained from the interface call log, and the system status data sequence is input into a long short-term memory neural network to perform fault analysis.
[0022] The second aspect of the present invention provides an external system interface anti-corrosion isolation system under a microservice architecture, comprising:
[0023] A construction module is used to construct a system layered architecture, wherein the system layered architecture includes a business layer, an anti-corrosion layer, an export gateway layer, and a third-party system;
[0024] A first building module is used to build the anti-corrosion layer, and isolate the business layer from the third-party system through the anti-corrosion layer, so that the business layer indirectly calls the third-party system through the anti-corrosion layer;
[0025] The second building module is used to build the export gateway layer so that the anti-corrosion layer can uniformly call the interface of the third-party system through the export gateway layer.
[0026] Furthermore, the external system interface anti-corrosion isolation system under the microservice architecture also includes:
[0027] The encapsulation module is used to abstractly encapsulate the interface of the third-party system in the anti-corrosion layer.
[0028] Furthermore, the external system interface anti-corrosion isolation system under the microservice architecture also includes:
[0029] A recording module is used to uniformly record all interface call logs with third-party systems in the egress gateway layer, wherein the interface call logs include request parameters, response time, return value, and error information;
[0030] The analysis module is used to trigger the fuse mechanism when a fault occurs, and perform fault analysis based on all recorded interface call logs with third-party systems.
[0031] Furthermore, the analysis module is specifically used for:
[0032] Preliminarily determine the type of fault based on the error information recorded in the log;
[0033] Determine the specific analysis direction based on the initially determined fault type, including: interface performance issues, request parameter issues, and return value issues;
[0034] When the specific analysis direction is interface performance issues, the interface delay and performance issues are determined by analyzing the response time of each call;
[0035] When the specific analysis direction is a request parameter problem, compare the request parameters before and after the failure to confirm whether the parameters passed to the third-party system are correct;
[0036] When the specific analysis direction is the return value problem, confirm whether the data returned by the third-party system meets expectations by analyzing the return value.
[0037] Furthermore, the analysis module is specifically used for:
[0038] A system status data sequence is obtained from the interface call log, and the system status data sequence is input into a long short-term memory neural network to perform fault analysis.
[0039] The beneficial effects of the present invention are as follows:
[0040] The external system interface anti-corrosion isolation method under the microservice architecture described in the present invention decouples the business system from the third-party system, builds an anti-corrosion layer, and isolates the business layer from the third-party system through the anti-corrosion layer, so that the business layer can indirectly call the third-party system through the anti-corrosion layer, thereby reducing the close dependence of the business system on the third-party system and improving the system reliability, maintainability, scalability and security. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings are only used to illustrate specific embodiments and are not considered to limit the present invention. In the entire drawings, the same reference symbols represent the same components. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings.
[0042] Figure 1 A schematic diagram of a flow chart of an external system interface anti-corrosion isolation method under a microservice architecture provided by an embodiment of the present invention;
[0043] Figure 2 A schematic diagram of an architecture for anti-corrosion isolation of an external system interface provided by an embodiment of the present invention;
[0044] Figure 3 A schematic diagram of the structure of an external system interface anti-corrosion isolation system under a microservice architecture provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0045] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work should fall within the scope of protection of the present invention.
[0046] Furthermore, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts disclosed in the present invention.
[0047] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the orientation or position relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inside", "outside", etc. is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the system or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. The terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0048] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of methods and systems consistent with some aspects of the present invention as detailed in the appended claims.
[0049] The present invention proposes an anti-corrosion isolation method for external system interfaces under a microservice architecture, in order to solve the current problem that due to the negligence of third-party code management, the code that the third party depends on is tightly bound to the target business code, and the system is more susceptible to the failure or error of the third-party system, thereby reducing the reliability and stability of the system. When the third-party system updates the version or service agreement, since the code that the third party depends on is tightly bound to the target business code, the code related to the system needs to be modified, which increases the complexity of maintenance work, and it is difficult to predict the extent of this impact. The tight binding between the system and the third-party system causes the system to be highly dependent on the third-party system, making it difficult to replace the third-party system and difficult to integrate with other systems. The security of the system will be threatened, and these dependencies may be maliciously exploited or attacked, causing the security and maintainability of the system to deteriorate.
[0050] Reference Manual Attached Figure 1 , showing a flow chart of an external system interface anti-corrosion isolation method under a microservice architecture provided by an embodiment of the present invention.
[0051] Reference Manual Attached Figure 2, showing a schematic diagram of the architecture of an external system interface anti-corrosion isolation provided by an embodiment of the present invention.
[0052] An embodiment of the present invention provides an external system interface anti-corrosion isolation method under a microservice architecture, comprising steps S1 to S3.
[0053] S1, build a system layered architecture, which includes the business layer, anti-corrosion layer, export gateway layer and third-party system.
[0054] Among them, the business layer focuses on processing the core business logic of the system.
[0055] The anti-corrosion layer is used as an isolation layer between the business layer and the third-party system. It isolates the business layer from the third-party system so that the business layer can indirectly call the third-party system through the anti-corrosion layer. The anti-corrosion layer provides a concise interface to the business layer, returning only the data that the business cares about, to avoid the specific details of the third-party interface from polluting the business logic. The logic for actually calling the third-party system interface is written in the anti-corrosion layer, so that if the third-party system changes, only adjustments need to be made at this level without having to change the business layer code.
[0056] Among them, the egress gateway layer is a unified outbound request manager, which is responsible for all requests to external systems. The egress gateway layer can implement functions such as logging of interface requests, security authentication, permission verification, and interface access current limiting and fuse. The egress gateway layer can also access the simulation (MOCK) system to provide backup response data when the third-party system is unavailable to maintain the stable operation of the system.
[0057] Among them, third-party systems refer to systems that do not belong to the current project. They usually provide some services or functions that this project needs to call to complete certain business logic. For example: payment gateways, social media APIs, email services, identity authentication services, etc.
[0058] It should be noted that each layer is independently responsible for matters related to its own field and interacts through clearly constructed interfaces, which effectively reduces the coupling between the system and third-party systems and provides higher flexibility and interoperability.
[0059] S2, build an anti-corrosion layer to isolate the business layer from the third-party system, so that the business layer can indirectly call the third-party system through the anti-corrosion layer.
[0060] Specifically, the code that calls third parties will be centrally managed, using a modular design approach to isolate modules from business codes, and create a third-party anti-corrosion layer module. Business codes do not directly call third-party interfaces, but access abstract encapsulation methods, and then the anti-corrosion layer accesses the third-party interfaces.
[0061] S3, build an export gateway layer so that the anti-corrosion layer can uniformly call the interface of the third-party system through the export gateway layer.
[0062] Optionally, the code logic for calling the third-party interface is written in the anti-corrosion layer, and the actual call is controlled through a unified export gateway layer.
[0063] Furthermore, the address configuration of the third party is centralized in the egress gateway management, and MOCK can be connected at the gateway layer, so that when the third-party system is unavailable, the system can be guaranteed to run normally and stably, making the environment controllable. The egress gateway layer uniformly logs the interface requests, publishes the logs through MQ, and then is subscribed to and stored by the log storage service, so as to help us discover and solve problems in a timely manner.
[0064] In the present invention, the system business and dependent layers are independently isolated through the modular design principle, the coupling between the system and the third-party system is reduced, and higher flexibility and interoperability are provided. The business interface is prevented from being polluted by abstract encapsulation of the third-party interface. Through centralized management and unified control of the export gateway, the normal and stable operation of the system can be guaranteed when the third-party system is unavailable, and problems can be discovered and solved in time through log records and storage services. Based on the above advantages, the method of the present invention brings great advantages and convenience to system development.
[0065] For example, an embodiment based on spring cloud feign+outGateway: by splitting and decoupling a coupled business interface according to the method of the present invention, it can be controlled. In addition, relevant logs are added to the called third-party interface to record the call information of the interface, such as input parameters, request body, return results, etc. The interface name can be http: / / systemA.com / systemA / getToken, which provides an interface for obtaining a token through a code. The request type of the interface is POST, and the request parameters include the code authorization code and the grant_type authentication method. The system modules involved in this scenario are: kunlun-console; this module belongs to the core module of the system, and a failure will cause the system to be unavailable. There is an interface kunlun-console / getToken in this module, which receives a parameter, then calls the third interface to obtain data, and returns the "access_token" therein to the front end. The external system can be called systemA. In the above scenario, kunlun-console, as the core module of the system, directly calls the external third-party interface and is coupled with the third-party system. The third-party interface itself is always modified, which will cause the core module to shut down and modify, affecting the stability of the system. Based on the layered decoupling principle of the present invention, the third-party calling code is not stored in the business module, and the related calling code is moved to other modules, so a new module kunlun-third is created; then based on the anti-corrosion encapsulation principle, the third-party interface is abstractly encapsulated, and a concise interface is provided for the business layer to use. The current business layer only cares about "access_token", so the encapsulated interface only returns the fields of concern.
[0066] In a possible implementation manner, after S2, the method further includes:
[0067] S21, in the anti-corrosion layer, abstractly encapsulate the interfaces of third-party systems.
[0068] In the present invention, the interface of the third-party system is encapsulated using an abstract method, a concise and abstract interface is provided internally, and only parameters and returns of business concern are returned, thereby preventing the business interface from being polluted by the third-party interface parameters and returns.
[0069] In a possible implementation manner, after S3, the method further includes:
[0070] S4, in the export gateway layer, uniformly record all interface call logs with third-party systems. The interface call logs include request parameters, response time, return value, and error information.
[0071] S5, when a fault occurs, the fuse mechanism is triggered, and the fault analysis is performed based on all recorded interface call logs with third-party systems.
[0072] In the present invention, the fuse mechanism can automatically interrupt the communication with the third-party system when it detects that the error rate is too high or the response time is too long, so as to prevent the other party's performance problems from spreading to the entire system. When a system failure occurs, the complete log records can help to quickly analyze the cause of the problem, such as whether the third-party interface call parameter is wrong, the response is too slow, or an incorrect result is returned. By analyzing the logs, targeted system adjustments can be made to reduce the recurrence of failures.
[0073] In a possible implementation manner, performing fault analysis according to all recorded interface call logs with third-party systems in S5 specifically includes:
[0074] S501: Preliminarily determine the type of fault based on the error information recorded in the log.
[0075] For example, HTTP status code 500 series error (server error): usually a third-party server failure. 400 series error (client error): common causes include incorrect parameters, authentication failure, permission issues, etc. 504 error (gateway timeout): the third-party system response timed out, which may be due to excessive load on the third-party service or network problems.
[0076] Furthermore, if the response time in the log is too long or even times out, it means that the third-party service may have performance issues during processing, and the service retry mechanism or caching solution may need to be adjusted.
[0077] S502: Determine a specific analysis direction based on the initially determined fault type. The specific analysis direction includes: interface performance issues, request parameter issues, and return value issues.
[0078] S503: When the specific analysis direction is the interface performance problem, the interface delay and performance problem are determined by analyzing the response time of each call.
[0079] If the response time is obviously too long, it means that there may be a network bottleneck, low third-party service processing efficiency, or excessive system load during the call process. In this case, you can check the network status between the egress gateway and the third-party system. Analyze the response speed and load of the third-party system and optimize it together. Consider using a caching mechanism to reduce frequent calls to the third-party system.
[0080] S504: When the specific analysis direction is a request parameter problem, compare the request parameters before and after the failure to confirm whether the parameters passed to the third-party system are correct.
[0081] Incorrect request parameters may cause the third-party system to be unable to process and return an error response. For example, you need to check whether the parameters in the interface log comply with the interface specifications (such as null values, format mismatch, etc.).
[0082] S505: When the specific analysis direction is a return value problem, the return value is analyzed to confirm whether the data returned by the third-party system meets expectations.
[0083] If the third-party system returns a clear error code or error message, check whether this information is consistent with the error description in the third-party interface document and locate the specific problem (such as authorization failure, data does not exist, etc.).
[0084] In the present invention, by analyzing log records, judging the fault type from the error information, analyzing the performance problem from the response time, checking the request parameters, analyzing the return value, etc., it can help the development and operation and maintenance teams to quickly locate the source of the problem and take corresponding solutions for different types of faults. This not only improves the efficiency of fault diagnosis, system stability, and the efficiency of development and operation, but also significantly shortens the fault repair time and improves the robustness of the system and user experience.
[0085] In a possible implementation manner, performing fault analysis according to all recorded interface call logs with third-party systems in S5 specifically includes:
[0086] The system status data sequence is obtained from the interface call log and input into the long short-term memory neural network for fault analysis.
[0087] Among them, the long short-term memory neural network (LSTM) is a special form of recurrent neural network (RNN), which is specifically used to solve the limitations of standard RNN in dealing with long-term dependency problems. Although traditional RNN can process sequence data, it cannot effectively memorize long-distance information when processing long time series due to the gradient vanishing problem. LSTM can better retain and control long-term dependency information by introducing special units and gating mechanisms, so it has been widely used in time series, natural language processing, speech recognition and other tasks.
[0088] In the present invention, the system status data sequence is input into the long short-term memory neural network (LSTM) for fault analysis, which brings the advantages of intelligence, automation and precision. It can not only automatically detect anomalies, but also predict fault trends in advance, reduce human intervention and improve the operating efficiency of the system. When facing complex distributed systems and dynamically changing third-party interfaces, LSTM has adaptability and scalability, can provide more accurate and timely fault analysis, and help ensure the high availability and stability of the system.
[0089] Specifically, the working principle of long short-term memory neural network is as follows:
[0090] I t =Sigmoid(W XI X t +W HI h t-1 +b I )
[0091] F t =Sigmoid(W XF X t +W HF h t-1 +b F )
[0092] O t =Sigmoid(W XO X t +W HO h t-1 +b O )
[0093]
[0094] h t =O t tanh(C t )
[0095] Among them, X t represents the system status data sequence at time t, I t represents the activation output vector of the input gate at time t, Sigmoid() represents the Sigmoid activation function, and W XI Represents the weight matrix between the word segmentation sequence and the input gate, W HI represents the weight matrix between the hidden state and the input gate, b I represents the bias term of the input gate, F t represents the activation output vector of the forget gate at time t, W XF Represents the weight matrix between the word segmentation sequence and the forget gate, W HF represents the weight matrix between the hidden state and the forget gate, b F represents the bias term of the forget gate, O t represents the activation output vector of the output gate at time t, W XO Represents the weight matrix between the word segmentation sequence and the output gate, W HO represents the weight matrix between the hidden state and the output gate, b O represents the bias term of the output gate, C t represents the activation output vector of the cell storage unit at time t, represents the temporary cell state of the cell storage unit at time t, C t-1 represents the activation output vector of the cell storage unit at time t-1, tanh() represents the tanh activation function, W XC Represents the weight matrix between the word segmentation sequence and the cell storage unit, W HC represents the weight matrix between the hidden state and the cell storage unit, b C represents the bias term of the cell storage unit, h t represents the hidden state at time t, h t-1 represents the hidden state at time t-1, and t represents time.
[0096] Then predict the failure based on the hidden state:
[0097] P = Softmax(W h h t +b h )
[0098] P={p1,L,p i ,L,p n}
[0099] Where P represents the fault diagnosis result, W h represents the fault prediction weight matrix, b h represents the fault prediction bias term, p i represents the probability that the fault belongs to the i-th fault type, and n represents the total number of fault types.
[0100] Furthermore, the fault type with the largest probability value is taken as the fault detection result of this time.
[0101] The beneficial effects of the present invention are as follows:
[0102] The anti-corrosion isolation method for external system interfaces under the microservice architecture of the present invention decouples the business system from the third-party system, builds an anti-corrosion layer, and isolates the business layer from the third-party system through the anti-corrosion layer, so that the business layer can indirectly call the third-party system through the anti-corrosion layer, thereby reducing the close dependence of the business system on the third-party system and improving the system reliability, maintainability, scalability and security.
[0103] Reference Manual Attached Figure 3 , showing a structural schematic diagram of an external system interface anti-corrosion isolation system under a microservice architecture provided by an embodiment of the present invention.
[0104] An external system interface anti-corrosion isolation system 20 under a microservice architecture provided by an embodiment of the present invention includes:
[0105] The construction module 201 is used to construct a system layered architecture, which includes a business layer, an anti-corrosion layer, an export gateway layer, and a third-party system.
[0106] The first building module 202 is used to build an anti-corrosion layer, and isolate the business layer from the third-party system through the anti-corrosion layer, so that the business layer can indirectly call the third-party system through the anti-corrosion layer.
[0107] The second building module 203 is used to build an export gateway layer so that the anti-corrosion layer can uniformly call the interface of the third-party system through the export gateway layer.
[0108] Furthermore, the external system interface anti-corrosion isolation system under the microservice architecture also includes:
[0109] The encapsulation module 204 is used to abstractly encapsulate the interface of the third-party system in the anti-corrosion layer.
[0110] Furthermore, the external system interface anti-corrosion isolation system under the microservice architecture also includes:
[0111] The recording module 205 is used to uniformly record all interface call logs with third-party systems in the egress gateway layer. The interface call logs include request parameters, response time, return value, and error information.
[0112] The analysis module 206 is used to trigger the fuse mechanism when a fault occurs, and perform fault analysis based on all recorded interface call logs with third-party systems.
[0113] Furthermore, the analysis module 206 is specifically used for:
[0114] Preliminarily determine the type of fault based on the error information recorded in the log.
[0115] Determine the specific analysis direction based on the initially determined fault type. The specific analysis directions include: interface performance issues, request parameter issues, and return value issues.
[0116] When the specific analysis direction is interface performance issues, the interface delay and performance issues are determined by analyzing the response time of each call.
[0117] When the specific analysis direction is a request parameter problem, compare the request parameters before and after the failure to confirm whether the parameters passed to the third-party system are correct.
[0118] When the specific analysis direction is the return value problem, confirm whether the data returned by the third-party system meets expectations by analyzing the return value.
[0119] Furthermore, the analysis module 206 is specifically used for:
[0120] The system status data sequence is obtained from the interface call log and input into the long short-term memory neural network for fault analysis.
[0121] The external system interface anti-corrosion isolation system 20 under the microservice architecture provided in the embodiment of the present invention can implement each step of the external system interface anti-corrosion isolation method under the above-mentioned microservice architecture and achieve the same effect. To avoid repetition, the present invention will not go into details.
[0122] The beneficial effects of the present invention are as follows:
[0123] The external system interface anti-corrosion isolation method under the microservice architecture described in the present invention decouples the business system from the third-party system, builds an anti-corrosion layer, and isolates the business layer from the third-party system through the anti-corrosion layer, so that the business layer can indirectly call the third-party system through the anti-corrosion layer, thereby reducing the close dependence of the business system on the third-party system and improving the system reliability, maintainability, scalability and security.
[0124] The applicant of the present invention has made a detailed explanation and description of the implementation examples of the present invention in conjunction with the drawings in the specification. However, those skilled in the art should understand that the above implementation examples are only preferred implementation schemes of the present invention, and the detailed description is only to help readers better understand the spirit of the present invention, but not to limit the scope of protection of the present invention. On the contrary, any improvements or modifications based on the inventive spirit of the present invention should fall within the scope of protection of the present invention.
[0125] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the above embodiments, or replace some of the technical features therein by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. Any changes or replacements that can be easily thought of by those skilled in the art within the technical scope disclosed in the present invention should be covered within the protection scope of the present invention.
Claims
1. A method for anti-corrosion isolation of external system interfaces under a microservice architecture, characterized in that: include: S1, building a system layered architecture, wherein the system layered architecture includes a business layer, an anti-corrosion layer, an export gateway layer, and a third-party system; S2, building the anti-corrosion layer, isolating the business layer from the third-party system through the anti-corrosion layer, so that the business layer indirectly calls the third-party system through the anti-corrosion layer; S3, constructing the export gateway layer so that the anti-corrosion layer uniformly calls the interface of the third-party system through the export gateway layer.
2. The method for anti-corrosion isolation of external system interfaces under a microservice architecture according to claim 1, characterized in that: After S2, it also includes: S21, in the anti-corrosion layer, abstractly encapsulate the interface of the third-party system.
3. The method for anti-corrosion isolation of external system interfaces under microservice architecture according to claim 1, characterized in that: After S3, it also includes: S4, in the egress gateway layer, uniformly record all interface call logs with third-party systems, the interface call logs including request parameters, response time, return value, and error information; S5, when a fault occurs, the fuse mechanism is triggered, and the fault analysis is performed based on all recorded interface call logs with third-party systems.
4. The method for anti-corrosion isolation of external system interfaces under microservice architecture according to claim 3 is characterized in that: The fault analysis in S5 according to all recorded interface call logs with the third-party system specifically includes: S501: Preliminarily determine the type of fault based on the error information recorded in the log; S502: Determine a specific analysis direction based on the initially determined fault type. The specific analysis direction includes: interface performance issues, request parameter issues, and return value issues. S503: When the specific analysis direction is the interface performance problem, the interface delay and performance problem are determined by analyzing the response time of each call; S504: When the specific analysis direction is a request parameter problem, compare the request parameters before and after the failure to confirm whether the parameters passed to the third-party system are correct; S505: When the specific analysis direction is a return value problem, the return value is analyzed to confirm whether the data returned by the third-party system meets expectations.
5. The method for anti-corrosion isolation of external system interfaces under microservice architecture according to claim 3 is characterized in that: The fault analysis in S5 according to all recorded interface call logs with the third-party system specifically includes: A system status data sequence is obtained from the interface call log, and the system status data sequence is input into a long short-term memory neural network to perform fault analysis.
6. An external system interface anti-corrosion isolation system under a microservice architecture, characterized in that: include: A construction module is used to construct a system layered architecture, wherein the system layered architecture includes a business layer, an anti-corrosion layer, an export gateway layer, and a third-party system; A first building module is used to build the anti-corrosion layer, and isolate the business layer from the third-party system through the anti-corrosion layer, so that the business layer indirectly calls the third-party system through the anti-corrosion layer; The second building module is used to build the export gateway layer so that the anti-corrosion layer can uniformly call the interface of the third-party system through the export gateway layer.
7. The external system interface anti-corrosion isolation system under the microservice architecture according to claim 6, characterized in that: Also includes: The encapsulation module is used to abstractly encapsulate the interface of the third-party system in the anti-corrosion layer.
8. The external system interface anti-corrosion isolation system under the microservice architecture according to claim 6, characterized in that: Also includes: A recording module is used to uniformly record all interface call logs with third-party systems in the egress gateway layer, wherein the interface call logs include request parameters, response time, return value, and error information; The analysis module is used to trigger the fuse mechanism when a fault occurs, and perform fault analysis based on all recorded interface call logs with third-party systems.
9. The external system interface anti-corrosion isolation system under the microservice architecture according to claim 8, characterized in that: The analysis module is specifically used for: Preliminarily determine the type of fault based on the error information recorded in the log; Determine the specific analysis direction based on the initially determined fault type, including: interface performance issues, request parameter issues, and return value issues; When the specific analysis direction is interface performance issues, the interface delay and performance issues are determined by analyzing the response time of each call; When the specific analysis direction is a request parameter problem, compare the request parameters before and after the failure to confirm whether the parameters passed to the third-party system are correct; When the specific analysis direction is the return value problem, confirm whether the data returned by the third-party system meets expectations by analyzing the return value.
10. The external system interface anti-corrosion isolation system under the microservice architecture according to claim 8, characterized in that: The analysis module is specifically used for: A system status data sequence is obtained from the interface call log, and the system status data sequence is input into a long short-term memory neural network to perform fault analysis.
