Method and device for analyzing microservice association relationship of distributed system
By acquiring and analyzing the historical transaction data of the distributed system, using prediction models to predict future transaction data, and analyzing the microservice association relationship in simulated failure scenarios, the transaction risk problem caused by the complex relationship between microservice association in the distributed system is solved, and the transaction risk problem is achieved. The impact assessment and risk reduction on the transaction link are carried out.
Patent Information
- Application Number
- CN202111414285.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-25
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2041-11-25
AI Technical Summary
In distributed systems, the relationship between microservices is complex, resulting in increased transaction risks, and it is difficult for the existing technology to effectively determine and analyze these relationships.
By obtaining the historical transaction data of the target trading scenario, using the trained transaction prediction model to predict future transaction data, and analyzing the correlation relationship between microservices in the simulation failure scenario, obtaining transaction risk data, thereby determining the microservices of each system The relationship between the two.
By reducing transaction risks, by accurately analyzing the correlation between microservices, the impact of the complete transaction link can be determined, thereby optimizing the distributed architecture and designing emergency response plans.
Smart Images

Figure CN113988873B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and in particular to a method and device for analyzing the association relationship of microservices in a distributed system. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the invention recited in the claims. No admission is made that the description herein is prior art by inclusion in this section.
[0003] With the rise and development of Internet finance, the gradual enrichment of banking business scenarios and the increase in demand for system capacity have prompted the transformation of banking systems from centralized to distributed. Distributed architecture has split the original system into services. For users, a complete transaction process is divided into multiple microservices in the distributed architecture. Each microservice may exist in a different system, which makes the service interaction between systems frequent and the path complex. It is impossible to determine the relationship between the microservices of each system, resulting in increasing transaction risks. Summary of the invention
[0004] The embodiment of the present invention provides a method for analyzing the association relationship of microservices in a distributed system, so as to determine the association relationship between microservices of each system, thereby reducing transaction risks. The method includes:
[0005] Obtain historical transaction data for the historical transaction time period corresponding to the target transaction scenario;
[0006] Inputting historical transaction data of the historical transaction time period corresponding to the target transaction scenario into the transaction prediction model to predict the transaction distribution data of the future transaction time period corresponding to the target transaction scenario, wherein the transaction prediction model is trained based on the historical transaction data of each transaction scenario in its corresponding historical transaction time period;
[0007] Using the transaction distribution data of the future transaction time period corresponding to the target transaction scenario to simulate the initiation of a transaction, and setting any one or more transaction systems in the distributed system corresponding to the microservice required by the target transaction scenario to fail, to obtain transaction test data, the transaction test data including the transaction risk data of each transaction system in the distributed system corresponding to the microservice required by the target transaction scenario;
[0008] Based on the transaction test data, the association relationship between the microservices required for the target transaction scenario is analyzed.
[0009] The embodiment of the present invention further provides a device for analyzing the association relationship of microservices in a distributed system, so as to determine the association relationship between microservices of each system, thereby reducing transaction risks. The device includes:
[0010] A data acquisition module, used to acquire historical transaction data of a historical transaction time period corresponding to a target transaction scenario;
[0011] A data prediction module, used to input historical transaction data of a historical transaction time period corresponding to a target transaction scenario into a transaction prediction model, and predict transaction distribution data of a future transaction time period corresponding to the target transaction scenario, wherein the transaction prediction model is trained based on historical transaction data of each transaction scenario in its corresponding historical transaction time period;
[0012] A simulated transaction module is used to simulate the initiation of a transaction using the transaction distribution data of the future transaction time period corresponding to the target transaction scenario, and to set any one or more transaction systems in the distributed system corresponding to the microservice required by the target transaction scenario to fail, so as to obtain transaction test data, wherein the transaction test data includes the transaction risk data of each transaction system in the distributed system corresponding to the microservice required by the target transaction scenario;
[0013] Based on the transaction test data, the association relationship between the microservices required for the target transaction scenario is analyzed.
[0014] An embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for analyzing the association relationship of microservices in a distributed system when executing the computer program.
[0015] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for analyzing the association relationship of microservices in a distributed system is implemented.
[0016] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the method for analyzing the association relationship of microservices in a distributed system is implemented.
[0017] In an embodiment of the present invention, historical transaction data of a historical transaction time period corresponding to a target transaction scenario is obtained; the historical transaction data of a historical transaction time period corresponding to the target transaction scenario is input into a transaction prediction model to predict transaction distribution data of a future transaction time period corresponding to the target transaction scenario, wherein the transaction prediction model is obtained by training the historical transaction data of the historical transaction time period corresponding to each transaction scenario; the transaction distribution data of the future transaction time period corresponding to the target transaction scenario is used to simulate the initiation of a transaction, and any one or more transaction systems in the distributed system corresponding to the microservices required by the target transaction scenario are set to fail, and transaction test data is obtained, wherein the transaction test data includes transaction risk data of each transaction system in the distributed system corresponding to the microservices required by the target transaction scenario; and the association relationship between the microservices required by the target transaction scenario is analyzed according to the transaction test data. In this way, the embodiment of the present invention can predict the transaction distribution data of the future transaction time period through the historical transaction data of the historical transaction time period corresponding to the target transaction scenario, and use the predicted transaction distribution data of the future transaction time period to simulate transactions under different transaction system failure scenarios, obtain transaction test data including transaction risk data of each transaction system, and analyze the association relationship between the microservices required by the target transaction scenario according to the transaction test data, so as to determine the impact of each transaction system on the complete transaction link, thereby reducing the transaction risk. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0019] Figure 1 A flow chart of a method for analyzing the association relationship of microservices in a distributed system provided in an embodiment of the present invention;
[0020] Figure 2 A flow chart of a training and testing method for a transaction prediction model in a distributed system microservice association relationship process provided in an embodiment of the present invention;
[0021] Figure 3 A flowchart of another method for analyzing the association relationship of microservices in a distributed system provided in an embodiment of the present invention;
[0022] Figure 4 A flowchart of another method for analyzing the association relationship of microservices in a distributed system provided in an embodiment of the present invention;
[0023] Figure 5A flowchart of another method for analyzing the association relationship of microservices in a distributed system provided in an embodiment of the present invention;
[0024] Figure 6 A schematic diagram of a device for analyzing the association relationship of microservices in a distributed system provided in an embodiment of the present invention;
[0025] Figure 7 A schematic diagram of another device for analyzing the association relationship of microservices in a distributed system provided in an embodiment of the present invention;
[0026] Figure 8 A schematic diagram of a device for analyzing the association relationship of microservices in a distributed system provided in an embodiment of the present invention;
[0027] Fig. 9 A schematic diagram of another device for analyzing the association relationship of microservices in a distributed system provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0028] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0029] In the description of this specification, the terms "include", "including", "have", "contain", etc. are all open terms, which mean including but not limited to. The descriptions with reference to the terms "one embodiment", "a specific embodiment", "some embodiments", "for example", etc. mean that the specific features, structures or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. The order of steps involved in each embodiment is used to schematically illustrate the implementation of the present application, and the order of steps is not limited and can be appropriately adjusted as needed.
[0030] Terminology explanation:
[0031] Centralized system: refers to a system built on a high-performance computer, with a large central processing system as the core, which displays the overall function to the user. It has extremely high requirements on the system's computing, storage and other capabilities.
[0032] Distributed system: refers to a network system built on software, which consists of multiple independent computers that jointly present a functional whole to users. It has the advantages of high reliability and scalability.
[0033] At present, with the rise and development of Internet finance, the gradual enrichment of banking business scenarios and the increase in demand for system capacity have prompted the transformation of banking systems from centralized systems to distributed systems. The distributed architecture has split the original system into services. For customers, a complete transaction process is divided into multiple microservices in the distributed architecture, and each microservice may exist in different systems. This makes the service interactions between systems frequent, the paths complex, and the risks increased. The analysis of the relationship between system services cannot be ignored.
[0034] Therefore, in order to determine the association relationship between microservices in a distributed system and reduce transaction risks, an embodiment of the present invention provides a method for analyzing the association relationship between microservices in a distributed system, such as Figure 1 As shown, the method includes:
[0035] Step 101, obtaining historical transaction data of a historical transaction time period corresponding to a target transaction scenario;
[0036] Step 102, inputting historical transaction data of the historical transaction time period corresponding to the target transaction scenario into a transaction prediction model, and predicting transaction distribution data of the future transaction time period corresponding to the target transaction scenario, wherein the transaction prediction model is trained based on the historical transaction data of each transaction scenario in its corresponding historical transaction time period;
[0037] Step 103, using the transaction distribution data of the future transaction time period corresponding to the target transaction scenario to simulate the initiation of a transaction, and setting any one or more transaction systems in the distributed system corresponding to the microservice required by the target transaction scenario to fail, to obtain transaction test data, wherein the transaction test data includes transaction risk data of each transaction system in the distributed system corresponding to the microservice required by the target transaction scenario;
[0038] Step 104: Analyze the association relationship between the microservices required for the target transaction scenario based on the transaction test data.
[0039] In an embodiment of the present invention, historical transaction data of a historical transaction time period corresponding to a target transaction scenario is obtained; the historical transaction data of a historical transaction time period corresponding to the target transaction scenario is input into a transaction prediction model to predict transaction distribution data of a future transaction time period corresponding to the target transaction scenario, wherein the transaction prediction model is obtained by training the historical transaction data of the historical transaction time period corresponding to each transaction scenario; the transaction distribution data of the future transaction time period corresponding to the target transaction scenario is used to simulate the initiation of a transaction, and any one or more transaction systems in the distributed system corresponding to the microservices required by the target transaction scenario are set to fail, and transaction test data is obtained, wherein the transaction test data includes transaction risk data of each transaction system in the distributed system corresponding to the microservices required by the target transaction scenario; and the association relationship between the microservices required by the target transaction scenario is analyzed according to the transaction test data. In this way, the embodiment of the present invention can predict the transaction distribution data of the future transaction time period through the historical transaction data of the historical transaction time period corresponding to the target transaction scenario, and use the predicted transaction distribution data of the future transaction time period to simulate transactions under different transaction system failure scenarios, obtain transaction test data including transaction risk data of each transaction system, and analyze the association relationship between the microservices required by the target transaction scenario according to the transaction test data, so as to determine the impact of each transaction system on the complete transaction link, thereby reducing the transaction risk.
[0040] In the above step 101, the distributed system corresponding to the microservices required for transactions in the target transaction scenario can be determined by analyzing the business process of the transaction scenario and the distributed system architecture requirements corresponding to the business process, and the historical transaction data in the historical transaction time period can be obtained from each transaction system corresponding to the distributed system.
[0041] Among them, the above-mentioned target transaction scenario can be a transaction scenario corresponding to a hot transaction time period or a special transaction time period, and different transaction scenarios can correspond to different transaction time periods.
[0042] For example, the target transaction scenario may be "Double Eleven", and the corresponding transaction period of "Double Eleven" is from November 1 to November 11; the historical transaction data from November 1 to November 11 of previous years can be obtained. Specifically, the historical transaction data during the "Double Eleven" period of the past three years, or the historical transaction data during the "Double Eleven" period of the past five years, or the historical transaction data during the "Double Eleven" period of the past year can be obtained. The scope of obtaining historical transaction data can be set according to the specific application scenario, and is not limited here.
[0043] For another example, in October, the number of failures in the various transaction systems of the distributed system is relatively high, so the target transaction scenario can also be defined as the "frequent failure time period", and the corresponding transaction time period is from October 1 to October 31. Then, the historical transaction data from October 1 to October 31 of previous years can be obtained.
[0044] In the above step 102, the transaction distribution data of the future transaction time period corresponding to the target transaction scenario can be predicted based on the historical transaction data of the historical transaction time period corresponding to the target transaction scenario obtained in step 101.
[0045] The transaction distribution data includes the transaction time and the transaction data corresponding to the transaction time.
[0046] In specific implementation, the historical transaction data of the historical transaction time period corresponding to the target transaction scenario can be input into the transaction prediction model to predict the transaction distribution data of the future transaction time period corresponding to the target transaction scenario. For example, the transaction distribution data of "Double Eleven" in 2022 (i.e., November 1 to November 11) can be predicted based on the historical transaction data during the 2020 and 2021 "Double Eleven" period, and the future transaction time period is November 1 to November 11, 2022.
[0047] In addition, in the embodiment of the present invention, the above-mentioned transaction prediction model is obtained by training based on the historical transaction data of each transaction scenario in its corresponding historical transaction time period.
[0048] like Figure 2 As shown, a flow chart of a method for training and testing a transaction prediction model in a distributed system microservice association relationship analysis process provided by an embodiment of the present invention includes the following steps:
[0049] Step 201, obtaining historical transaction data and corresponding transaction distribution data of each transaction scenario in its corresponding historical transaction time period, and constructing a training set and a test set;
[0050] Step 202, training a neural network model using the training set to obtain a transaction prediction model;
[0051] Step 203: Test the transaction prediction model using the test set.
[0052] In the specific implementation, the historical transaction data and corresponding transaction distribution data of each transaction scenario in its corresponding historical transaction time period are obtained, and the training set and test set are constructed according to the preset ratio. The training set is used to train the neural network model to obtain the transaction prediction model; the test set is used to test the transaction prediction model.
[0053] In this way, the transaction distribution data of the future transaction time period corresponding to the target transaction scenario is predicted through the historical transaction data of the historical transaction time period of the target transaction scenario, so that in the subsequent steps, the transaction scenario is simulated based on the transaction distribution data of the future transaction time period corresponding to the target transaction scenario, and the transaction test data obtained is more accurate, and then the distributed system microservice association relationship obtained by analysis is also more accurate.
[0054] In the above step 103, the transaction distribution data of the future transaction time period corresponding to the target transaction scenario is used to simulate the initiation of a transaction, and any one or more transaction systems in the distributed system corresponding to the microservices required by the target transaction scenario are set to fail to obtain transaction test data.
[0055] Among them, the transaction test data includes the transaction risk data of each transaction system in the distributed system corresponding to the microservices required by the target transaction scenario.
[0056] According to the above description, the transaction distribution data includes the transaction time and the transaction data corresponding to the transaction time. Figure 3 As shown, the above step 103 may specifically include:
[0057] Step 301, in the order of transaction times, using the transaction data corresponding to the transaction times to simulate initiating a transaction, and setting any one or more transaction systems in the distributed system corresponding to the microservices required by the target transaction scenario to fail, to obtain transaction test data when any one or more transaction systems in the distributed system corresponding to the microservices required by the target transaction scenario fail.
[0058] In the embodiment of the present invention, after step 301, if Figure 4 As shown, it also includes:
[0059] Step 401 , storing transaction test data in a data pool when any one or more transaction systems in the distributed system corresponding to the microservices required by the target transaction scenario fail.
[0060] In addition, in the embodiment of the present invention, if any one or more transaction systems in the distributed system corresponding to the microservices required by the target transaction scenario fail, the failure can be simulated by setting a baffle program.
[0061] like Figure 5 As shown, before the above step 103, the following steps may also be included:
[0062] Step 501 , respectively configure a baffle program for any one or more transaction systems in the distributed system corresponding to the microservices required by the target transaction scenario, wherein the baffle program is used to simulate a transaction system failure.
[0063] It should be noted that in the embodiment of the present invention, other existing technologies may also be used to simulate a trading system failure, which is not limited here.
[0064] For example, for the target transaction scenario "Double Eleven", it is assumed that its corresponding transaction process includes four microservices a, b, c, and d, which exist in three transaction systems A, B, C, and B respectively. Based on the historical transaction data of 2020 and 2021, the transaction distribution data of "Double Eleven" in 2022 is predicted through the transaction prediction model. The predicted transaction distribution data of "Double Eleven" in 2022 is used to simulate the actual operation situation and initiate transactions according to the data at the transaction time. By setting the program baffle, the B system failure is set in a targeted manner, thereby testing the impact and risk of the B system on the "Double Eleven" transaction scenario, and evaluating the relationship between the B system microservice and each microservice of the A and C systems. By analogy, the A system failure, or the C system failure, or the A and B system failure, or the A and C system failure, or the B and C system failure, etc. are set in a targeted manner to obtain the transaction test data of each transaction system under different transaction system failure scenarios.
[0065] In the above step 104, a single-scenario or multi-scenario comprehensive analysis may be performed on the transaction test data under different transaction system failure scenarios to determine the association relationship between the microservices required for the target transaction scenario.
[0066] In this way, based on the analysis results in step 104, emergency response plans can be designed and rehearsed, or distributed architecture can be optimized to reduce transaction risks in actual transactions.
[0067] For example, based on the analysis results of transaction test data under the B system failure scenario, an emergency response plan can be designed and drilled to deal with the transaction risks brought about by the B system failure in real transactions.
[0068] For another example, the functions of the microservices in system B can be optimized based on the association relationships between the microservices required for the target transaction scenario.
[0069] The embodiment of the present invention also provides a device for analyzing the association relationship of distributed system microservices, as described in the following embodiment. Since the principle of solving the problem by the device is similar to the method for analyzing the association relationship of distributed system microservices, the implementation of the device can refer to the implementation of the method for analyzing the association relationship of distributed system microservices, and the repeated parts will not be repeated.
[0070] like Figure 6 FIG. 1 is a schematic diagram of a device for analyzing a distributed system microservice association relationship provided by an embodiment of the present invention, wherein the device includes:
[0071] The data acquisition module 601 is used to acquire historical transaction data of a historical transaction time period corresponding to a target transaction scenario;
[0072] Data prediction module 602, used to input historical transaction data of the historical transaction time period corresponding to the target transaction scenario into a transaction prediction model, and predict the transaction distribution data of the future transaction time period corresponding to the target transaction scenario, wherein the transaction prediction model is trained based on the historical transaction data of each transaction scenario in its corresponding historical transaction time period;
[0073] The simulated transaction module 603 is used to simulate the initiation of a transaction using the transaction distribution data of the future transaction time period corresponding to the target transaction scenario, and set any one or more transaction systems in the distributed system corresponding to the microservice required by the target transaction scenario to fail, and obtain transaction test data, wherein the transaction test data includes the transaction risk data of each transaction system in the distributed system corresponding to the microservice required by the target transaction scenario;
[0074] The analysis module 604 is used to analyze the association relationship between the microservices required for the target transaction scenario based on the transaction test data.
[0075] In one embodiment of the present invention, the transaction distribution data includes a transaction time and transaction data corresponding to the transaction time;
[0076] The simulated transaction module 603 is specifically used for:
[0077] In the order of transaction times, the transaction data corresponding to the transaction times are used to simulate the initiation of transactions, and any one or more transaction systems in the distributed system corresponding to the microservices required by the target transaction scenario are set to fail, so as to obtain transaction test data when any one or more transaction systems in the distributed system corresponding to the microservices required by the target transaction scenario fail.
[0078] In one embodiment of the present invention, Figure 7 As shown, the data storage module 701 is also included, which is specifically used for:
[0079] The transaction test data in the case of failure of any one or more transaction systems in the distributed system corresponding to the microservices required by the target transaction scenario is stored in the data pool.
[0080] In one embodiment of the present invention, Figure 8 As shown, it also includes a fault configuration module 801, which is specifically used to:
[0081] A baffle program is configured for any one or more transaction systems in the distributed system corresponding to the microservices required by the target transaction scenario, respectively, and the baffle program is used to simulate a transaction system failure.
[0082] In one embodiment of the present invention, Fig. 9 As shown, it also includes a model training and testing module 901, which is used to:
[0083] Obtain the historical transaction data and corresponding transaction distribution data of each transaction scenario in its corresponding historical transaction time period, and construct training sets and test sets;
[0084] Use the training set to train the neural network model to obtain a transaction prediction model;
[0085] The transaction prediction model is tested using the test set.
[0086] An embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for analyzing the association relationship of microservices in a distributed system when executing the computer program.
[0087] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for analyzing the association relationship of microservices in a distributed system is implemented.
[0088] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the method for analyzing the association relationship of microservices in a distributed system is implemented.
[0089] In an embodiment of the present invention, historical transaction data of a historical transaction time period corresponding to a target transaction scenario is obtained; the historical transaction data of a historical transaction time period corresponding to the target transaction scenario is input into a transaction prediction model to predict transaction distribution data of a future transaction time period corresponding to the target transaction scenario, wherein the transaction prediction model is obtained by training the historical transaction data of the historical transaction time period corresponding to each transaction scenario; the transaction distribution data of the future transaction time period corresponding to the target transaction scenario is used to simulate the initiation of a transaction, and any one or more transaction systems in the distributed system corresponding to the microservices required by the target transaction scenario are set to fail, and transaction test data is obtained, wherein the transaction test data includes transaction risk data of each transaction system in the distributed system corresponding to the microservices required by the target transaction scenario; and the association relationship between the microservices required by the target transaction scenario is analyzed according to the transaction test data. In this way, the embodiment of the present invention can predict the transaction distribution data of the future transaction time period through the historical transaction data of the historical transaction time period corresponding to the target transaction scenario, and use the predicted transaction distribution data of the future transaction time period to simulate transactions under different transaction system failure scenarios, obtain transaction test data including transaction risk data of each transaction system, and analyze the association relationship between the microservices required by the target transaction scenario according to the transaction test data, so as to determine the impact of each transaction system on the complete transaction link, thereby reducing the transaction risk.
[0090] In an embodiment of the present invention, the transaction distribution data of the future transaction time period corresponding to the target transaction scenario is predicted through the historical transaction data of the historical transaction time period of the target transaction scenario, so that in the subsequent steps, the transaction scenario is simulated based on the transaction distribution data of the future transaction time period corresponding to the target transaction scenario, and the obtained transaction test data is more accurate, and then the distributed system microservice association relationship obtained by analysis is also more accurate.
[0091] In the embodiment of the present invention, by analyzing the association relationship between the microservices required for the target transaction scenario, the analysis results can also be used for the design and drill of emergency response plans, or the optimization of distributed architecture, so as to reduce the transaction risks in the actual transaction process.
[0092] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented 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.
[0093] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0094] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0095] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0096] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for analyzing the relationship between microservices in a distributed system, characterized in that: include: Obtain historical transaction data for the historical transaction time period corresponding to the target transaction scenario; Inputting historical transaction data of a historical transaction time period corresponding to a target transaction scenario into a transaction prediction model to predict transaction distribution data of a future transaction time period corresponding to the target transaction scenario, wherein the transaction prediction model is trained based on the historical transaction data of each transaction scenario in its corresponding historical transaction time period; Utilizing transaction distribution data for a future transaction time period corresponding to a target transaction scenario, a transaction is simulated and initiated. Failures are assumed in any one or more transaction systems in the distributed system corresponding to the microservices required by the target transaction scenario to obtain transaction test data. The transaction test data includes transaction risk data for each transaction system in the distributed system corresponding to the microservices required by the target transaction scenario. Analyze the relationships between microservices required for the target transaction scenario based on the transaction test data; The transaction distribution data includes transaction time and transaction data corresponding to the transaction time; Use the transaction distribution data of the future transaction time period corresponding to the target transaction scenario to simulate the initiation of transactions. Set any one or more transaction systems in the distributed system corresponding to the microservices required by the target transaction scenario to fail, and obtain transaction test data, including: In the order of transaction times, the transaction data corresponding to the transaction times are used to simulate the initiation of transactions, and any one or more transaction systems in the distributed system corresponding to the microservices required by the target transaction scenario are set to fail, so as to obtain transaction test data when any one or more transaction systems in the distributed system corresponding to the microservices required by the target transaction scenario fail.
2. The method according to claim 1, wherein After obtaining the transaction test data for the case where any one or more transaction systems in the distributed system corresponding to the microservices required for the target transaction scenario fail, it also includes: The transaction test data in the case of failure of any one or more transaction systems in the distributed system corresponding to the microservices required by the target transaction scenario is stored in the data pool.
3. The method according to claim 1, wherein Utilize the transaction distribution data of the future transaction time period corresponding to the target transaction scenario to simulate the initiation of transactions. Set any one or more transaction systems in the distributed system corresponding to the microservices required by the target transaction scenario to fail. Before obtaining the transaction test data, the following steps are also included: A baffle program is configured for any one or more transaction systems in the distributed system corresponding to the microservices required by the target transaction scenario, and the baffle program is used to simulate a transaction system failure.
4. The method according to claim 1, wherein Inputting historical transaction data of the historical transaction time period corresponding to the target transaction scenario into the transaction prediction model and predicting transaction distribution data of the future transaction time period corresponding to the target transaction scenario also includes: Obtain historical transaction data and corresponding transaction distribution data for each transaction scenario in its corresponding historical transaction time period, and construct training and test sets; Use the training set to train the neural network model to obtain a transaction prediction model; Use the test set to test the transaction prediction model.
5. A device for analyzing the relationship between microservices in a distributed system, characterized in that: include: A data acquisition module is used to obtain historical transaction data of the historical transaction time period corresponding to the target transaction scenario; A data prediction module, configured to input historical transaction data of a historical transaction time period corresponding to a target transaction scenario into a transaction prediction model, and predict transaction distribution data for a future transaction time period corresponding to the target transaction scenario. The transaction prediction model is trained based on the historical transaction data of each transaction scenario in its corresponding historical transaction time period; A simulated transaction module is used to simulate initiating transactions using transaction distribution data for a future transaction time period corresponding to a target transaction scenario, and to assume that any one or more transaction systems in the distributed system corresponding to the microservices required by the target transaction scenario have failed, thereby obtaining transaction test data. The transaction test data includes transaction risk data for each transaction system in the distributed system corresponding to the microservices required by the target transaction scenario; An analysis module, configured to analyze the association relationships between microservices required for a target transaction scenario based on the transaction test data; The transaction distribution data includes transaction time and transaction data corresponding to the transaction time; Simulated trading module, specifically used for: In the order of transaction times, the transaction data corresponding to the transaction times are used to simulate the initiation of transactions, and any one or more transaction systems in the distributed system corresponding to the microservices required by the target transaction scenario are set to fail, so as to obtain transaction test data when any one or more transaction systems in the distributed system corresponding to the microservices required by the target transaction scenario fail.
6. The device according to claim 5, characterized in that Also included is a data storage module for: The transaction test data in the case of failure of any one or more transaction systems in the distributed system corresponding to the microservices required by the target transaction scenario is stored in the data pool.
7. The device according to claim 5, characterized in that Also included is a fault configuration module for: A baffle program is configured for any one or more transaction systems in the distributed system corresponding to the microservices required by the target transaction scenario, and the baffle program is used to simulate a transaction system failure.
8. The device according to claim 5, wherein Also includes model training and testing modules for: Obtain historical transaction data and corresponding transaction distribution data for each transaction scenario in its corresponding historical transaction time period, and construct training and test sets; Use the training set to train the neural network model to obtain a transaction prediction model; Use the test set to test the transaction prediction model.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 4 is implemented.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
11. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
