Data processing method and apparatus, database development tool, and electronic device
By configuring interactive parameter templates in the database development tool to generate and process SQL audit requests, the problem of difficult integration between the database development tool and the SQL audit system is solved, achieving efficient and accurate database management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING OCEANBASE TECHNOLOGY CO LTD
- Filing Date
- 2023-04-27
- Publication Date
- 2026-06-23
AI Technical Summary
The integration of database development tools with SQL auditing systems is difficult, and the inability to consistently process user SQL statements results in low database management efficiency and accuracy.
By pre-configuring interactive parameter templates in the database development tool, generating SQL audit requests and communicating with the SQL audit system, decoding the return values, and processing SQL statements based on the audit results, the tool and system can be integrated and coordinated.
It simplifies the integration process between database development tools and SQL auditing systems, improves the efficiency and accuracy of database management, and ensures consistency in the authorization auditing of SQL statements.
Smart Images

Figure CN116483860B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of database technology, and more particularly to a data processing method and apparatus, database development tools and electronic devices. Background Technology
[0002] In today's era of rapid internet and information technology development, data generation is exploding, leading to increasingly higher demands on databases and their management. Currently, database management is primarily achieved through database development tools, such as processing data within the database by executing SQL statements. Different users often have different database management permissions, therefore, permission verification is required before users can execute SQL statements; only SQL statements with the appropriate permissions can be executed. Database development tools and the verification system used to verify user database management permissions often exist independently; for example, the verification system might be the database vendor's office approval software. Integrating database development tools and such verification systems is challenging, and the two often cannot coordinate effectively in processing user SQL statements. Summary of the Invention
[0003] In view of the above, one or more embodiments of this specification provide a data processing method and apparatus, a database development tool and an electronic device.
[0004] To achieve the above objectives, one or more embodiments of this specification provide the following technical solutions:
[0005] According to a first aspect of one or more embodiments of this specification, a data processing method is proposed, applied to a database development tool, the database development tool having a parameter template and pre-configured with interactive parameters generated according to the parameter template for communicating with an SQL auditing system, the method comprising:
[0006] In response to generating an SQL statement to be executed, an SQL review request is generated using the interaction parameters, and the SQL review request is sent to the SQL review system, wherein the SQL review request is configured to request the SQL review system to review the SQL statement to be executed;
[0007] The system receives the return value of the SQL audit request sent by the SQL audit system, and decodes the return value using the interaction parameters to obtain the audit result of the SQL statement to be executed.
[0008] The SQL statement is processed based on the audit results.
[0009] In one embodiment of this specification, the audit result includes executable or non-executable;
[0010] The step of processing the SQL statement based on the audit result includes:
[0011] In response to the audit result being executable, the SQL statement is executed;
[0012] In response to the audit result being unexecutable, a prompt message is generated, wherein the prompt message is used to indicate that the SQL statement does not have permission to be executed.
[0013] In one embodiment of this specification, the review result includes pending approval;
[0014] The step of processing the SQL statement based on the audit result includes:
[0015] In response to the audit result being pending approval, a new work order request is generated using the interaction parameters, and the new work order request is sent to the SQL audit system. The new work order request is configured to request the SQL audit system to create a new work order for approving the execution permission of the SQL statement to be executed.
[0016] The system receives the return value from the SQL audit system in response to the request to create a new work order, and decodes the return value using the interaction parameters to obtain the work order identifier.
[0017] An approval result retrieval request is generated using the interaction parameters, and the approval result retrieval request is sent to the SQL review system, wherein the approval result retrieval request is configured to request the SQL review system to send the approval result of the approval work order to which the work order identifier belongs;
[0018] The system receives the return value of the request to obtain the approval result sent by the SQL review system, and decodes the return value using the interaction parameters to obtain the approval result.
[0019] The SQL statement is processed based on the approval result.
[0020] In one embodiment of this specification, generating a new work order request using the interaction parameters includes:
[0021] Obtain the initiator of the SQL statement to be executed, and generate a new work order request using the interaction parameters and the initiator. The new work order request is configured to request the SQL review system to create a work order for approving whether the initiator has the execution permission for the SQL statement to be executed.
[0022] In one embodiment of this specification, the approval result includes pass or fail;
[0023] The step of processing the SQL statement based on the approval result includes:
[0024] In response to the approval result being approved, the SQL statement is executed;
[0025] In response to the approval result being rejected, a prompt message is generated, wherein the prompt message is used to indicate that the SQL statement has not passed the approval.
[0026] In one embodiment of this specification, the method further includes:
[0027] The interactive parameters of the database development tool are configured according to the parameter configuration instructions, wherein the parameter configuration instructions are input by the user based on the parameter template of the database development tool and the SQL auditing system.
[0028] In one embodiment of this specification, the interaction parameters include at least one of the following:
[0029] Parameters used to generate SQL audit requests;
[0030] An expression used to decode the return value of the SQL audit request;
[0031] Parameters used to generate a new work order request;
[0032] An expression used to decode the return value of the new work order request;
[0033] Parameters used to generate the approval result retrieval request;
[0034] An expression used to decode the return value of the request for obtaining the approval result.
[0035] In one embodiment of this specification, the interaction parameters include at least one of the following: request method, request address, request header, request parameters, request body format, request body content, whether the request body is encrypted, request body encryption method, request body encryption key, whether the return value is encrypted, return value encryption method, and return value encryption key;
[0036] The request address includes the URL address of the SQL auditing system's API.
[0037] In one embodiment of this specification, the interaction parameters are further used to characterize whether the database development tool integrates the SQL auditing system;
[0038] The step of responding to the generation of an SQL statement to be executed, generating an SQL audit request using the interaction parameters, and sending the SQL audit request to the SQL audit system includes:
[0039] In response to generating an SQL statement to be executed, and given that the interaction parameters indicate that the database development tool integrates the SQL auditing system, an SQL auditing request is generated using the interaction parameters, and the SQL auditing request is sent to the SQL auditing system.
[0040] In one embodiment of this specification, the method further includes:
[0041] In response to the generation of an SQL statement to be executed, and the interaction parameters indicating that the database development tool does not integrate the SQL auditing system, the SQL auditing module within the database development tool is used to audit the SQL statement to be executed, and the auditing result is used to process the SQL statement.
[0042] According to a second aspect of one or more embodiments of this specification, a data processing apparatus is provided, applied to a database development tool, the database development tool having a parameter template and pre-configured with interactive parameters generated according to the parameter template for communicating with an SQL auditing system, the apparatus comprising:
[0043] The request module is used to generate an SQL audit request using the interaction parameters in response to the generation of the SQL statement to be executed, and to send the SQL audit request to the SQL audit system, wherein the SQL audit request is used to request the SQL audit system to audit the SQL statement to be executed;
[0044] The decoding module is used to receive the return value of the SQL audit request sent by the SQL audit system, and decode the return value using the interaction parameters to obtain the audit result of the SQL statement to be executed;
[0045] The processing module is used to process the SQL statement based on the audit result.
[0046] In one embodiment of this specification, the audit result includes executable or non-executable;
[0047] The processing module is used for:
[0048] In response to the audit result being executable, the SQL statement is executed;
[0049] In response to the audit result being unexecutable, a prompt message is generated, wherein the prompt message is used to indicate that the SQL statement does not have permission to be executed.
[0050] In one embodiment of this specification, the review result includes pending approval;
[0051] The processing module is used for:
[0052] In response to the audit result being pending approval, a new work order request is generated using the interaction parameters, and the new work order request is sent to the SQL audit system. The new work order request is configured to request the SQL audit system to create a new work order for approving the execution permission of the SQL statement to be executed.
[0053] The system receives the return value from the SQL audit system in response to the request to create a new work order, and decodes the return value using the interaction parameters to obtain the work order identifier.
[0054] An approval result retrieval request is generated using the interaction parameters, and the approval result retrieval request is sent to the SQL review system, wherein the approval result retrieval request is configured to request the SQL review system to send the approval result of the approval work order to which the work order identifier belongs;
[0055] The system receives the return value of the request to obtain the approval result sent by the SQL review system, and decodes the return value using the interaction parameters to obtain the approval result.
[0056] The SQL statement is processed based on the approval result.
[0057] In one embodiment of this specification, when the processing module generates a new work order request using the interaction parameters, it is specifically used for:
[0058] Obtain the initiator of the SQL statement to be executed, and generate a new work order request using the interaction parameters and the initiator. The new work order request is configured to request the SQL review system to create a work order for approving whether the initiator has the execution permission for the SQL statement to be executed.
[0059] In one embodiment of this specification, the approval result includes pass or fail;
[0060] When the processing module processes the SQL statement based on the approval result, it is specifically used for:
[0061] In response to the approval result being approved, the SQL statement is executed;
[0062] In response to the approval result being rejected, a prompt message is generated, wherein the prompt message is used to indicate that the SQL statement has not passed the approval.
[0063] In one embodiment of this specification, the apparatus further includes an instruction module for:
[0064] The interactive parameters of the database development tool are configured according to the parameter configuration instructions, wherein the parameter configuration instructions are input by the user based on the parameter template of the database development tool and the SQL auditing system.
[0065] In one embodiment of this specification, the interaction parameters include at least one of the following:
[0066] Parameters used to generate SQL audit requests;
[0067] An expression used to decode the return value of the SQL audit request;
[0068] Parameters used to generate a new work order request;
[0069] An expression used to decode the return value of the new work order request;
[0070] Parameters used to generate the approval result retrieval request;
[0071] An expression used to decode the return value of the request for obtaining the approval result.
[0072] In one embodiment of this specification, the interaction parameters include at least one of the following: request method, request address, request header, request parameters, request body format, request body content, whether the request body is encrypted, request body encryption method, request body encryption key, whether the return value is encrypted, return value encryption method, and return value encryption key;
[0073] The request address includes the URL address of the SQL auditing system's API.
[0074] In one embodiment of this specification, the interaction parameters are further used to characterize whether the database development tool integrates the SQL auditing system;
[0075] The audit module is used for:
[0076] In response to generating an SQL statement to be executed, and given that the interaction parameters indicate that the database development tool integrates the SQL auditing system, an SQL auditing request is generated using the interaction parameters, and the SQL auditing request is sent to the SQL auditing system.
[0077] In one embodiment of this specification, the audit module is further configured to:
[0078] In response to the generation of an SQL statement to be executed, and given that the interaction parameters indicate that the database development tool does not integrate the SQL auditing system, the SQL statement to be executed is audited using the SQL auditing module within the database development tool, and the SQL statement is processed using the auditing results.
[0079] According to a third aspect of one or more embodiments of this specification, a database development tool is provided, the database development tool having parameter templates for configuring interaction parameters for communication with an SQL auditing system.
[0080] According to a fourth aspect of one or more embodiments of this specification, an electronic device is provided, comprising:
[0081] processor;
[0082] Memory used to store processor-executable instructions;
[0083] The processor implements the method as described in the first aspect by running the executable instructions.
[0084] According to a fifth aspect of one or more embodiments of this specification, a computer-readable storage medium is provided that stores computer instructions thereon, which, when executed by a processor, implement the steps of the method as described in the first aspect.
[0085] The technical solutions provided in the embodiments of this specification may include the following beneficial effects:
[0086] The data processing method provided in this specification's embodiments utilizes a database development tool with parameter templates. These templates are pre-configured with interactive parameters for communication with an SQL review system. Therefore, when generating an SQL statement to be executed, the database development tool can use these interactive parameters to generate an SQL review request and send it to the SQL review system to request review of the SQL statement. The database development tool can then receive the return value from the SQL review system in response to the SQL review request and decode it using the interactive parameters to obtain the review result of the SQL statement. Finally, the database development tool can process the SQL statement based on the review result. Thus, this method enables the database development tool and the SQL review system to communicate and coordinately process SQL statements through interactive parameters, achieving integration between the two. Furthermore, the configuration of these interactive parameters is based on parameter templates, making it simple and convenient, and reducing the difficulty of integration. Attached Figure Description
[0087] Figure 1 This is a flowchart of a data processing method provided in an exemplary embodiment.
[0088] Figure 2 This is a schematic diagram illustrating the processing of the SQL statement based on the audit result in a data synchronization method provided by an exemplary embodiment.
[0089] Figure 3 This is a flowchart of a data processing method provided in an exemplary embodiment.
[0090] Figure 4 This is a schematic diagram of the structure of a device provided in an exemplary embodiment.
[0091] Figure 5 This is a block diagram of a data processing apparatus provided in an exemplary embodiment. Detailed Implementation
[0092] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0093] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the methods may include more or fewer steps than described in this specification. Furthermore, a single step described in this specification may be broken down into multiple steps in other embodiments; and multiple steps described in this specification may be combined into a single step in other embodiments.
[0094] In today's era of rapid internet and information technology development, data generation is exploding, leading to increasingly higher demands on databases and their management. Currently, database management is primarily achieved through database development tools, such as processing data within the database by executing SQL statements. Different users often have different database management permissions, therefore, permission verification is required before users can execute SQL statements; only SQL statements with the appropriate permissions can be executed. Database development tools and the verification system used to verify user database management permissions often exist independently; for example, the verification system might be the database vendor's office approval software. Integrating database development tools and such verification systems is technically challenging, and the two often cannot coordinate to process user SQL statements consistently.
[0095] Based on this, in a first aspect, at least one embodiment of this specification provides a data processing method that enables database development tools and SQL auditing systems to be easily and conveniently integrated to process user SQL statements in a coordinated manner, thereby improving the efficiency and accuracy of database management. The SQL auditing system can be the office approval software of the vendor to which the database managed by the database development tool belongs.
[0096] This method can be applied to the database development tool, which can have parameter templates and can be pre-configured with interactive parameters for communication with an SQL auditing system, generated according to the parameter templates. The interactive parameters serve as a communication bridge between the database development tool and the SQL auditing system; that is, the database development tool can send requests to the SQL auditing system according to the interactive parameters, decode return values, etc., thereby making communication between the two convenient, simple, reliable, and efficient. The parameter template can be used to configure the interactive parameters for communication with the SQL auditing system, serving as a reference for configuring interactive parameters. For example, the parameter template can have various sentence structures for communication with the SQL auditing system, and users can adaptively edit it according to each sentence structure in the SQL auditing system integrated with the database development tool to obtain the interactive parameters for communication with that SQL auditing system. This can be done by the user directly in the metadata database or through the interactive interface of the development tool. In other words, the database development tool can configure its interactive parameters according to parameter configuration instructions, where the parameter configuration instructions are input by the user based on the parameter templates of the database development tool and the SQL auditing system.
[0097] Optionally, if classified according to the purpose of the interaction parameters, the interaction parameters include at least one of the following: parameters for generating SQL review requests, expressions for decoding the return value of the SQL review requests, parameters for generating new work order requests, expressions for decoding the return value of the new work order requests, parameters for generating approval result retrieval requests, and expressions for decoding the return value of the approval result retrieval requests, etc.
[0098] Optionally, if classified according to the content of the interaction parameters, the interaction parameters include at least one of the following: request method, request address, request header, request parameters, request body format, request body content, whether the request body is encrypted, request body encryption method, request body encryption key, whether the return value is encrypted, return value encryption method, return value encryption key, etc.; wherein, the request address includes the URL (Uniform Resource Locator) address of the API (Application Programming Interface) of the SQL auditing system. For example, parameters used to generate an SQL review request include the request method, request address (i.e., the API in the SQL review system used to receive SQL review requests), request headers, request parameters, request body format, request body content, whether the request body is encrypted, request body encryption method, and request body encryption key; as another example, parameters used to generate a new work order request include the request method, request address (i.e., the API in the SQL review system used to receive new work order requests), request headers, request parameters, request body format, request body content, whether the request body is encrypted, request body encryption method, and request body encryption key; as yet another example, parameters used to generate an approval result retrieval request include the request method, request address (i.e., the API in the SQL review system used to receive approval result retrieval requests), request headers, request parameters, request body format, request body content, whether the request body is encrypted, request body encryption method, and request body encryption key.
[0099] Please refer to the appendix. Figure 1 The example illustrates the flow of the method, including steps S101 to S103.
[0100] In step S101, in response to generating the SQL statement to be executed, an SQL review request is generated using the interaction parameters, and the SQL review request is sent to the SQL review system, wherein the SQL review request is configured to request the SQL review system to review the SQL statement to be executed.
[0101] In this process, when a user manages a database using a database development tool, the tool generates a corresponding SQL statement after the user inputs a data management command. If this SQL statement is executed, the data management transaction specified by the user's command can be completed. The SQL statement to be executed in this step can be the SQL statement generated by the database management tool based on the user's input data management command.
[0102] It is understood that the interaction parameters can include variables and invariants. Invariants can be parts that match the SQL auditing system, such as the request method and request address (i.e., the API used in the SQL auditing system to receive SQL audit requests). Variables can be the object to be audited, i.e., the SQL statement to be executed. Therefore, in this step, when generating (i.e., editing) the SQL audit request using the interaction parameters, the parameters used to generate the SQL audit request can be used to edit and encapsulate the variables related to this audit request to obtain the SQL audit request. For example, the template variables in the request body content of the parameters used to generate the SQL audit request can be replaced with the SQL statement to be executed, and the parameters can be encapsulated using at least one of the following: request method, request address, request header, request parameters, request body format, request body content, whether the request body is encrypted, request body encryption method, and request body encryption key, to obtain the SQL audit request.
[0103] The purpose of an SQL audit request is to call the API used for SQL auditing in the SQL auditing system, so that the SQL auditing system can audit the SQL statement to be executed and return a return value to represent the audit result; figuratively speaking, its function is equivalent to the user inputting the SQL statement into the SQL auditing system for auditing.
[0104] In step S102, the return value of the SQL audit request sent by the SQL audit system is received, and the return value is decoded using the interaction parameters to obtain the audit result of the SQL statement to be executed.
[0105] For example, if the return value in the interaction parameters is encrypted, the return value can be decrypted using the encryption method and encryption key in the interaction parameters to obtain the decryption result. Then, the decryption result is input into the expression in the interaction parameters used to decode the return value for the SQL audit request, to obtain the decoding result of the expression on the return value, i.e., the audit result of the SQL statement to be executed. Conversely, if the return value in the interaction parameters is not encrypted, the return value can be directly input into the expression in the interaction parameters used to decode the return value for the SQL audit request, to obtain the decoding result of the expression on the return value, i.e., the audit result of the SQL statement to be executed.
[0106] The review results for SQL statements to be executed can include executable, non-executable, and pending approval. The SQL review system has a whitelist and a blacklist of SQL statements. If the SQL statement to be executed is in the whitelist, the review result is determined to be executable. If the SQL statement to be executed is in the blacklist, the review result is determined to be non-executable. If the SQL statement to be executed is not in either the whitelist or the blacklist, the review result is determined to be pending approval (i.e., it cannot be confirmed whether it is executable and needs to be submitted for approval by a user with approval authority).
[0107] In step S103, the SQL statement is processed according to the audit result.
[0108] For example, in response to the audit result being executable, the SQL statement is executed to complete the data management transaction indicated by the user's data management instruction.
[0109] As another example, in response to the audit result being unexecutable, a prompt message is generated, wherein the prompt message is used to indicate that the SQL statement does not have permission to be executed, so as to cause the user to abandon the data management transaction indicated by their data management instructions.
[0110] For example, in the case where the review result is pending approval, it can be handled as follows: Figure 2 This step is performed in the manner shown, including sub-steps S1031 to S1035.
[0111] In sub-step S1031, in response to the audit result being pending approval, a new work order request is generated using the interaction parameters, and the new work order request is sent to the SQL audit system. The new work order request is configured to request the SQL audit system to create a new work order for approving the execution permission of the SQL statement to be executed.
[0112] For example, this step can obtain the initiator of the SQL statement to be executed (e.g., a user who inputs data management instructions into the database development tool), and use the interaction parameters and the initiator to generate a new work order request, wherein the new work order request is configured to request the SQL review system to create a work order for approving whether the initiator has the execution permission for the SQL statement to be executed.
[0113] It is understood that the interaction parameters can include variables and invariants. Invariants can be parts that match the SQL review system, such as the request method and request address (i.e., the API used in the SQL review system to receive new work order requests). Variables can be the object to be reviewed, i.e., the SQL statement to be executed and its initiator. Therefore, in this step, when generating (i.e., editing) a new work order request using the interaction parameters, the parameters used to generate the new work order request can be used to edit and encapsulate the variables related to this work order request to obtain the new work order request. For example, the template variables in the request body content of the parameters used to generate the new work order request can be replaced with the SQL statement to be executed and its initiator, and the parameters can be encapsulated using at least one of the following: request method, request address, request header, request parameters, request body format, request body content, whether the request body is encrypted, request body encryption method, and request body encryption key, to obtain the new work order request.
[0114] The purpose of the new work order request is to call the API in the SQL review system used to create work orders, so that the SQL review system can create a work order to approve whether the initiator has the execution permission of the SQL statement to be executed, and return a return value to identify the work order (such as number, id, etc.); figuratively speaking, its function is equivalent to the user creating a new work order in the SQL review system to approve whether the initiator has the execution permission of the SQL statement to be executed.
[0115] After a new work order is created in the SQL auditing system, a work order identifier (such as number, id, etc.) will be assigned to the new work order.
[0116] In sub-step S1032, the return value of the new work order request sent by the SQL audit system is received, and the return value is decoded using the interaction parameters to obtain the work order identifier.
[0117] For example, if the return value in the interaction parameters is encrypted, it can be decrypted using the encryption method and key provided in the interaction parameters. The decrypted result is then input into the expression in the interaction parameters used to decode the return value for the new work order request, resulting in the decoding result of the expression, which is the work order identifier of the newly created approval work order. Conversely, if the return value in the interaction parameters is not encrypted, it can be directly input into the expression in the interaction parameters used to decode the return value for the new work order request, resulting in the decoding result of the expression, which is also the work order identifier of the newly created approval work order.
[0118] In sub-step S1033, an approval result retrieval request is generated using the interaction parameters, and the approval result retrieval request is sent to the SQL review system. The approval result retrieval request is configured to request the SQL review system to send the approval result of the approval work order to which the work order identifier belongs.
[0119] After a new approval work order is created in the SQL approval system, the work order will be submitted to a user with approval authority. The user can then approve the work order by inputting the approval result as either "pass" or "fail".
[0120] It is understood that the interaction parameters can include variables and invariants. The invariants can be parts that match the SQL review system, such as the request method and request address (i.e., the API used in the SQL review system to receive new work order requests). The variables can be the object being retrieved, such as the work order identifier. Therefore, in this step, when generating (i.e., editing) the approval result retrieval request using the interaction parameters, the parameters used to generate the approval result retrieval request can be used to edit and encapsulate the variables related to this retrieval request to obtain the approval result retrieval request. For example, the template variable in the request body content of the parameters used to generate the approval result retrieval request can be replaced with the work order identifier, and the parameters can be encapsulated using at least one of the following: request method, request address, request header, request parameters, request body format, request body content, whether the request body is encrypted, request body encryption method, and request body encryption key, to obtain the approval result retrieval request.
[0121] The purpose of a new work order request is to call the API in the SQL approval system used to return approval results, so that the SQL approval system can return the approval result of the work order to which the work order identifier belongs. In simpler terms, it's equivalent to a user entering a work order identifier into the SQL approval system to query the approval result of the work order to which that identifier belongs.
[0122] In sub-step S1034, the return value of the request to obtain the approval result sent by the SQL review system is received, and the return value is decoded using the interaction parameters to obtain the approval result.
[0123] For example, if the return value in the interaction parameters is encrypted, it can be decrypted using the encryption method and key provided in the interaction parameters. The decrypted result is then input into the expression in the interaction parameters used to decode the return value of the request for obtaining the approval result, thus obtaining the decoding result of the expression on the return value, which is the approval result of the newly created approval work order. Conversely, if the return value in the interaction parameters is not encrypted, it can be directly input into the expression in the interaction parameters used to decode the return value of the request for obtaining the approval result, thus obtaining the decoding result of the expression on the return value, which is the approval result of the newly created approval work order.
[0124] The approval result can be either approved or rejected.
[0125] In sub-step S1035, the SQL statement is processed according to the approval result.
[0126] For example, in response to the approval result being approved, the SQL statement is executed to complete the data management transaction indicated by the user's data management instruction.
[0127] For example, in response to the approval result being rejected, a prompt message is generated, wherein the prompt message is used to indicate that the SQL statement has not passed the approval, so that the user abandons the data management transaction indicated by his data management instruction.
[0128] The data processing method provided in this specification's embodiments utilizes a database development tool with parameter templates. These templates are pre-configured with interactive parameters for communication with an SQL review system. Therefore, when generating an SQL statement to be executed, the database development tool can use these interactive parameters to generate an SQL review request and send it to the SQL review system to request review of the SQL statement. The database development tool can then receive the return value from the SQL review system in response to the SQL review request and decode it using the interactive parameters to obtain the review result of the SQL statement. Finally, the database development tool can process the SQL statement based on the review result. Thus, this method enables the database development tool and the SQL review system to communicate and coordinately process SQL statements through interactive parameters, achieving integration between the two. Furthermore, the configuration of these interactive parameters is based on parameter templates, making it simple and convenient, and reducing the difficulty of integration.
[0129] In some embodiments of this disclosure, the interaction parameters are also used to characterize whether the database development tool integrates the SQL auditing system; that is, the interaction parameters may include parameters used to characterize whether the database development tool integrates the SQL auditing system.
[0130] The data processing method in the above embodiments (i.e., the appendix) Figure 1 The data processing method shown can be completed when the database development tool integrates the SQL auditing system, i.e., attached... Figure 1 Step S101 may include: in response to generating an SQL statement to be executed, and the interaction parameter indicating that the database development tool is integrated with the SQL auditing system, generating an SQL auditing request using the interaction parameter, and sending the SQL auditing request to the SQL auditing system.
[0131] Alternatively, in response to the generation of an SQL statement to be executed, and given that the interaction parameters indicate that the database development tool does not integrate the SQL auditing system, the SQL auditing module within the database development tool can be used to audit the SQL statement to be executed, and the audit results can be used to process the SQL statement.
[0132] Please refer to the appendix. Figure 3 The flowchart of a data processing method obtained by combining the above embodiments is illustrated as an example. The method includes the following steps:
[0133] Step S301: The database development tool generates SQL statements to be executed.
[0134] Step S302: Determine whether the database development tool has integrated an SQL auditing system.
[0135] Step S303: Use the SQL auditing module of the database development tool itself to audit the SQL statement to be executed.
[0136] Step S304: Call the API of the SQL audit system to initiate an SQL audit request.
[0137] Step S305: Decode the API return value and calculate the SQL audit result based on the parameter validation expression (i.e., the expression used to decode the return value for the SQL audit request).
[0138] Step S306: Based on the SQL audit results, determine whether an approval work order needs to be initiated.
[0139] Step S307: Call the API of the SQL audit system to initiate a request to create a new SQL approval work order.
[0140] Step S308: Decode the API return value and calculate the approval work order number based on the parameter validation expression (i.e., the expression used to decode the return value for the new work order request).
[0141] Step S309: Check the approval status in the SQL audit system based on the work order number.
[0142] Step S310: Check the audit results / approval status of the SQL audit module to determine whether the audit / approval has passed.
[0143] Step S311: Determine whether execution is allowed based on the SQL audit results.
[0144] Step S312: Execute the SQL statement.
[0145] Figure 4 This is a schematic structural diagram of a device provided in an exemplary embodiment. Please refer to... Figure 4 At the hardware level, the device includes a processor 402, an internal bus 404, a network interface 406, memory 408, and non-volatile memory 410, and may also include other hardware required for tasks. One or more embodiments of this specification can be implemented in software, such as the processor 402 reading the corresponding computer program from the non-volatile memory 410 into memory 408 and then running it. Of course, in addition to software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0146] Please refer to Figure 5 Data processing devices can be applied to, for example Figure 4 The device shown implements the technical solution of this specification. The data processing apparatus can be applied to a database development tool, which has parameter templates and is pre-configured with interactive parameters generated based on the parameter templates for communication with an SQL auditing system. The apparatus includes:
[0147] The request module 501 is used to generate an SQL audit request using the interaction parameters in response to the generation of the SQL statement to be executed, and to send the SQL audit request to the SQL audit system, wherein the SQL audit request is used to request the SQL audit system to audit the SQL statement to be executed;
[0148] The decoding module 502 is used to receive the return value of the SQL audit request sent by the SQL audit system, and decode the return value using the interaction parameters to obtain the audit result of the SQL statement to be executed;
[0149] The processing module 503 is used to process the SQL statement based on the audit result.
[0150] In one embodiment of this specification, the audit result includes executable or non-executable;
[0151] The processing module is used for:
[0152] In response to the audit result being executable, the SQL statement is executed;
[0153] In response to the audit result being unexecutable, a prompt message is generated, wherein the prompt message is used to indicate that the SQL statement does not have permission to be executed.
[0154] In one embodiment of this specification, the review result includes pending approval;
[0155] The processing module is used for:
[0156] In response to the audit result being pending approval, a new work order request is generated using the interaction parameters, and the new work order request is sent to the SQL audit system. The new work order request is configured to request the SQL audit system to create a new work order for approving the execution permission of the SQL statement to be executed.
[0157] The system receives the return value from the SQL audit system in response to the request to create a new work order, and decodes the return value using the interaction parameters to obtain the work order identifier.
[0158] An approval result retrieval request is generated using the interaction parameters, and the approval result retrieval request is sent to the SQL review system, wherein the approval result retrieval request is configured to request the SQL review system to send the approval result of the approval work order to which the work order identifier belongs;
[0159] The system receives the return value of the request to obtain the approval result sent by the SQL review system, and decodes the return value using the interaction parameters to obtain the approval result.
[0160] The SQL statement is processed based on the approval result.
[0161] In one embodiment of this specification, when the processing module generates a new work order request using the interaction parameters, it is specifically used for:
[0162] Obtain the initiator of the SQL statement to be executed, and generate a new work order request using the interaction parameters and the initiator. The new work order request is configured to request the SQL review system to create a work order for approving whether the initiator has the execution permission for the SQL statement to be executed.
[0163] In one embodiment of this specification, the approval result includes pass or fail;
[0164] When the processing module processes the SQL statement based on the approval result, it is specifically used for:
[0165] In response to the approval result being approved, the SQL statement is executed;
[0166] In response to the approval result being rejected, a prompt message is generated, wherein the prompt message is used to indicate that the SQL statement has not passed the approval.
[0167] In one embodiment of this specification, the apparatus further includes an instruction module for:
[0168] The interactive parameters of the database development tool are configured according to the parameter configuration instructions, wherein the parameter configuration instructions are input by the user based on the parameter template of the database development tool and the SQL auditing system.
[0169] In one embodiment of this specification, the interaction parameters include at least one of the following:
[0170] Parameters used to generate SQL audit requests;
[0171] An expression used to decode the return value of the SQL audit request;
[0172] Parameters used to generate a new work order request;
[0173] An expression used to decode the return value of the new work order request;
[0174] Parameters used to generate the approval result retrieval request;
[0175] An expression used to decode the return value of the request for obtaining the approval result.
[0176] In one embodiment of this specification, the interaction parameters include at least one of the following: request method, request address, request header, request parameters, request body format, request body content, whether the request body is encrypted, request body encryption method, request body encryption key, whether the return value is encrypted, return value encryption method, and return value encryption key;
[0177] The request address includes the URL address of the SQL auditing system's API.
[0178] In one embodiment of this specification, the interaction parameters are further used to characterize whether the database development tool integrates the SQL auditing system;
[0179] The audit module is used for:
[0180] In response to generating an SQL statement to be executed, and given that the interaction parameters indicate that the database development tool integrates the SQL auditing system, an SQL auditing request is generated using the interaction parameters, and the SQL auditing request is sent to the SQL auditing system.
[0181] In one embodiment of this specification, the audit module is further configured to:
[0182] In response to the generation of an SQL statement to be executed, and the interaction parameters indicating that the database development tool does not integrate the SQL auditing system, the SQL auditing module within the database development tool is used to audit the SQL statement to be executed, and the auditing result is used to process the SQL statement.
[0183] One or more embodiments of this specification also propose a database development tool having parameter templates for configuring interaction parameters for communication with an SQL auditing system.
[0184] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which can take the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email sending and receiving device, game console, tablet computer, wearable device, or any combination of these devices.
[0185] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0186] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0187] Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0188] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0189] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0190] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of one or more embodiments of this specification. The singular forms “a,” “described,” and “the” used in one or more embodiments of this specification and in the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0191] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0192] It should be understood that although the terms first, second, third, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first information may also be referred to as second information without departing from the scope of one or more embodiments of this specification, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "in response to a determination," or "when," or "in the event of a determination."
[0193] The above description is merely a preferred embodiment of one or more embodiments of this specification and is not intended to limit the scope of one or more embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of one or more embodiments of this specification should be included within the protection scope of one or more embodiments of this specification.
Claims
1. A data processing method applied to a database development tool, the database development tool having parameter templates and pre-configured with interactive parameters generated according to the parameter templates for communicating with an SQL auditing system, the SQL auditing system being a system independent of the database development tool, the method comprising: In response to generating an SQL statement to be executed, an SQL review request is generated using the interaction parameters, and the SQL review request is sent to the SQL review system, wherein the SQL review request is configured to request the SQL review system to review the SQL statement to be executed; The system receives the return value of the SQL audit request sent by the SQL audit system, and decodes the return value using the interaction parameters to obtain the audit result of the SQL statement to be executed. The SQL statement is processed based on the audit results.
2. The data processing method according to claim 1, wherein the audit result includes executable and non-executable; The step of processing the SQL statement based on the audit result includes: In response to the audit result being executable, the SQL statement is executed; In response to the audit result being unexecutable, a prompt message is generated, wherein the prompt message is used to indicate that the SQL statement does not have permission to be executed.
3. The data processing method according to claim 1, wherein the review result includes pending approval; The step of processing the SQL statement based on the audit result includes: In response to the audit result being pending approval, a new work order request is generated using the interaction parameters, and the new work order request is sent to the SQL audit system. The new work order request is configured to request the SQL audit system to create a new work order for approving the execution permission of the SQL statement to be executed. The system receives the return value from the SQL audit system in response to the request to create a new work order, and decodes the return value using the interaction parameters to obtain the work order identifier. An approval result retrieval request is generated using the interaction parameters, and the approval result retrieval request is sent to the SQL review system, wherein the approval result retrieval request is configured to request the SQL review system to send the approval result of the approval work order to which the work order identifier belongs; The system receives the return value of the request to obtain the approval result sent by the SQL review system, and decodes the return value using the interaction parameters to obtain the approval result. The SQL statement is processed based on the approval result.
4. The data processing method according to claim 3, wherein generating a new work order request using the interaction parameters includes: Obtain the initiator of the SQL statement to be executed, and generate a new work order request using the interaction parameters and the initiator. The new work order request is configured to request the SQL review system to create a work order for approving whether the initiator has the execution permission for the SQL statement to be executed.
5. The data processing method according to claim 3, wherein the approval result includes pass or fail; The step of processing the SQL statement based on the approval result includes: In response to the approval result being approved, the SQL statement is executed; In response to the approval result being rejected, a prompt message is generated, wherein the prompt message is used to indicate that the SQL statement has not passed the approval.
6. The data processing method according to claim 1, further comprising: The interactive parameters of the database development tool are configured according to the parameter configuration instructions, wherein the parameter configuration instructions are input by the user based on the parameter template of the database development tool and the SQL auditing system.
7. The data processing method according to claim 1 or 6, wherein the interaction parameters include at least one of the following: Parameters used to generate SQL audit requests; An expression used to decode the return value of the SQL audit request; Parameters used to generate a new work order request; An expression used to decode the return value of the new work order request; Parameters used to generate the approval result retrieval request; An expression used to decode the return value of the request for obtaining the approval result.
8. The data processing method according to claim 1 or 6, wherein the interaction parameters include at least one of the following: request method, request address, request header, request parameters, request body format, request body content, whether the request body is encrypted, request body encryption method, request body encryption key, whether the return value is encrypted, return value encryption method, and return value encryption key; in, The request address includes the URL address of the API of the SQL auditing system.
9. The data processing method according to claim 1, wherein the interaction parameters are further used to characterize whether the database development tool integrates the SQL auditing system; The step of responding to the generation of an SQL statement to be executed, generating an SQL audit request using the interaction parameters, and sending the SQL audit request to the SQL audit system includes: In response to generating an SQL statement to be executed, and given that the interaction parameters indicate that the database development tool integrates the SQL auditing system, an SQL auditing request is generated using the interaction parameters, and the SQL auditing request is sent to the SQL auditing system.
10. The data processing method according to claim 1, further comprising: In response to the generation of an SQL statement to be executed, and the interaction parameters indicating that the database development tool does not integrate the SQL auditing system, the SQL auditing module within the database development tool is used to audit the SQL statement to be executed, and the auditing result is used to process the SQL statement.
11. A data processing apparatus applied to a database development tool, the database development tool having parameter templates and pre-configured with interactive parameters generated according to the parameter templates for communicating with an SQL auditing system, the SQL auditing system being a system independent of the database development tool, the apparatus comprising: The request module is used to generate an SQL audit request using the interaction parameters in response to the generation of the SQL statement to be executed, and to send the SQL audit request to the SQL audit system, wherein the SQL audit request is used to request the SQL audit system to audit the SQL statement to be executed; The decoding module is used to receive the return value of the SQL audit request sent by the SQL audit system, and decode the return value using the interaction parameters to obtain the audit result of the SQL statement to be executed; The processing module is used to process the SQL statement based on the audit result.
12. A database development tool, the database development tool having a parameter template for configuring interactive parameters for communication with an SQL auditing system.
13. An electronic device, comprising: processor; Memory used to store processor-executable instructions; The processor implements the method as described in any one of claims 1-10 by executing the executable instructions.
14. A computer-readable storage medium having stored thereon computer instructions that, when executed by a processor, implement the steps of the method as claimed in any one of claims 1-10.