Data processing method and device, electronic equipment and storage medium
By intercepting database operations and processing parameters, the method and device enhance the efficiency and accuracy of abnormal analysis in database connection systems, addressing the inefficiencies of existing systems.
Patent Information
- Application Number
- CN202310706501.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-14
- Publication Date
- 2024-12-17
AI Technical Summary
Existing data processing systems face inefficiencies in abnormal analysis of database connection information due to low accuracy and simplicity of the analysis process, reducing the efficiency of exception handling.
A method and device that intercept database operations to obtain connection and operation information, generate operation identifiers, determine alarm types, and process parameters to provide comprehensive analysis results, including structure diagrams for improved understanding.
Enhances the efficiency of abnormal analysis by providing real-time, comprehensive processing of database connection information, improving the accuracy and efficiency of exception handling.
Smart Images

Figure CN119149328A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a data processing method, device, electronic equipment and storage medium. Background Art
[0002] In various data processing scenarios, data processing systems usually establish connections with databases to perform operations such as data query and storage. In order to facilitate operations on the database, a database connection pool can usually be established to establish, allocate, and release database connections for the data processing system. In order to manage database connections, the database connection pool can be monitored and an alarm can be issued when the database connection is abnormal. In related technologies, when an abnormal alarm is issued, an abnormal analysis is usually performed on the database connection information corresponding to the abnormal business operation. However, the abnormal analysis process is relatively simple, and the accuracy of the analysis results is low, which reduces the efficiency of abnormal processing. Summary of the invention
[0003] In view of this, an embodiment of the present invention provides a data processing method, device, electronic device and storage medium, which can solve the problem of performing exception analysis on database connection information corresponding to abnormal business operations during abnormal alarm, the exception analysis process is simple, the analysis result accuracy is low, and the efficiency of exception handling is reduced.
[0004] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for data processing is provided.
[0005] A data processing method according to an embodiment of the present invention includes:
[0006] In response to the monitoring instruction of the database connection pool, the preset interceptor interface is called to intercept each business operation on the database to obtain the database connection information and operation information corresponding to the business operation;
[0007] Obtaining thread information corresponding to the business operation, so as to call a preset generation model to generate an operation identifier corresponding to the business operation, so as to establish a mapping relationship between the operation identifier, the operation information and the database connection information;
[0008] Receive an abnormal alarm of the database connection pool, obtain corresponding alarm information to determine the alarm type, and query a set of parameters to be processed associated with the alarm type;
[0009] The parameter value of each parameter to be processed in the set of parameters to be processed and the operation identifier corresponding to the parameter value are obtained from the database connection information and the operation information to call the processing model corresponding to the parameter to be processed and determine the processing result corresponding to the parameter to be processed.
[0010] In one embodiment, the parameter to be processed includes a business type to which the business operation belongs, and the parameter value includes a type value of the business type to which the business operation belongs;
[0011] Calling a processing model corresponding to the parameter to be processed to determine a processing result corresponding to the parameter to be processed includes:
[0012] The total number of the business operations is counted based on the operation identifier, the number of each business type included in the parameter value is calculated, and the ratio of the number of each business type to the total number is calculated to determine the processing result corresponding to the parameter to be processed.
[0013] In yet another embodiment, the parameter to be processed includes an operation result corresponding to the business operation, and the parameter value includes an operation result value corresponding to the business operation;
[0014] Calling a processing model corresponding to the parameter to be processed to determine a processing result corresponding to the parameter to be processed includes:
[0015] The number of results in the result value of the operation result corresponding to each operation identifier is calculated, and the number of results is compared with a preset number threshold to obtain a comparison result, so as to determine the comparison result of each operation result as the processing result corresponding to the parameter to be processed.
[0016] In yet another embodiment, obtaining operation information corresponding to the business operation includes:
[0017] The business type and operation type to which the business operation belongs are obtained, and the parameter values of the operation parameters associated with the operation type are queried.
[0018] In yet another embodiment, before responding to the monitoring instruction of the database connection pool, the method further includes:
[0019] Obtaining the monitoring switch status of the database connection pool from a preset configuration management center;
[0020] In response to the monitoring switch state being turned on, a monitoring instruction of the database connection pool is triggered.
[0021] In yet another embodiment, before receiving the abnormality alarm of the database connection pool, the method further includes:
[0022] Obtaining the number of active database connections in the database connection pool, and calculating the ratio of the number of database connections to a preset maximum number of connections;
[0023] In response to the ratio satisfying a preset condition, the database connection information and the operation information are reported.
[0024] In yet another embodiment, the method further comprises:
[0025] A preset display model is called to generate a corresponding structure diagram based on the processing result, and the structure diagram is displayed.
[0026] To achieve the above objective, according to another aspect of an embodiment of the present invention, a data processing device is provided.
[0027] A data processing device according to an embodiment of the present invention includes:
[0028] An acquisition unit, configured to respond to a monitoring instruction of a database connection pool and call a preset interceptor interface to intercept each business operation on the database to obtain database connection information and operation information corresponding to the business operation;
[0029] An establishing unit, used for acquiring thread information corresponding to the business operation, so as to call a preset generation model to generate an operation identifier corresponding to the business operation, so as to establish a mapping relationship between the operation identifier, the operation information and the database connection information;
[0030] A query unit, used to receive an abnormal alarm of the database connection pool, obtain corresponding alarm information to determine the alarm type, and query a set of parameters to be processed associated with the alarm type;
[0031] A processing unit is used to obtain the parameter value of each parameter to be processed in the set of parameters to be processed and the operation identifier corresponding to the parameter value from the database connection information and the operation information, so as to call the processing model corresponding to the parameter to be processed and determine the processing result corresponding to the parameter to be processed.
[0032] In one embodiment, the parameter to be processed includes a business type to which the business operation belongs, and the parameter value includes a type value of the business type to which the business operation belongs;
[0033] The processing unit is specifically used for:
[0034] The total number of the business operations is counted based on the operation identifier, the number of each business type included in the parameter value is calculated, and the ratio of the number of each business type to the total number is calculated to determine the processing result corresponding to the parameter to be processed.
[0035] In yet another embodiment, the parameter to be processed includes an operation result corresponding to the business operation, and the parameter value includes an operation result value corresponding to the business operation;
[0036] The processing unit is specifically used for:
[0037] The number of results in the result value of the operation result corresponding to each operation identifier is calculated, and the number of results is compared with a preset number threshold to obtain a comparison result, so as to determine the comparison result of each operation result as the processing result corresponding to the parameter to be processed.
[0038] In yet another embodiment, the acquisition unit is specifically configured to:
[0039] The business type and operation type to which the business operation belongs are obtained, and the parameter values of the operation parameters associated with the operation type are queried.
[0040] In yet another embodiment, the processing unit is further used to obtain the monitoring switch status of the database connection pool from a preset configuration management center;
[0041] The device also includes:
[0042] The trigger unit is used to trigger the monitoring instruction of the database connection pool in response to the monitoring switch state being turned on.
[0043] In yet another embodiment, the apparatus further comprises:
[0044] A calculation unit, used to obtain the number of active database connections in the database connection pool, and calculate the ratio of the number of database connections to a preset maximum number of connections;
[0045] A reporting unit is used to report the database connection information and operation information in response to the ratio meeting a preset condition.
[0046] In yet another embodiment, the processing unit is further configured to:
[0047] A preset display model is called to generate a corresponding structure diagram based on the processing result, and the structure diagram is displayed.
[0048] To achieve the above objective, according to another aspect of an embodiment of the present invention, an electronic device is provided.
[0049] An electronic device according to an embodiment of the present invention includes: one or more processors; a storage device for storing 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 data processing method provided by the embodiment of the present invention.
[0050] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer readable medium is provided.
[0051] A computer-readable medium according to an embodiment of the present invention stores a computer program, and when the program is executed by a processor, the data processing method provided by the embodiment of the present invention is implemented.
[0052] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer program product is provided.
[0053] A computer program product according to an embodiment of the present invention includes a computer program, and when the program is executed by a processor, the data processing method provided by the embodiment of the present invention is implemented.
[0054] One embodiment of the above invention has the following advantages or beneficial effects: in the embodiment of the present invention, after responding to the monitoring instruction of the database connection pool, the preset interceptor interface can be called to intercept each business operation of the database to obtain the database connection information and operation information corresponding to the business operation, so that the operation of each database can be monitored, and the operation identifier corresponding to the business operation can also be generated according to the thread information of the business operation, and the mapping relationship between the operation identifier, the operation information and the database connection information can be established; after receiving the abnormal alarm of the database connection pool, the alarm type can be determined first to query the set of parameters to be processed associated with the alarm type, and then the parameter value of each parameter to be processed and the operation identifier corresponding to the parameter value can be obtained from the database connection information and the operation information to analyze and process, and obtain the processing result corresponding to the parameter to be processed. In this way, in the embodiment of the present invention, the database connection information and operation information corresponding to each business operation can be obtained in real time. When an abnormal alarm occurs, comprehensive business operation information can be obtained and corresponding processing can be performed based on the needs of alarm analysis, and then abnormal analysis can be performed based on more comprehensive processing results, thereby improving the efficiency of abnormal analysis.
[0055] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0057] Figure 1 is a schematic diagram of a system architecture of a data processing system according to an embodiment of the present invention;
[0058] Figure 2 is a schematic diagram of a main flow of a data processing method according to an embodiment of the present invention;
[0059] Figure 3 is a schematic diagram of another main flow of a data processing method according to an embodiment of the present invention;
[0060] Figure 4 is a schematic diagram of another main flow of a data processing method according to an embodiment of the present invention;
[0061] Figure 5is a schematic diagram of main units of a data processing apparatus according to an embodiment of the present invention;
[0062] Figure 6 is another exemplary system architecture diagram to which the embodiments of the present invention can be applied;
[0063] Figure 7 It is a schematic diagram of the structure of a computer system suitable for implementing the embodiment of the present invention. DETAILED DESCRIPTION
[0064] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0065] It should be noted that the embodiments and features of the embodiments of the present invention can be combined with each other without conflict. The acquisition, storage, use, and processing of data in the technical solution of this application are in compliance with the relevant provisions of national laws and regulations.
[0066] An embodiment of the present invention provides a data processing system, which can be used in a scenario where a database connection pool of a database is monitored and processed, and specifically can be used for processing abnormal alarms in the database connection pool.
[0067] Specifically, Figure 1 FIG. 2 is a schematic diagram of a system architecture of a data processing system according to an embodiment of the present invention. Figure 1 As shown, the data processing system may include a configuration management module, a data collection module, and a data analysis module. The configuration management module may configure the attribute parameters of the database connection pool, the monitoring parameters of the database connection pool, the abnormal alarm parameters, etc.; the data collection module may be used to collect the relevant information of each database business operation and report it to the data analysis module; the data analysis module may be used to analyze and process the received abnormal alarm based on the information reported by the data collection module, obtain the processing results, and distribute the processing results to the required services or systems, so that each service and system can make corresponding adjustments to avoid the problem of abnormal alarms. Specifically, the services may include alarm services, log services, report services, etc. In the embodiment of the present invention, the data processing system may be implemented based on a component approach.
[0068] Since the abnormal alarm function in the related art only records the alarm time, the corresponding business thread information, etc., it is impossible to fully analyze the information in the database connection pool during the abnormal processing, and thus it is impossible to analyze the abnormality more comprehensively, which will reduce the efficiency of the abnormal processing. In the embodiment of the present invention, the relevant information of each business operation can be fully collected. When an abnormal alarm occurs, comprehensive business operation information can be obtained based on the needs of the alarm analysis and corresponding processing can be performed, and then the abnormal analysis can be performed based on the more comprehensive processing results, and the abnormal analysis can be performed from the business level, thereby improving the efficiency of the abnormal analysis.
[0069] The embodiment of the present invention provides a method for data processing, which can be Figure 1 The data processing system of the system architecture shown executes, Figure 2 As shown, the method includes:
[0070] S201: In response to a monitoring instruction of a database connection pool, a preset interceptor interface is called to intercept various business operations on the database to obtain database connection information and operation information corresponding to the business operations.
[0071] The monitoring instructions of the database connection pool can be triggered by the system or sent by other systems. That is, when the database connection pool needs to be monitored, the monitoring instructions can be triggered or received from the external system. After receiving the monitoring instructions, each business operation of the database can be intercepted to obtain the database connection information and operation information corresponding to the business operation.
[0072] Business operations can represent operations on the database in business data processing, such as data query, data update, data reading and other operation types.
[0073] In the embodiment of the present invention, an interceptor interface, such as a mybatis Interceptor interface, may be preset, through which business operations of other services (such as underlying services) on the database may be intercepted to obtain the required information.
[0074] Specifically, the database connection information may include the information of the database connection corresponding to the business operation, and the operation information may include the operation type and the business type. The business type may indicate the type of business method executed by the thread corresponding to this business operation, or may indicate the business type to which the thread corresponding to this business operation processes data. In this step, the database connection information corresponding to the business operation may be queried based on the thread of the business operation, such as the database connection identifier used. Since different operation types correspond to different information, the associated operation parameters of each operation type may be preset in the embodiment of the present invention to facilitate the operation information required for each business operation. For example, for the operation type of data query, the associated operation parameters may be configured to include the query result, execution time, and the number of response results; for the operation type of data update, the associated operation parameters may be configured to include the execution time and the number of response results. Therefore, the acquisition of information in this step may be specifically performed as follows: querying the database connection information corresponding to the business operation; obtaining the business type and operation type to which the business operation belongs, and querying the parameter value of the operation parameter associated with the operation type.
[0075] In an embodiment of the present invention, the monitoring state of the database connection pool, that is, whether to monitor the database connection pool, can be set by turning on the control switch. Specifically, the preset configuration management center can set the monitoring switch of the database connection pool, and the state of the monitoring switch indicates whether the database connection pool is monitored. For example, if the monitoring switch state is on, it means that the database connection pool is monitored, and the monitoring instruction of the database connection pool can be triggered at this time; if the monitoring switch state is off, it means that the database connection pool is not monitored, and the monitoring instruction of the database connection pool is not triggered. Therefore, in this step, before the monitoring instruction of the database connection pool, the monitoring switch state of the database connection pool can also be obtained from the preset configuration management center; when the monitoring switch state is on, the monitoring instruction of the database connection pool is triggered.
[0076] It should be noted that in Figure 1 In the system architecture shown, the configuration management center can be the configuration management module therein.
[0077] S202: Acquire thread information corresponding to the business operation, call a preset generation model to generate an operation identifier corresponding to the business operation, and establish a mapping relationship between the operation identifier, the operation information, and the database connection information.
[0078] In the embodiment of the present invention, the operation identifier corresponding to the business operation can be generated based on the thread information of executing the business operation, so in this step, the thread information corresponding to the business operation can be first obtained to call the preset generation model to generate the operation identifier corresponding to the business operation. The preset generation model can be set based on demand, for example, the thread information can be a thread identifier, and then the splicing generation is performed based on the thread identifier and the business type corresponding to the business operation, or based on the thread identifier and random number generation, etc.
[0079] It should be noted that if Figure 1 In the data processing system shown, the data collection module can be used to execute steps S201 and S102, and report the acquired information to the data analysis module so that the data analysis module can process the information. In the embodiment of the present invention, the conditions for information reporting can be preset, such as: information reporting when the ratio of the number of database connections in the database connection pool that are in an active state to the preset maximum number of connections is greater than a preset threshold. Therefore, after executing this step, it can also be performed as follows: obtaining the number of database connections in the database connection pool that are in an active state, calculating the ratio of the number of database connections to the preset maximum number of connections; in response to the ratio meeting the preset conditions, reporting database connection information and operation information. The preset condition can be that the ratio is greater than the preset threshold. At the same time, the conditions for information reporting can also be set based on demand, for example, the reporting cycle can also be set, so the preset condition can be: the ratio is greater than the preset threshold and the reporting cycle is reached.
[0080] S203: Receive an abnormal alarm from the database connection pool, obtain corresponding alarm information to determine the alarm type, and query a set of to-be-processed parameters associated with the alarm type.
[0081] When an abnormality occurs in the database connection pool, an abnormality alarm can usually be automatically triggered. In the embodiment of the present invention, the abnormality alarm can be sent to the data processing system after being triggered by the database connection pool, and can also be sent by other systems. The abnormality of the database connection can include multiple alarm types, and the parameters required for analyzing different alarm types are different. Therefore, in the embodiment of the present invention, an associated set of parameters to be processed can be configured for each alarm type, that is, a set of parameters required for analyzing the alarm type.
[0082] In the embodiment of the present invention, for an abnormal alarm, corresponding alarm information can be obtained to determine the alarm type based on the alarm information. For example, keywords of each alarm type can be preset. After the alarm information is obtained in this step, it can be matched with the keywords of each alarm type. If the match is successful, the alarm type of the abnormal alarm can be determined to be the alarm type corresponding to the successfully matched keyword.
[0083] Specifically, the alarm type can be pre-configured. For example, the alarm type can include that the connection pool is exhausted (the first alarm type), that is, the number of database connections in use in the connection pool reaches the maximum number of connections, which means that there are many business operations. In order to balance the data processing volume of different business types, the distribution of business types to which each business operation belongs can be calculated, and then how to manage the database connection can be determined based on the distribution. The parameters required for calculating the distribution of business types are the business types to which the business operations belong. Therefore, the set of parameters to be processed associated with the first alarm type can be configured to include parameters for the business types to which the business operations belong.
[0084] For another example, the alarm type may include connection time anomalies (the second alarm type), that is, the time anomalies of the database connection processing business operations. This situation is usually due to the large amount of data processed by the business operations in sequence. The number of results included in the operation results can be calculated by the operation results corresponding to the business operations, and then compared with the preset number threshold to determine whether the cause of the anomaly is accurate based on the comparison result. Therefore, the set of parameters to be processed associated with the second alarm type can be configured to include the operation results corresponding to the business operations.
[0085] It should be noted that, in the embodiment of the present invention, the set of parameters to be processed associated with each alarm type may include one or more parameters, which may be specifically set based on demand, or the set of parameters to be processed associated with each alarm type may be changed based on demand update.
[0086] S204: Obtain the parameter value of each parameter to be processed in the set of parameters to be processed and the operation identifier corresponding to the parameter value from the database connection information and the operation information, so as to call the processing model corresponding to the parameter to be processed and determine the processing result corresponding to the parameter to be processed.
[0087] Among them, in step S203, the set of parameters to be processed associated with the alarm type is determined, that is, the parameters required for analyzing the abnormal alarm are determined, so in this step, the parameter value of each parameter to be processed in the set of parameters to be processed can be obtained from the information obtained in step S201, and then the parameter value is processed to obtain the processing result. Since the abnormal alarm is usually more related to the connection pool information in the recent period, the parameter value of each parameter to be processed within the preset historical time period can be obtained in this step, and the preset historical time period can be set based on demand, such as a preset historical day or a preset historical week.
[0088] In the embodiment of the present invention, a corresponding processing model may be configured for each parameter to be processed, so as to process the parameter value of the parameter to be processed and obtain a processing result.
[0089] For example, for the first alarm type, the parameter to be processed includes the business type to which the business operation belongs, and the parameter value includes the type value of the business type to which the business operation belongs. If the distribution of the business types needs to be calculated, then the processing result corresponding to the parameter to be processed can be specifically determined as follows: based on the operation identifier, the total number of business operations is counted, the number of each business type included in the parameter value is calculated, and the ratio of the number of each business type to the total number is calculated to determine the processing result corresponding to the parameter to be processed. The total number of business operations indicates the number of business operations executed on the database within a preset historical period. Each business operation corresponds to an operation identifier, so the total number of business operations can be counted through the operation identifier, and then the distribution of business types can be represented by the ratio of the number of business operations corresponding to each business type to the total number.
[0090] For another example, for the second alarm type, the parameter to be processed includes the operation result corresponding to the business operation, and the parameter value includes the operation result value corresponding to the business operation. It is necessary to compare the number of results included in each operation result with the preset number threshold, so this step determines the processing result corresponding to the parameter to be processed. It can be specifically performed as follows: calculate the number of results in the result value of the operation result corresponding to each operation identifier, compare the number of results with the preset number threshold to obtain a comparison result, and determine the comparison result of each operation result as the processing result corresponding to the parameter to be processed. Since a business operation can process multiple business data, the result value of the operation result will also include multiple results. Therefore, in this step, the number of results in the result value of each operation result can be compared with the preset number threshold, and then the comparison result can be obtained, so that the abnormal analysis can be performed based on the comparison result later.
[0091] In an embodiment of the present invention, after obtaining the processing results, a preset display model can be called to generate and display a corresponding structure diagram based on the processing results. Displaying the processing results in the form of a structure diagram can more intuitively reflect the problems in the abnormal alarm, thereby improving the processing efficiency of the abnormal alarm.
[0092] It should be noted that, in the embodiment of the present invention, when obtaining the parameter value of the parameter to be processed, the database connection information and the operation information may be filtered first to filter out the required information and reduce the amount of data for subsequent data processing.
[0093] In the embodiment of the present invention, the database connection information and operation information corresponding to each business operation can be obtained in real time. When an abnormal alarm occurs, comprehensive business operation information can be obtained and corresponding processing can be performed based on the needs of alarm analysis, and then abnormal analysis can be performed based on more comprehensive processing results, thereby improving the efficiency of abnormal analysis.
[0094] Combine the following Figure 1The system architecture shown in the figure, the embodiment of the present invention provides another data processing method, such as Figure 3 As shown, the method includes:
[0095] S301: In response to a monitoring instruction of a database connection pool, a data collection module intercepts each business operation of the database to obtain database connection information and operation information corresponding to the business operation.
[0096] S302: The data collection module obtains the number of active database connections in the database connection pool, and calculates the ratio of the number of database connections to the preset maximum number of connections.
[0097] S303: In response to the ratio satisfying a preset condition, the data collection module reports database connection information and operation information to the data analysis module.
[0098] S304: The data analysis module receives the abnormal alarm of the database connection pool, obtains the corresponding alarm information to determine the alarm type, and queries the set of parameters to be processed associated with the alarm type.
[0099] S305: The data analysis module obtains the parameter value of each parameter to be processed in the parameter set to be processed, so as to call the processing model corresponding to the parameter to be processed and determine the processing result corresponding to the parameter to be processed.
[0100] S306: The data analysis module distributes the processing results corresponding to the parameters to be processed to the preset service.
[0101] It should be noted that the data processing principle in the embodiment of the present invention is the same as Figure 2 The corresponding data processing principles in the illustrated embodiments are the same and will not be described in detail here.
[0102] Combine the following Figure 1 The system architecture shown in the figure, the embodiment of the present invention provides another data processing method, such as Figure 4 As shown, the method includes:
[0103] S401: In response to a monitoring instruction of a database connection pool, a preset interceptor interface is called to intercept various business operations on the database and obtain database connection information corresponding to the business operations.
[0104] S402: Acquire the business type and operation type to which the business operation belongs, and query parameter values of operation parameters associated with the operation type.
[0105] S403: Acquire thread information corresponding to the business operation, call a preset generation model to generate an operation identifier corresponding to the business operation, and establish a mapping relationship between the operation identifier, the operation information, and the database connection information.
[0106] S404: Receive an abnormal alarm from the database connection pool, obtain corresponding alarm information to determine the alarm type, and query a set of to-be-processed parameters associated with the alarm type.
[0107] S405: Obtain the parameter value of each parameter to be processed in the set of parameters to be processed and the operation identifier corresponding to the parameter value from the database connection information and the operation information, so as to call the processing model corresponding to the parameter to be processed and determine the processing result corresponding to the parameter to be processed.
[0108] S406: calling a preset display model to generate a corresponding structure diagram based on the processing result, and displaying the structure diagram.
[0109] It should be noted that the data processing principle in the embodiment of the present invention is the same as Figure 2 The corresponding data processing principles in the illustrated embodiments are the same and will not be described in detail here.
[0110] In order to solve the problems existing in the prior art, an embodiment of the present invention provides a data processing device 500, such as Figure 5 As shown, the device 500 includes:
[0111] The acquisition unit 501 is used to call a preset interceptor interface in response to a monitoring instruction of the database connection pool, intercept each business operation on the database, and obtain database connection information and operation information corresponding to the business operation;
[0112] An establishing unit 502 is used to obtain thread information corresponding to the business operation, to call a preset generation model to generate an operation identifier corresponding to the business operation, and to establish a mapping relationship between the operation identifier, the operation information and the database connection information;
[0113] A query unit 503 is used to receive an abnormal alarm of the database connection pool, obtain corresponding alarm information to determine the alarm type, and query a set of parameters to be processed associated with the alarm type;
[0114] The processing unit 504 is used to obtain the parameter value of each parameter to be processed in the set of parameters to be processed and the operation identifier corresponding to the parameter value from the database connection information and the operation information, so as to call the processing model corresponding to the parameter to be processed and determine the processing result corresponding to the parameter to be processed.
[0115] It should be understood that the manner of implementing the embodiments of the present invention is different from the Figure 2 The method of the illustrated embodiment is the same and will not be described again here.
[0116] In one embodiment, the parameter to be processed includes a business type to which the business operation belongs, and the parameter value includes a type value of the business type to which the business operation belongs;
[0117] The processing unit 504 is specifically configured to:
[0118] The total number of the business operations is counted based on the operation identifier, the number of each business type included in the parameter value is calculated, and the ratio of the number of each business type to the total number is calculated to determine the processing result corresponding to the parameter to be processed.
[0119] In yet another embodiment, the parameter to be processed includes an operation result corresponding to the business operation, and the parameter value includes an operation result value corresponding to the business operation;
[0120] The processing unit 504 is specifically configured to:
[0121] The number of results in the result value of the operation result corresponding to each operation identifier is calculated, and the number of results is compared with a preset number threshold to obtain a comparison result, so as to determine the comparison result of each operation result as the processing result corresponding to the parameter to be processed.
[0122] In yet another embodiment, the acquiring unit 501 is specifically configured to:
[0123] The business type and operation type to which the business operation belongs are obtained, and the parameter values of the operation parameters associated with the operation type are queried.
[0124] In yet another embodiment, the processing unit 504 is further configured to obtain the monitoring switch status of the database connection pool from a preset configuration management center;
[0125] The device 500 further includes:
[0126] The trigger unit is used to trigger the monitoring instruction of the database connection pool in response to the monitoring switch state being turned on.
[0127] In yet another embodiment, the apparatus 500 further includes:
[0128] A calculation unit, used to obtain the number of active database connections in the database connection pool, and calculate the ratio of the number of database connections to a preset maximum number of connections;
[0129] A reporting unit is used to report the database connection information and operation information in response to the ratio meeting a preset condition.
[0130] In yet another embodiment, the processing unit 503 is further configured to:
[0131] A preset display model is called to generate a corresponding structure diagram based on the processing result, and the structure diagram is displayed.
[0132] It should be understood that the manner of implementing the embodiments of the present invention is different from the Figure 2 , 3 , and the method of the embodiment shown in 4 is the same and will not be repeated here.
[0133] In the embodiment of the present invention, after responding to the monitoring instruction of the database connection pool, each business operation of the database can be intercepted to obtain the database connection information and operation information corresponding to the business operation, so that the operation of each database can be monitored; after receiving the abnormal alarm of the database connection pool, the alarm type can be determined first to query the set of parameters to be processed associated with the alarm type, and then the parameter values of each parameter to be processed can be obtained from the database connection information and operation information to analyze and process, and obtain the processing results corresponding to the parameters to be processed. In this way, in the embodiment of the present invention, the database connection information and operation information corresponding to each business operation can be obtained in real time. When an abnormal alarm occurs, comprehensive business operation information can be obtained based on the needs of alarm analysis and corresponding processing can be performed, and then abnormal analysis can be performed based on more comprehensive processing results, thereby improving the efficiency of abnormal analysis.
[0134] According to an embodiment of the present invention, the embodiment of the present invention further provides an electronic device and a readable storage medium.
[0135] The electronic device of an embodiment of the present invention comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the one processor, and the instructions are executed by the at least one processor so that the at least one processor executes the data processing method provided by the embodiment of the present invention.
[0136] Figure 6 An exemplary system architecture 600 is shown to which the data processing method or data processing apparatus according to the embodiment of the present invention can be applied.
[0137] like Figure 6 As shown, system architecture 600 may include terminal devices 601, 602, 603, network 604 and server 605. Network 604 is used to provide a medium for communication links between terminal devices 601, 602, 603 and server 605. Network 604 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0138] The user can use the terminal devices 601, 602, 603 to interact with the server 605 through the network 604 to receive or send messages, etc. Various client applications can be installed on the terminal devices 601, 602, 603.
[0139] The terminal devices 601 , 602 , and 603 may be, but are not limited to, smart phones, tablet computers, laptop computers, and desktop computers, etc.
[0140] The server 605 may be a server that provides various services. The server may analyze and process the received data such as the product information query request, and feed back the processing result (such as product information - just an example) to the terminal device.
[0141] It should be noted that the data processing method provided in the embodiment of the present invention is generally executed by the server 605 , and accordingly, the data processing device is generally set in the server 605 .
[0142] It should be understood that Figure 6 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0143] Reference below Figure 7 , which shows a schematic diagram of the structure of a computer system 700 suitable for implementing an embodiment of the present invention. Figure 7 The computer system shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0144] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0145] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.
[0146] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present invention are executed.
[0147] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0148] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a unit, a program segment, or a part of a code, and the above-mentioned unit, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0149] The units involved in the embodiments of the present invention may be implemented by software or hardware. The units described may also be arranged in a processor, for example, it may be described as: a processor includes an acquisition unit, a query unit and a processing unit. The names of these units do not constitute a limitation on the units themselves in some cases, for example, the acquisition unit may also be described as a "unit of information acquisition function".
[0150] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device executes the data processing method provided by the present invention.
[0151] As another aspect, the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the data processing method provided by an embodiment of the present invention.
[0152] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for data processing, characterized in that: include: In response to the monitoring instruction of the database connection pool, the preset interceptor interface is called to intercept each business operation on the database to obtain the database connection information and operation information corresponding to the business operation; Obtaining thread information corresponding to the business operation, so as to call a preset generation model to generate an operation identifier corresponding to the business operation, so as to establish a mapping relationship between the operation identifier, the operation information and the database connection information; Receive an abnormal alarm of the database connection pool, obtain corresponding alarm information to determine the alarm type, and query a set of parameters to be processed associated with the alarm type; The parameter value of each parameter to be processed in the set of parameters to be processed and the operation identifier corresponding to the parameter value are obtained from the database connection information and the operation information to call the processing model corresponding to the parameter to be processed and determine the processing result corresponding to the parameter to be processed.
2. The method according to claim 1, characterized in that: The parameter to be processed includes the business type to which the business operation belongs, and the parameter value includes the type value of the business type to which the business operation belongs; Calling a processing model corresponding to the parameter to be processed to determine a processing result corresponding to the parameter to be processed includes: The total number of the business operations is counted based on the operation identifier, the number of each business type included in the parameter value is calculated, and the ratio of the number of each business type to the total number is calculated to determine the processing result corresponding to the parameter to be processed.
3. The method according to claim 1, characterized in that: The parameter to be processed includes an operation result corresponding to the business operation, and the parameter value includes an operation result value corresponding to the business operation; Calling a processing model corresponding to the parameter to be processed to determine a processing result corresponding to the parameter to be processed includes: The number of results in the result value of the operation result corresponding to each operation identifier is calculated, and the number of results is compared with a preset number threshold to obtain a comparison result, so as to determine the comparison result of each operation result as the processing result corresponding to the parameter to be processed.
4. The method according to claim 1, characterized in that: Obtaining operation information corresponding to the business operation, including: The business type and operation type to which the business operation belongs are obtained, and the parameter values of the operation parameters associated with the operation type are queried.
5. The method according to claim 1, characterized in that Before responding to the monitoring instruction of the database connection pool, the method further includes: Obtaining the monitoring switch status of the database connection pool from a preset configuration management center; In response to the monitoring switch state being turned on, a monitoring instruction of the database connection pool is triggered.
6. The method according to claim 1, characterized in that Before receiving the abnormal alarm of the database connection pool, the method further includes: Obtaining the number of active database connections in the database connection pool, and calculating the ratio of the number of database connections to a preset maximum number of connections; In response to the ratio satisfying a preset condition, the database connection information and the operation information are reported.
7. The method according to claim 1, characterized in that The method further comprises: A preset display model is called to generate a corresponding structure diagram based on the processing result, and the structure diagram is displayed.
8. A data processing device, characterized in that: include: An acquisition unit, used to respond to a monitoring instruction of a database connection pool, call a preset interceptor interface, intercept various business operations on the database, and obtain database connection information and operation information corresponding to the business operation; An establishing unit, used for acquiring thread information corresponding to the business operation, so as to call a preset generation model to generate an operation identifier corresponding to the business operation, so as to establish a mapping relationship between the operation identifier, the operation information and the database connection information; A query unit, used to receive an abnormal alarm of the database connection pool, obtain corresponding alarm information to determine the alarm type, and query a set of parameters to be processed associated with the alarm type; A processing unit is used to obtain the parameter value of each parameter to be processed in the set of parameters to be processed and the operation identifier corresponding to the parameter value from the database connection information and the operation information, so as to call the processing model corresponding to the parameter to be processed and determine the processing result corresponding to the parameter to be processed.
9. An electronic device, characterized in that: include: one or more processors; a storage device for storing 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 method according to any one of claims 1 to 7.
10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
