Fault information injection method and device applied to SQL (Structured Query Language) statement and medium
By intercepting and matching the request processing parameters of SQL statements in a virtual machine, and injecting fault information to update the SQL statements, the problem of network latency affecting network communication was solved, achieving non-intrusive fault injection verification and verifying the stability of the application system.
Patent Information
- Application Number
- CN202511101473.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-07
- Publication Date
- 2025-11-21
AI Technical Summary
Existing technologies that process SQL statements via network latency can affect network communication between the application's system server and the big data computing engine server.
When a processing process is detected, request processing parameters are obtained, fault injection information is determined based on preset processing parameters, and a fault injection experimental process is created in a virtual machine. A chaos plugin is used to intercept and match SQL statements in the target agent and inject corresponding fault information to update the SQL statements.
It enables the injection of corresponding fault information into SQL statements without affecting network communication, effectively verifying the stability of the application system, and without requiring code modification or restarting of the target application.
Smart Images

Figure CN120994441A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of data processing, and particularly relate to a fault information injection method applied to SQL statements, a device and a medium. BACKGROUND
[0002] In the current data-driven era, the SQL statement of the big data computing engine has become the main tool for data processing and query, especially in the production environment, as the big data component provides powerful data warehouse functions, it is usually widely used for storing and managing data. The big data computing engine reads data from the big data storage component and uses the SQL statement of the big data computing engine to perform complex data processing and query operations.
[0003] With more and more financial innovations and higher product delivery rates, the requirements for SQL statements are becoming higher, and the delayed feedback of SQL statements has a certain impact on the stable operation of the system. Based on this, generating delayed injection information corresponding to the SQL statement has become a problem to be solved.
[0004] To solve the above problems, network delay fault injection can be used, but the above method will affect the network communication between the application system server and the big data computing engine server. Therefore, how to perform fault injection for SQL statements has become a problem to be solved. SUMMARY
[0005] Embodiments of the present application provide a fault information injection method applied to SQL statements, a device and a medium, to inject corresponding fault injection information for different SQL statements, and achieve the effect of adjusting the efficiency and convenience of the SQL statement.
[0006] In a first aspect, embodiments of the present application provide a fault information injection method applied to SQL statements, the method comprising:
[0007] When it is detected that there is a processing process, obtaining a request processing parameter corresponding to the processing process, wherein the request processing parameter includes information related to the SQL statement executed by the processing process;
[0008] According to the fault injection information corresponding to the preset processing parameter satisfied by the request processing parameter, performing fault marking and injecting the fault injection information for the processing process;
[0009] Updating the related information of the SQL statement based on the fault injection information, so as to execute a target event in a target application program based on the updated SQL statement.
[0010] Further, the method further comprises:
[0011] The chaos plug-in creates a fault injection experiment process in a virtual machine, and injects fault injection information into a SQL statement of the processing process based on a target agent corresponding to the fault injection experiment process.
[0012] Further, the chaos plug-in creates a fault injection experiment process in a virtual machine, and injects fault injection information into a SQL statement of the processing process based on a target agent corresponding to the fault injection experiment process.
[0013] Based on the experiment creation command information edited in the chaos plug-in, a target agent is mounted in the virtual machine.
[0014] Based on the target agent, a plug-in point is created, an interception method corresponding to the SQL statement is set in the plug-in point, and SQL statement related information executed by the processing process is obtained based on the interception method.
[0015] Based on the target agent, a matching model is created, and a verification method for verifying the SQL statement and a delayed intrusion configuration method are integrated in the matching model.
[0016] Based on the target agent, a big data engine plug-in is created, and the big data engine plug-in is associated with the plug-in point and the matching model respectively.
[0017] The plug-in management module in the target agent is compiled and processed to complete the step of creating an injection fault experiment process in the virtual machine.
[0018] The plug-in management module is a module for managing the big data engine plug-in.
[0019] Further, the request processing parameter corresponding to the processing process is obtained, including:
[0020] The processing process is intercepted based on the plug-in point in the target agent.
[0021] The request processing parameter corresponding to the processing process is obtained based on the enhancer in the target agent.
[0022] Correspondingly, the fault injection information corresponding to the request processing parameter satisfying the preset processing parameter is injected into the processing process, including:
[0023] Based on the method integrated in the big data engine plug-in in the target agent, the target preset processing parameter corresponding to the request processing parameter is determined, and the fault injection information corresponding to the target preset processing parameter is called.
[0024] Further, the method integrated in the big data engine plug-in in the target agent is used to determine the target preset processing parameter corresponding to the request processing parameter, and the fault injection information corresponding to the target preset processing parameter is called.
[0025] The request processing parameter and at least one group of pre-processing parameters created in advance are compared based on the matching model in the big data engine plug-in.
[0026] According to the comparison result, the target preset processing parameter adapted to the request processing parameter is determined, and the fault injection information corresponding to the target preset processing parameter is obtained.
[0027] The processing process is marked with fault information, and the fault injection information is configured for the SQL statement corresponding to the processing process.
[0028] Further, the fault injection information at least includes a response data delay feedback time length fed back by the target application program corresponding to the processing process.
[0029] Further, the method further comprises:
[0030] In response to receiving an event of exiting the execution of the fault injection information, the target agent executing the request processing parameter verification and the fault injection information is unloaded based on the chaos plug-in.
[0031] In a second aspect, the embodiments of the present application further provide a fault information injection device applied to a SQL statement, and the device comprises:
[0032] A processing parameter acquisition module is configured to acquire a request processing parameter corresponding to a processing process when it is detected that the processing process exists, wherein the request processing parameter comprises information related to a SQL statement executed by the processing process.
[0033] A fault information injection module is configured to mark the processing process with a fault and inject the fault injection information according to the fault injection information corresponding to a preset processing parameter satisfied by the request processing parameter.
[0034] A target event execution module is configured to update information related to the SQL statement based on the fault injection information, so as to execute a target event in a target application based on the updated SQL statement.
[0035] In a third aspect, the embodiments of the present application provide an electronic device, which comprises:
[0036] One or more processors;
[0037] A memory configured to store one or more programs;
[0038] When the one or more programs are executed by the one or more processors, the one or more processors implement the fault information injection method applied to the SQL statement as provided by any of the embodiments of the present application.
[0039] In a fourth aspect, the embodiments of the present application further provide a computer readable storage medium, having stored thereon a computer program, which, when executed by a processor, implements the fault information injection method applied to the SQL statement as provided by any of the embodiments of the present application.
[0040] In a fifth aspect, the embodiments of the present application further provide a computer program product, comprising a computer program, wherein the computer program, when executed by a processor, implements the fault information injection method applied to the SQL statement as provided by any of the embodiments of the present application.
[0041] The scheme provided by the embodiments of the present application, when detecting that there is a processing process, acquires the request processing parameter corresponding to the processing process, wherein the request processing parameter comprises the related information of the SQL statement executed by the processing process. Further, the request processing parameter is further verified to determine whether the fault information needs to be injected for the SQL statement, and when the fault injection condition is met, the fault injection information adapted to the SQL statement can be injected. Finally, the SQL statement with the added fault injection information is obtained, and then the performance of the application program can be verified based on the SQL statement with the injected fault information, solving the problem that the network communication between the system server and the big data computing engine server of the application program is affected when the SQL statement is processed by the network delay in the prior art, and achieving the technical effect that the network communication is not affected after the corresponding fault information is injected into the SQL statement based on the above. BRIEF DESCRIPTION OF DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the example embodiments of the present application, the drawings needed in the description of the embodiments are briefly introduced as follows. Obviously, the drawings introduced are only a part of the drawings of the embodiments to be described by the present application, and not all the drawings. Those skilled in the art can also obtain other drawings from these drawings without creating labor.
[0043] Figure 1 A flowchart of the fault information injection method applied to the SQL statement provided by the embodiments of the present application is shown in FIG. 1.
[0044] Figure 2 A flowchart of the fault information injection method applied to the SQL statement provided by the embodiments of the present application is shown in FIG. 1.
[0045] Figure 3A flowchart of a fault information injection method applied to an SQL statement is provided for an embodiment of the present application.
[0046] Figure 4 An architecture diagram of the fault information injection method applied to the SQL statement is executed for an embodiment of the present application.
[0047] Figure 5 A structural schematic diagram of a fault information injection device applied to an SQL statement is provided for an embodiment of the present application.
[0048] Figure 6 A structural schematic diagram of an electronic device is provided for an embodiment of the present application. DETAILED DESCRIPTION
[0049] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. In addition, it should be noted that, for the convenience of description, only the parts related to the present application are shown in the drawings, not all the structures.
[0050] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. In addition, it should be noted that, for the convenience of description, only the parts related to the present application are shown in the drawings, not all the structures.
[0051] Before introducing the technical solutions provided by the embodiments of the present application, the application scenarios and some related terms can be exemplarily described.
[0052] In this embodiment, the SQL statement obtained is mainly based on the SQL statement corresponding to the big data computing engine. The SQL statement mentioned below is also for the statement corresponding to the big data computing engine.
[0053] The big data computing engine has the characteristics of high speed, universality, fault tolerance and strong performance, and is applied to big data processing and analysis in various industries. The big data computing engine SQL statement is a component for processing structured data in the big data computing engine, which can simplify development and improve development efficiency, and is widely used.
[0054] Chaos engineering, as a means of identifying and repairing unknown hidden dangers by actively injecting faults, has become a powerful tool for stable improvement in the field of big data. Therefore, chaos engineering is applied to the test work of big data computing engine application, and chaos testing is used to inject faults into the SQL statement of the big data computing engine, which can effectively verify whether the application system is stable when the SQL statement of the big data computing engine executes abnormally.
[0055] The technical solution provided by the embodiment of the application can be applied to a scenario of configuring fault injection information for a SQL statement, and can achieve the technical effect of injecting appropriate fault injection information into the SQL statement according to specific information content of the SQL statement.
[0056] Figure 1 The flowchart of the fault information injection method for a SQL statement provided by the embodiment of the application can be applied to a scenario of injecting appropriate fault injection information into a SQL statement according to specific content of the SQL statement. The fault information injection method for a SQL statement provided by the embodiment of the application can be implemented by a fault information injection device for a SQL statement integrated in a client and / or a server in a software and / or hardware manner, and integrated in an electronic device, which can be a mobile terminal or a PC terminal.
[0057] As shown in the method, the method specifically includes the following steps: Figure 1
[0058] S110, when it is detected that a processing process exists, acquiring a request processing parameter corresponding to the processing process, wherein the request processing parameter includes information related to a SQL statement executed by the processing process.
[0059] The method provided by the embodiment can be integrated in an existing scenario of testing an application program. When it is detected that a function module or a function control of a triggered application program exists, a corresponding SQL statement can be initiated. When the SQL statement is processed, a corresponding processing process can be created to execute a target event corresponding to the SQL statement based on the processing process. The request processing parameter corresponding to the processing process is acquired. That is, the processing request parameter includes an associated parameter associated with the SQL statement. Optionally, the associated parameter includes a processing type of the SQL statement.
[0060] Specifically, when it is detected that a triggering operation exists in a client, a corresponding SQL statement can be generated based on the triggering operation. A processing process can be created to execute a target event associated with the SQL statement based on the processing process. The target event can be an information query event or the like. At this time, information of the SQL statement associated with the processing process can be acquired.
[0061] In the embodiment, the acquiring of the request processing parameter corresponding to the processing process includes: intercepting the processing process based on a plug-in point in the target agent; and acquiring the request processing parameter corresponding to the processing process based on an enhancer in the target agent.
[0062] The target agent is configured to acquire information of the processing process, analyze and process the information, and determine a fault injection information corresponding to the processing process.
[0063] In the embodiment, the plug-in point in the target agent can intercept the processing process. After intercepting the processing process, the request processing parameter corresponding to the processing process can be obtained based on the enhancer in the target agent. The enhancer can be understood as an associated information obtaining unit for obtaining the SQL statement associated with the processing request intercepted by the enhancer.
[0064] The target function for obtaining the associated information of the SQL statement is included in the enhancer, so as to obtain the associated information corresponding to the SQL statement based on the target function.
[0065] Specifically, when the SQL statement is executed based on the processing process, the processing process can be intercepted based on the plug-in point of the target agent. That is, all processing processes can be intercepted, and the request processing parameter of the SQL statement corresponding to the processing process can be obtained based on the enhancer in the target agent.
[0066] S120, according to the fault injection information corresponding to the preset processing parameter satisfied by the request processing parameter, marking the processing process with a fault and injecting the fault injection information.
[0067] Among them, a plurality of preset processing parameters can be set in advance, and different preset processing parameters are used to represent parameters for proofreading different types of SQL statements. For different preset processing parameters, the fault injection information corresponding to the preset processing parameters is different. Based on this, after obtaining the request associated information corresponding to the processing request, the preset processing parameter corresponding to the request processing parameter can be determined, and the fault injection information matched with the preset processing parameter can be called. The fault injection information is the response data delay feedback time length corresponding to the SQL statement.
[0068] Specifically, after obtaining the request processing parameter, the preset processing parameter, i.e., a plurality of preset processing parameters, can be called. By verifying the request processing parameter and the preset processing parameter, the preset processing parameter satisfied by the request processing parameter can be determined, and the fault injection information corresponding to the satisfied preset processing parameter can be called. At this time, the fault injection information can be configured for the processing process, that is, the fault injection information is added to the request processing parameter.
[0069] In the embodiment, according to the fault injection information corresponding to the preset processing parameter satisfied by the request processing parameter, marking the processing process with a fault and injecting the fault injection information, including: based on the method integrated in the big data engine plug-in in the target agent, determining the target preset processing parameter corresponding to the request processing parameter, and calling the fault injection information corresponding to the target preset processing parameter.
[0070] The method integrated in the big data engine plug-in in the target agent can be used to correct the request processing parameter and the preset processing parameter to determine the target preset processing parameter corresponding to the request processing parameter. That is, the preset processing parameter matching the request processing parameter is taken as the target preset processing parameter.
[0071] Specifically, the method integrated in the big data engine plug-in in the target agent is continuously acquired to perform matching processing on the preset processing parameter and the request processing parameter, and the preset processing parameter whose matching result meets the preset condition is taken as the target preset processing parameter. Further, according to the mapping relationship between the preset processing parameter and the fault injection information preset in advance, the fault injection information corresponding to the target preset processing parameter is called, and the fault injection information is associated with the SQL statement corresponding to the processing process, so as to determine the delay response time length based on the fault injection information when the SQL statement is executed based on the processing process.
[0072] In this embodiment, it can be known that the method integrated in the big data computing engine can be used to process the preset processing parameter and the request processing parameter to determine the target preset processing parameter, and then the corresponding fault injection information can be called. The specific way can be: comparing the request processing parameter and at least one group of pre-created preset processing parameters based on the matching model in the big data engine plug-in; determining the target preset processing parameter matched with the request processing parameter according to the comparison result, and acquiring the fault injection information corresponding to the target preset processing parameter; marking the fault information for the processing process, and configuring the fault injection information for the SQL statement corresponding to the processing process.
[0073] It can be understood that the matching algorithm is integrated in the matching model, which is used to compare the request processing parameter and the preset processing parameter. At least one group of preset processing parameters includes one group or multiple groups. The request processing parameter and the preset processing parameter can be compared based on the matching algorithm integrated in the matching model. The comparison result is used to represent the result of whether the request processing parameter is consistent with the preset processing parameter. If the comparison result is consistent with the preset comparison result, the fault injection information is called. The fault information can be marked for the processing process, and the fault injection information can be configured for the SQL statement corresponding to the fault information.
[0074] In this embodiment, the fault injection information at least includes the response data delay feedback time length of the target application program corresponding to the processing process.
[0075] The corresponding data delay feedback time length is used to represent the time length of delaying feedback after obtaining the feedback data corresponding to the SQL statement. Optionally, the response data delay feedback time length is 1S or 20S, etc. The specific response data delay feedback time length can be set according to actual needs.
[0076] S130, updating the related information of the SQL statement based on the fault injection information, to execute the target event in the target application based on the updated SQL statement.
[0077] In the embodiment, the related information of the SQL statement can be updated based on the fault injection information, the target event can be executed based on the updated SQL statement, and the delay feedback time length of the response data can be determined based on the delay feedback time length of the response data in the related information.
[0078] The scheme provided by the embodiment of the application can accurately inject a delay fault into a specified SQL statement of a big data computing engine in a chaos experiment, and can effectively verify the impact of an application system when a SQL statement has a delay exception.
[0079] It can be understood that the application achieves the injection of a delay fault into a specified SQL statement of a big data computing engine, and achieves non-invasive and quasi-isolated fault injection, which can be loaded or stopped at any time, and the target application does not need to modify the code and restart, and the target application class will not be disturbed.
[0080] The scheme provided by the embodiment of the application acquires the request processing parameter corresponding to the processing process when it is detected that the processing process exists, wherein the request processing parameter includes the related information of the SQL statement executed by the processing process. Further, the request processing parameter is further verified to determine whether the SQL statement needs to be injected with fault information, and when the fault injection condition is met, the SQL statement can be injected with fault injection information adapted to the SQL statement. Finally, the SQL statement with the added fault injection information is obtained, and the performance of the application program can be verified based on the SQL statement with the injected fault information, thereby solving the problem that the network communication between the system server and the big data computing engine server of the application program is affected when the SQL statement is processed by the network delay in the prior art, and achieving the technical effect that the network communication is not affected after the corresponding fault information is injected into the SQL statement.
[0081] On the basis of the above technical solutions, the method further includes: in response to receiving an event of exiting the execution of the fault injection information, uninstalling a target agent based on the chaos plug-in; wherein the target agent is an agent for executing the request processing parameter verification and the fault injection information.
[0082] The event of exiting the execution of the fault injection information can be determined based on a command line of the user in the target plug-in. The user can write a command line for exiting the execution of the fault injection information in the chaos plug-in, and the command line can exit the fault injection information. After the target agent is uninstalled, the target agent can be uninstalled after the SQL statement is received.
[0083] Specifically, the user can click the chaos plug-in, and the user can edit command information in the chaos plug-in, and the command information can be a command that no longer injects fault information. Correspondingly, after receiving the command information, the target agent can be unloaded. That is, after the target agent is unloaded, the fault injection information is no longer configured for the SQL statement corresponding to the processing process.
[0084] For example, the method marked as "destroy" in the sandbox is triggered to stop the experiment, and the mounted agent is unloaded.
[0085] Figure 2 The flowchart of the fault information injection method for SQL statements provided by the embodiment of the application is based on the foregoing embodiment, and can first describe how to generate a chaos experiment, and then further describe the fault injection information based on the chaos experiment for SQL statements. The specific implementation can be referred to the detailed description of the embodiment. The same or corresponding technical terms as the above embodiment are not described herein.
[0086] As shown in Figure 2 The method comprises:
[0087] S210, based on the experiment creation command information edited in the chaos plug-in, mount the target agent in the virtual machine.
[0088] The virtual machine can be a virtual space running a target application. The chaos plug-in can be understood as a tool for implementing chaos experiments and executing fault injection information configuration for SQL statements based on chaos experiments.
[0089] The user can edit experiment creation command information in the chaos plug-in. The experiment creation command information can be input in the command line. The command information is used to create a chaos experiment, and the chaos experiment is mainly used to obtain request processing parameters of a processing process, match the request processing parameters, and the like.
[0090] Specifically, based on the chaos tool, the mounting command is executed. The target agent is mounted in the target virtual machine to trigger the preloading event of the sandbox module. At the same time, the plug-in initializes the listener in the life cycle management. The "creat" information can be edited in the sandbox to create an experiment, and the context information of the experiment is obtained, that is, the constraint information of the SQL statement processed by the processing process. For example, the target, action, and fault state (response data delay feedback duration).
[0091] S220, create a plug-in point based on the target agent, set an intercept method corresponding to the SQL statement in the plug-in point, and obtain the SQL statement related information executed by the processing process based on the intercept method.
[0092] The plug-in point is created to set the intercept method in the plug-in point, and the SQL statement in the big data engine is intercepted based on the intercept method.
[0093] Specifically, the target agent is mounted in the virtual machine to create a plug-in point based on the target agent, and the intercept method of the processing process corresponding to the SQL statement is set based on the plug-in point. In this embodiment, the advantage of setting the intercept method is that when detecting the processing process corresponding to the SQL statement to execute the corresponding event, the big data processing process can be intercepted based on the intercept method in the plug-in point to obtain the associated information of the SQL statement corresponding to the processing process.
[0094] The scheme provided by the embodiment of the application can be understood in combination with Figure 3 The target agent is activated after the corresponding method is integrated in the plug-in based on mounting the application integration in the virtual machine (JVM) by executing the mounting command.
[0095] For example, refer to Figure 4 The target agent is integrated in the virtual machine (JVM sandbox) based on the chaos plug-in. The target agent includes a launcher, a server, a plug-in, and general information. The big data computing engine plug-in can be created based on the plug-in. The plug-in point is created based on the plug-in to set the intercept method in the plug-in point, and the related information of the processing process corresponding to the SQL statement in the big data computing engine is intercepted based on the intercept method.
[0096] S230, create a matching model based on the target agent, and integrate a verification method for verifying the SQL statement and a delayed intrusion configuration method in the matching model.
[0097] Further, the matching model can be created to put the obtained related parameters into the matching model, and the request processing parameters and the preset processing parameters are matched based on the matching model. That is, the matching model is a model for placing a matching method, and the matching method is used to match the request processing parameters and the preset processing parameters.
[0098] It can be understood that the matching model is created to match the request processing parameters and the preset processing parameters based on the matching model after the request processing parameters are obtained, and the comparison result is obtained.
[0099] For example, refer to Figure 4The target agent can include a plug-in point, a method enhancement, a fault rule (a fault injection rule), a class matcher (a matching model), a method matcher (an injection module), a method entry (creating a chaos experiment), and a method exit (uninstalling a method of the target agent / exitting a method of the chaos experiment).
[0100] S240, creating a big data engine plug-in based on the target agent, and associating the big data engine plug-in with the plug-in point and the matching model respectively.
[0101] The big data engine plug-in can be associated with the plug-in point and the matching model.
[0102] The scheme provided by the embodiment of the present application will be further understood in combination with Figure 3 and Figure 4 The plug-in point is created, and an intercepted method is set as an SQL statement intercepted by the big data computing engine. The model definition is created, which is used to implement the verification on the created input parameter and the preset processing parameter, to determine whether the delay intrusion needs to be configured for the SQL statement of the big data computing engine. The big data engine plug-in is created, the plug-in target name is set as the big data computing engine, and the activator is activated after the enhancer, the plug-in point, and the model definition are added.
[0103] S240, compiling the plug-in management module in the target agent to complete the step of creating an injection fault experiment flow in the virtual machine.
[0104] After the plug-in extension is completed, the plug-in is compiled and packaged, and then the command is used to mount and execute the big data computing engine SQL statement delay experiment on the target application, and the related parameters such as the SQL statement and the delay time are specified, so that the big data computing engine SQL statement delay can be realized.
[0105] The scheme provided by the embodiment of the present application will be further understood in combination with Figure 3 When the request is initiated based on the terminal device, the request can be sent to the target service. At the same time, the corresponding processing process is created to process the request. The processing process is intercepted based on the listening method (the SQL statement interception method) registered in the plug-in point (the plug-in point, the big data computing engine SQL method). After the processing process is intercepted, the associated information corresponding to the processing process is obtained. The related information is obtained based on the enhancer. The integrated injection rule (the matching method) is matched with the request processing parameter and the preset processing parameter based on the matching module, to determine whether the fault injection information is matched. If yes, the fault injection information is configured to trigger the delay fault, otherwise, the target event corresponding to the SQL statement is executed to feed back the target response data. In this embodiment, when the delay fault is triggered, the delay feedback duration of the response data corresponding to the request processing parameter can be determined according to the fault injection information.
[0106] The fault injection process is as follows:
[0107] The chaos tool issues a mounting command to mount the JVM sandbox to the application process and activate the Java agent;
[0108] After mounting the JVM sandbox, the big data computing engine plug-in is loaded;
[0109] The plug-in point is matched, and the sql method of the big data computing engine is registered to listen to the event;
[0110] The chaos tool issues a fault rule command create delay--sql=”*****”--time=**;
[0111] The fault rule is matched, and the delay fault is triggered after the matching rule is successful;
[0112] After the fault injection is completed, the chaos tool issues a command to uninstall the Java agent.
[0113] The scheme provided by the embodiment of the application, when it is detected that there is a processing process, the request processing parameter corresponding to the processing process is acquired, wherein the request processing parameter includes the related information of the SQL statement executed by the processing process. Further, the request processing parameter is further verified to determine whether the SQL statement needs to be injected with fault information, and when the fault injection condition is met, the SQL statement can be injected with the fault injection information matched with the SQL statement. Finally, the SQL statement with the added fault injection information is obtained, and then the performance of the application program can be verified based on the SQL statement with the injected fault information, solving the problem that the network communication between the system server and the big data computing engine server of the application program is affected when the SQL statement is processed by the network delay in the prior art. The technical effect of not affecting the network communication after the corresponding fault information is injected into the SQL statement based on the above is achieved.
[0114] The following is an embodiment of a fault information injection device for SQL statements provided by the embodiment of the application. The device and the above-mentioned fault information injection method for SQL statements belong to the same inventive concept. Details not described in the embodiment of the fault information injection device for SQL statements can be referred to the above-mentioned embodiment of the fault information injection method for SQL statements
[0115] Figure 5 The structure diagram of a fault information injection device for SQL statements provided by the embodiment of the application is shown in the figure. The device specifically includes a processing parameter acquisition module 310, a fault information injection module 320, and a target event execution module 330.
[0116] The processing parameter acquisition module 310 is configured to acquire request processing parameters corresponding to the processing process when it is detected that the processing process exists, wherein the request processing parameters include information related to an SQL statement executed by the processing process.
[0117] On the basis of the above technical solutions, the device further includes a chaos experiment creation module configured to create a fault injection experiment process in a virtual machine based on a chaos plug-in, so as to inject fault injection information into an SQL statement of the processing process based on a target agent corresponding to the fault injection experiment process.
[0118] On the basis of each of the above technical solutions, the chaos experiment creation module includes:
[0119] The target agent mounting unit is configured to mount a target agent in the virtual machine based on experiment creation command information edited in the chaos plug-in.
[0120] The plug-in point creation unit is configured to create a plug-in point based on the target agent, to set an interception method for intercepting the SQL statement in the plug-in point, and to acquire information related to the SQL statement executed by the processing process based on the interception method.
[0121] The matching model creation unit is configured to create a matching model based on the target agent, to integrate a verification method for verifying the SQL statement and a delayed intrusion configuration method in the matching model.
[0122] The engine plug-in creation unit is configured to create a big data engine plug-in based on the target agent, and to associate the big data engine plug-in with the plug-in point and the matching model respectively.
[0123] The information compiling unit is configured to compile a plug-in management module in the target agent, to complete the step of creating an injection fault experiment process in the virtual machine.
[0124] The plug-in management module is a module for managing the big data engine plug-in.
[0125] On the basis of each of the above technical solutions, the processing parameter acquisition module includes:
[0126] The process interception unit is configured to intercept the processing process based on a plug-in point in the target agent.
[0127] a parameter acquisition unit, configured to acquire the request processing parameter corresponding to the processing process based on an enhancer in the target agent;
[0128] Correspondingly, the fault information injection module is further configured to:
[0129] determine the target preset processing parameter corresponding to the request processing parameter based on a method integrated in a big data engine plug-in in the target agent, and call fault injection information corresponding to the target preset processing parameter.
[0130] On the basis of the above technical solutions, the fault information injection module is further configured to:
[0131] compare the request processing parameter with at least one group of pre-processing parameters created in advance based on a matching model in the big data engine plug-in;
[0132] determine the target preset processing parameter adapted to the request processing parameter according to a comparison result, and acquire fault injection information corresponding to the target preset processing parameter;
[0133] label the processing process with fault information, and configure the fault injection information for the SQL statement corresponding to the processing process.
[0134] On the basis of the above technical solutions, the fault injection information at least includes a response data delay feedback duration when the target application program feeds back the response data corresponding to the processing process.
[0135] On the basis of the above technical solutions, the device further includes a target agent uninstalling module configured to, in response to receiving an event of exiting the execution of the fault injection information, uninstall the target agent based on a chaos plug-in.
[0136] The target agent is an agent for executing the request processing parameter verification and the fault injection information.
[0137] The scheme provided by the embodiment of the present application, when detecting that the processing process exists, acquires the request processing parameter corresponding to the processing process, wherein the request processing parameter includes the related information of the SQL statement executed by the processing process. Further, the request processing parameter is further verified to determine whether the SQL statement needs to be injected with fault information, and when the fault injection condition is met, the SQL statement can be injected with the fault injection information matched with the SQL statement. Finally, the SQL statement with the added fault injection information is obtained, and then the performance of the application program can be verified based on the SQL statement with the injected fault information, solving the problem that the network communication between the system server and the big data computing engine server of the application program is affected when the SQL statement is processed by the network delay in the prior art, and realizing the technical effect that the network communication is not affected after the SQL statement is injected with the corresponding fault information based on the above. The fault information injection device for the SQL statement provided by the embodiment of the present application can execute the fault information injection method for the SQL statement provided by any embodiment of the present application, and has the corresponding function modules and beneficial effects of executing the fault information injection method for the SQL statement.
[0138] It is worth noting that in the above embodiment of the fault information injection device for the SQL statement, each unit and module included is only divided according to the function logic, but is not limited to the above division, as long as the corresponding function can be realized; in addition, the specific name of each functional unit is only for the convenience of mutual differentiation, and does not limit the protection scope of the present application.
[0139] Figure 6 A structural schematic diagram of a server provided by the embodiment of the present application is provided. Figure 6 A block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present application is shown. Figure 6 The electronic device 12 shown is merely one example and should not be construed as limiting the scope of the embodiments of the present application.
[0140] As shown in Figure 6 The electronic device 12 is in the form of a general computing device. The components of the electronic device 12 can include, but are not limited to, one or more processors or processing units 16, system memory 28, and a bus 18 that connects the various system components, including the system memory 28 and the processing unit 16.
[0141] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration bus, a processor or local bus using any of a variety of bus architectures. By way of example, these architectures include Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
[0142] Electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that is accessible by electronic device 12 and includes both volatile and non-volatile media, removable and non-removable media.
[0143] System memory 28 can include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Electronic device 12 can further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 can be provided for reading from and writing to a non-removable, non-volatile magnetic media (not shown and typically called a "hard drive"). Figure 6 Although not shown, a magnetic disk drive can also be utilized in some embodiments to read from and write to a removable, non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive can be utilized in some embodiments to read from and write to a removable, non-volatile optical disk (e.g., a CD-ROM, DVD-ROM or other optical media). In these instances, each can be connected to bus 18 by one or more data media interfaces. As will be further depicted and described below, memory 28 can include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the application. Figure 6 Program / utility 40 having a set (at least one) of program modules 42 can be stored in system memory 28 by way of example, such programs include an operating system, one or more application programs, other program modules, and program data, each of which or a combination can include implementation of a networking environment. Program modules 42 generally carry out the functions and / or methodologies of embodiments of the application as described herein.
[0144]
[0145] The electronic device 12 can also communicate with one or more external devices 14 such as a keyboard, a pointing device, a display 24, etc.; other devices that enable a user to interact with the electronic device 12; and / or any devices (e.g., a networking module, a modem, etc.) that enable the electronic device 12 to communicate with one or more other computing devices. Such communication can occur via the input / output (I / O) interface 22. Still yet, the electronic device 12 can communicate with one or more networks, such as a local area network (LAN), a wide area network (WAN), and / or the Internet, through a network adapter 20. As depicted, the network adapter 20 communicates with the other components of the electronic device 12 via the bus 18. It should be appreciated that the network adapter 20 and / or the other hardware and / or software components depicted in FIG. 1 can be utilized in combination with the electronic device 12, but need not be included as part of the electronic device 12. For example, the electronic device 12 could be a mobile telephone that does not include the network adapter 20.
[0146] The processing unit 16 performs various function applications and data processing by running programs stored in the system memory 28, such as implementing the method for injecting fault information applied to SQL statements provided in the first embodiment of the present application, which includes the following steps:
[0147] Upon detecting the existence of the processing process, obtaining request processing parameters corresponding to the processing process, wherein the request processing parameters include information related to the SQL statements executed by the processing process;
[0148] According to the fault injection information corresponding to the preset processing parameters satisfied by the request processing parameters, performing fault marking and injecting the fault injection information for the processing process;
[0149] Updating the information related to the SQL statements based on the fault injection information, so as to execute target events in a target application based on the updated SQL statements.
[0150] Of course, those skilled in the art can understand that the processor can also implement the technical solutions of the method for injecting fault information applied to SQL statements provided in any embodiment of the present application.
[0151] The embodiment provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to implement the steps of the method for injecting fault information applied to SQL statements provided in the foregoing embodiments of the present application, which includes the following steps:
[0152] Upon detecting the existence of the processing process, obtaining request processing parameters corresponding to the processing process, wherein the request processing parameters include information related to the SQL statements executed by the processing process;
[0153] According to the fault injection information corresponding to the preset processing parameter satisfied by the request processing parameter, a fault mark is performed on the processing process and the fault injection information is injected into the processing process;
[0154] Based on the fault injection information, the related information of the SQL statement is updated, and a target event is executed in a target application based on the updated SQL statement.
[0155] The computer storage medium of the embodiment of the application can adopt any combination of one or more computer readable media. The computer readable medium can be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium may, for example, be but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples (non-exhaustive list) of the computer readable storage medium include an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or component.
[0156] The computer readable signal medium can include a data signal propagating in a baseband or as part of a carrier wave propagating through a transmission medium, in which the computer readable program code is embodied. Such a propagating data signal can take many forms, including but not limited to electro-magnetic, optical, or any suitable combination thereof. The computer readable signal medium can also be any computer readable medium that is not a computer readable storage medium and that can transmit, propagate or transport program for use by or in connection with an instruction execution system, apparatus or device.
[0157] The program code contained on the computer readable medium can be transmitted by any suitable medium, including but not limited to wireless, wire, cable, RF, etc., or any suitable combination thereof.
[0158] Computer program code for carrying out operations of embodiments of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0159] It is to be understood that the above description is merely a preferred embodiment of the application and the applied technical principles. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, modifications and substitutions can be made without departing from the scope of the present application. Therefore, although the present application has been described in detail through the above embodiments, the present application is not limited to the above embodiments, and can include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.
Claims
1. A method for injecting fault information into SQL statements, characterized in that, include: When a processing process is detected, the request processing parameters corresponding to the processing process are obtained, wherein the request processing parameters include information related to the SQL statement executed by the processing process; Based on the fault injection information corresponding to the preset processing parameters satisfied by the request processing parameters, the processing process is marked with faults and the fault injection information is injected. The relevant information of the SQL statement is updated based on the fault injection information, so that the target event is executed in the target application based on the updated SQL statement.
2. The method according to claim 1, characterized in that, The method further includes: A fault injection experiment process is created in a virtual machine based on a chaos plugin, and fault injection information is injected into the SQL statements of the processing process based on the target agent corresponding to the fault injection experiment process.
3. The method according to claim 2, characterized in that, The experimental process for creating fault injection in a virtual machine based on a chaos plugin includes: Based on the experiment creation command information edited in the chaos plugin, the target agent is mounted in the virtual machine; A plugin pointcut is created based on the target proxy, and an interception method corresponding to the SQL statement is set in the plugin pointcut to obtain information related to the SQL statement executed by the processing process based on the interception method. A matching model is created based on the target agent to integrate a verification method for validating the SQL statement and a delayed intrusion configuration method in the matching model; A big data engine plugin is created based on the target agent, and the big data engine plugin is associated with the plugin cutoff point and the matching model respectively. The plugin management module in the target agent is compiled and processed to complete the step of creating an injection fault experiment process in the virtual machine; The plugin management module is a module that manages the big data engine plugins.
4. The method according to claim 1, characterized in that, The step of obtaining the request processing parameters corresponding to the processing process includes: The processing process is intercepted based on the plugin cutoff point in the target proxy; The request processing parameters corresponding to the processing process are obtained based on the enhancer in the target proxy. Accordingly, the step of marking the processing process for faults and injecting the fault injection information based on the fault injection information corresponding to the preset processing parameters satisfied by the request processing parameters includes: Based on the method integrated in the big data engine plugin of the target agent, the target preset processing parameters corresponding to the request processing parameters are determined, and the fault injection information corresponding to the target preset processing parameters is retrieved.
5. The method according to claim 4, characterized in that, The method integrated into the big data engine plugin of the target proxy determines the target preset processing parameters corresponding to the request processing parameters and retrieves the fault injection information corresponding to the target preset processing parameters, including: The request processing parameters are compared with at least one set of pre-created preprocessing parameters based on the matching model in the big data engine plugin. Based on the comparison results, a target preset processing parameter that matches the request processing parameter is determined, and fault injection information corresponding to the target preset processing parameter is obtained. The processing process is marked with fault information, and fault injection information is configured for the SQL statement corresponding to the processing process.
6. The method according to claim 1, characterized in that, The fault injection information includes at least the response data delay feedback duration corresponding to the processing process fed back by the target application.
7. The method according to claim 1, characterized in that, The method further includes: In response to receiving an event indicating an exit from execution failure injection, the target agent is unloaded based on the chaos plugin; The target proxy is a proxy that performs request processing parameter verification and fault injection information.
8. A fault information injection device for SQL statements, characterized in that, include: The processing parameter acquisition module is used to acquire the request processing parameters corresponding to the processing process when the existence of a processing process is detected, wherein the request processing parameters include information related to the SQL statement executed by the processing process; The fault information injection module is used to mark the processing process for faults and inject the fault injection information according to the fault injection information corresponding to the preset processing parameters satisfied by the request processing parameters. The target event execution module is used to update the relevant information of the SQL statement based on the fault injection information, so as to execute the target event in the target application based on the updated SQL statement.
9. An electronic device comprising: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the fault information injection method applied to SQL statements as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the fault information injection method for SQL statements as described in any one of claims 1-7.