CN117648112A - Code checking method and device for Gaussian database and computer equipment - Google Patents

Code checking method and device for Gaussian database and computer equipment Download PDF

Info

Publication number
CN117648112A
CN117648112A CN202311732101.3A CN202311732101A CN117648112A CN 117648112 A CN117648112 A CN 117648112A CN 202311732101 A CN202311732101 A CN 202311732101A CN 117648112 A CN117648112 A CN 117648112A
Authority
CN
China
Prior art keywords
checking
rule
code
gaussian
database
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311732101.3A
Other languages
Chinese (zh)
Inventor
武琪
曲明钰
姜振东
蔡幸伦
范铮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Life Insurance Co ltd
Original Assignee
China Life Insurance Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Life Insurance Co ltd filed Critical China Life Insurance Co ltd
Priority to CN202311732101.3A priority Critical patent/CN117648112A/en
Publication of CN117648112A publication Critical patent/CN117648112A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present application relates to a code checking method, apparatus, computer device, storage medium and computer program product for a gaussian database. The method comprises the following steps: acquiring code data of a Gaussian database to be detected submitted by a target user; determining a user group to which a target user belongs, acquiring each rule group associated with the user group, and displaying each rule group in a display interface, wherein each rule group comprises at least one Gaussian database code checking rule; determining a target rule set from among the rule sets in response to a selected operation for the target rule set; when a checking instruction aiming at code data to be detected is received, checking the code data of the Gaussian database to be detected according to a preset grammar rule and each Gaussian database code checking rule in a target rule group to obtain a code checking result; and displaying the code checking result in a result display area of the display interface. The method can improve the checking flexibility of the Gaussian code.

Description

Code checking method and device for Gaussian database and computer equipment
Technical Field
The present application relates to the field of database technologies, and in particular, to a code checking method, a code checking device, a code checking computer device, a code checking storage medium and a code checking computer program product for a gaussian database.
Background
The multi-line products of different departments in the enterprise all relate to the development process of the SQL (Structured Query Language, database language) script of data processing. Because different team specifications are different, the specification checking and executing forces are different, the development codes of most SQL scripts are not standard, the annotation is not compliant, the data processing efficiency is poor, the performance factors are not fully considered, and the code walking and testing are not fully performed. Therefore, after the product is frequently upgraded, the data processing efficiency is low, and the logic is messy.
In the related technology, a code checking tool is often adopted for code checking, but the code checking work of the target does not support Gaussian language, and the code checking tool cannot adapt to different code checking requirements under different service scenes, so that the flexibility of the code checking is poor.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a code checking method, apparatus, computer device, computer readable storage medium, and computer program product for a gaussian database with high flexibility.
In a first aspect, the present application provides a code checking method for a gaussian database, the method comprising:
acquiring code data of a Gaussian database to be detected submitted by a target user;
Responding to a selection operation aiming at a target rule group, determining a user group to which the target user belongs, acquiring each rule group associated with the user group, and displaying each rule group in a display interface, wherein the rule group comprises at least one Gaussian database code checking rule;
determining a target rule set from each of the rule sets in response to a selected operation for the target rule set;
when a checking instruction aiming at the code data to be detected is received, checking the code data of the Gaussian database to be detected according to a preset grammar rule and each Gaussian database code checking rule in the target rule group to obtain a code checking result;
and displaying the code checking result in a result display area of the display interface.
In one embodiment, the method further comprises:
determining each item of Gaussian database code verification rule in a rule group in response to configuration operation of a management user on the rule group;
and determining a user group to which the management user belongs, and establishing an association relation between the rule group and the user group to which the management user belongs.
In one embodiment, the checking the code data of the gaussian database to be detected according to a preset grammar rule and each gaussian database code checking rule in the target rule set to obtain a code checking result includes:
According to a preset Gaussian database grammar structure, carrying out grammar structure analysis on the code data of the Gaussian database to be detected to obtain a corresponding target grammar tree;
and matching the target grammar tree with the preset grammar rule and each Gaussian database code checking rule in the target rule group to obtain a code checking result.
In one embodiment, the code checking result includes a quality checking result and a code optimization suggestion, and the checking the code data of the gaussian database to be detected according to a preset grammar rule and each gaussian database code checking rule in the target rule set to obtain a code checking result includes:
performing correctness checking on the code data of the Gaussian database to be detected according to the preset grammar rule to obtain an initial checking result;
according to each Gaussian database code checking rule in the target rule group, carrying out normative checking on the Gaussian database code data to be detected to obtain a normative checking result;
and generating the quality check result according to the initial check result and the normative check result, and generating the code optimization suggestion according to the normative check result.
In one embodiment, the method further comprises:
when the initial checking result represents that error codes exist in the code data of the Gaussian database to be checked, positioning the error codes, and determining a target grammar rule corresponding to the error codes;
and modifying the error code according to the target grammar rule to obtain modified Gaussian database code data to be detected.
In one embodiment, the method further comprises:
generating a check record according to the code check result, and storing the check record;
responding to the checking inquiry operation of the management user for the user group, acquiring the checking records of each user in the user group, generating a user group checking result according to the checking records of each user, and displaying the user group checking result in a display interface.
In a second aspect, the present application further provides a code checking apparatus for a gaussian database, the apparatus comprising:
the acquisition module is used for acquiring code data of the Gaussian database to be detected, which is submitted by a target user;
the first determining module is used for determining a user group to which a target user belongs in response to a selection operation for the target rule group, acquiring each rule group associated with the user group, and displaying each rule group in a display interface, wherein the rule group comprises at least one Gaussian database code checking rule;
A second determining module, configured to determine a target rule group from each rule group in response to a selected operation for the target rule group;
the checking module is used for checking the code data of the Gaussian database to be detected according to a preset grammar rule and each Gaussian database code checking rule in the target rule group when a checking instruction aiming at the code data to be detected is received, so as to obtain a code checking result;
and the display module is used for displaying the code checking result in a result display area of the display interface.
In one embodiment, the apparatus further comprises:
a third determining module, configured to determine each gaussian database code verification rule in a rule set in response to a configuration operation of a management user on the rule set;
and a fourth determining module, configured to determine a user group to which the management user belongs, and establish an association relationship between the rule set and the user group to which the management user belongs.
In one embodiment, the checking module is further configured to:
according to a preset Gaussian database grammar structure, carrying out grammar structure analysis on the code data of the Gaussian database to be detected to obtain a corresponding target grammar tree;
And matching the target grammar tree with the preset grammar rule and each Gaussian database code checking rule in the target rule group to obtain a code checking result.
In one embodiment, the code check result includes a quality check result and a code optimization suggestion, and the check module is further configured to:
performing correctness checking on the code data of the Gaussian database to be detected according to the preset grammar rule to obtain an initial checking result;
according to each Gaussian database code checking rule in the target rule group, carrying out normative checking on the Gaussian database code data to be detected to obtain a normative checking result;
and generating the quality check result according to the initial check result and the normative check result, and generating the code optimization suggestion according to the normative check result.
In one embodiment, the apparatus further comprises:
a fifth determining module, configured to locate an error code when the initial checking result indicates that the code data of the to-be-detected gaussian database has the error code, and determine a target grammar rule corresponding to the error code;
And the correction module is used for correcting the error code according to the target grammar rule to obtain corrected Gaussian database code data to be detected.
In one embodiment, the apparatus further comprises:
the storage module is used for generating a checking record according to the code checking result and storing the checking record;
the processing module is used for responding to the checking inquiry operation of the management user for the user group, acquiring the checking records of each user in the user group, generating a user group checking result according to the checking records of each user, and displaying the user group checking result in a display interface.
In a third aspect, the present application further provides a computer device, including a memory and a processor, the memory storing a computer program, the processor implementing the code checking method for a gaussian database according to any of the above when executing the computer program.
In a fourth aspect, the present application also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements a code checking method for a gaussian database according to any one of the following steps.
In a fifth aspect, the present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the code checking method of any of the above for a gaussian database.
The code checking method, the code checking device, the computer equipment, the storage medium and the computer program product for the Gaussian database can determine the user group to which the target user belongs in response to the selection operation for the target rule group after acquiring the code data of the Gaussian database to be detected submitted by the target user, acquire each rule group associated with the user group, and display each rule group in a display interface, wherein the rule group comprises at least one Gaussian database code checking rule. Further, in response to a selection operation for the target rule group, determining the target rule group from the rule groups, and when a detection instruction for code data to be detected is received, detecting the code data of the Gaussian database according to a preset grammar rule and each Gaussian database code detection rule in the target rule group to obtain a code detection result, and displaying the code detection result in a result display area of a display interface. By adopting the code checking method, the code checking device, the computer equipment, the storage medium and the computer program product for the Gaussian database, which are provided by the embodiment of the disclosure, the code data of the Gaussian database can be checked based on the preset grammar rules and the code checking rules of the Gaussian database in the target rule group by matching the target rule group of the user group corresponding to the target user, the code checking of the Gaussian database language can be supported, the code checking requirements of different business scenes can be met, the checking of various dimensionalities of code correctness and code standardization can be realized, the checking flexibility is high, and the checking result is richer and more accurate.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the related art, the drawings that are required to be used in the embodiments or the related technical descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to the drawings without inventive effort for a person having ordinary skill in the art.
FIG. 1 is a flow diagram of a code checking method for a Gaussian database in one embodiment;
FIG. 2 is a schematic diagram of a display interface in one embodiment;
FIG. 3 is a flow diagram of a code checking method for a Gaussian database in one embodiment;
FIG. 4 is a flow diagram of a code checking method for a Gaussian database in one embodiment;
FIG. 5 is a flow chart of step 108 in one embodiment;
FIG. 6 is a flow chart of step 108 in one embodiment;
FIG. 7 is a flow diagram of a method of code checking for a Gaussian database in one embodiment;
FIG. 8 is a flow diagram of a method of code checking for a Gaussian database in one embodiment;
FIG. 9 is a schematic diagram of a code checking method for a Gaussian database in one embodiment;
FIG. 10 is a schematic diagram of a code checking method for a Gaussian database in one embodiment;
FIG. 11 is a block diagram of a code checking apparatus for a Gaussian database in one embodiment;
fig. 12 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
In one embodiment, as shown in fig. 1, a code checking method for a gaussian database is provided, and this embodiment is exemplified by applying the method to a terminal, it is understood that the method may also be applied to a server, and may also be applied to a system including a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the steps of:
step 102, acquiring code data of a Gaussian database to be detected, which is submitted by a target user.
In the embodiment of the disclosure, a target user can upload code data of a to-be-detected Gaussian database to a checking system in an uploading mode, wherein the code data of the to-be-detected Gaussian database can be SQL sentences of Gaussian language; or directly editing codes in a checking system, wherein the edited code data is the code data of the Gaussian database to be detected.
Step 104, determining a user group to which a target user belongs in response to a selection operation for the target rule group, acquiring each rule group associated with the user group, and displaying each rule group in a display interface, wherein the rule group comprises at least one Gaussian database code checking rule.
In the embodiment of the present disclosure, after a target user submits code data of a to-be-detected gaussian database, the code data of the to-be-detected gaussian database may be displayed in a code display area in a display interface, as shown with reference to fig. 2. The display area outside the code display area can be displayed with a rule group selection control, and the target user can call out the rule group selectable by the target user by triggering the rule group selection control, wherein the rule group can comprise at least one Gaussian database code checking rule which can be used for checking the normalization of the code and can be preset for the system or configured based on the checking requirement of the user.
For example, after detecting the triggering of the rule group selection control by the target user, the user information of the target user may be obtained, the user group to which the target user belongs may be determined based on the user information of the target user, and then each rule group associated with the user group may be determined, that is, the user group may be associated with at least one rule group, each rule group corresponds to a team specification and a specification checking degree, or the user group may not have an associated rule group, that is, the associated rule group is null. Each user within the same user group may perform code checking using each rule set associated with the user group.
After determining the rule sets associated by the user, the rule sets may be presented in a display interface, for example: the rule sets are shown in a drop down box, as shown with reference to fig. 2.
In response to a selected operation for the target rule set, a target rule set is determined from the rule sets, step 106.
In the embodiment of the disclosure, the target user may select any rule group from the rule groups displayed in the display interface, and the terminal responds to the selected operation to take the rule group corresponding to the selected operation as the target rule group.
Step 108, when a checking instruction aiming at code data to be detected is received, checking the code data of the Gaussian database to be detected according to a preset grammar rule and each Gaussian database code checking rule in a target rule group to obtain a code checking result;
and 110, displaying the code checking result in a result display area of the display interface.
In the embodiment of the disclosure, after the selection of the target rule group is completed, the target user can trigger a checking instruction through a checking control in a triggering interface, and further execute checking of code data of the to-be-detected Gaussian database in response to the checking instruction.
In the checking process, checking the code data of the to-be-detected Gaussian database through preset grammar rules and various Gaussian database code checking rules in the target rule group, wherein the preset grammar rules comprise a correct grammar structure of a preset Gaussian database grammar and are used for checking the correctness of the grammar of the code data of the to-be-detected Gaussian database, the various Gaussian database code checking rules in the target rule group are used for checking the code normalization of the code data of the to-be-detected Gaussian database, and after checking the code data of the to-be-detected Gaussian database through the preset grammar rules and the various Gaussian database code checking rules in the target rule group, a final code checking result can be obtained and the code checking result is displayed in a result display area of a display interface.
According to the code checking method for the Gaussian database, after the code data of the Gaussian database to be detected, submitted by the target user, are obtained, user groups to which the target user belongs are determined in response to selection operation for the target rule groups, all rule groups associated with the user groups are obtained, all rule groups are displayed in a display interface, and at least one Gaussian database code checking rule is included in the rule groups. Further, in response to a selection operation for the target rule group, determining the target rule group from the rule groups, and when a detection instruction for code data to be detected is received, detecting the code data of the Gaussian database according to a preset grammar rule and each Gaussian database code detection rule in the target rule group to obtain a code detection result, and displaying the code detection result in a result display area of a display interface. By adopting the code checking method for the Gaussian database, which is provided by the embodiment of the disclosure, the code checking of the Gaussian database to be checked can be carried out on the code data of the Gaussian database based on the preset grammar rule and each Gaussian database code checking rule in the target rule group by matching the target rule group of the user group corresponding to the target user, so that the code checking requirements of the Gaussian database language can be supported, the code checking requirements under different service scenes can be met, the checking of various dimensions of the code correctness and the code standardization can be realized, the checking flexibility is high, and the checking result is richer and more accurate.
In an exemplary embodiment, referring to fig. 3, the method further includes:
step 302, determining each Gaussian database code verification rule in the rule group in response to configuration operation of a management user on the rule group;
step 304, determining the user group to which the management user belongs, and establishing the association relationship between the rule group and the user group to which the management user belongs.
In the embodiment of the disclosure, a responsible person or a manager of the user group can be used as a management user to have configuration authority for the rule group associated with the user group. The management user can perform configuration operation of the rule group associated with the user group through the rule group configuration interface. The management user can trigger a rule group creation control in the rule group configuration interface, display the rule group interface, configure information such as names of rule groups and description of check contents in the rule group interface, select a Gaussian database code check rule in the rule group interface, and meanwhile customize the Gaussian database code check rule to finish the creation of the rule group. And simultaneously, the adjustment operation of the existing rule group is supported, including the operations of deleting, replacing, updating and the like of the Gaussian database code checking rule in the existing rule group, and the deletion operation of the existing rule group is also supported.
After the rule group is created, an association relationship can be established between the rule group and the user group to which the management user belongs, and all subsequent users of the user group can adopt the rule group to carry out code checking, and the relationship between the user and the user group and between the user group and the rule group can be described with reference to fig. 4.
By adopting the code checking method of the Gaussian database, the creation of the rule group and the self-defining of the code checking rule of the Gaussian database can be carried out based on the requirement, and the personalized customization of the code checking can be realized, so that the code checking method can adapt to various requirements in various scenes, and the code checking flexibility is greatly improved.
In an exemplary embodiment, referring to fig. 5, in step 108, checking the code data of the gaussian database to be checked according to the preset grammar rule and each gaussian database code checking rule in the target rule set to obtain a code checking result, including:
step 502, according to a preset grammar structure of a Gaussian database, carrying out grammar structure analysis on code data of the Gaussian database to be detected to obtain a corresponding target grammar tree;
and step 504, matching the target grammar tree with the preset grammar rules and each Gaussian database code checking rule in the target rule group to obtain a code checking result.
In the embodiment of the disclosure, a gaussian database grammar structure can be preset in a system, and each code segment in the code data of the gaussian database to be detected is matched with the gaussian database grammar structure to form a complete target grammar tree. The corresponding target nodes can be searched from the target grammar tree based on the preset grammar rules and the Gaussian database code checking rules in the target rule group, and the target nodes are matched with the corresponding preset grammar rules and the Gaussian database code checking rules in the target rule group to determine whether the corresponding rules are met or not, so that a code checking result is obtained.
In an exemplary embodiment, the code checking result includes a quality checking result and a code optimization suggestion, referring to fig. 6, in step 108, checking code data of the gaussian database to be checked according to a preset grammar rule and each gaussian database code checking rule in the target rule set to obtain a code checking result, including:
step 602, checking the correctness of code data of a to-be-detected Gaussian database according to a preset grammar rule to obtain an initial checking result;
step 604, according to each Gaussian database code checking rule in the target rule group, performing normalization checking on the code data of the Gaussian database to be checked to obtain normalization checking results;
And step 606, generating a quality check result according to the initial check result and the normative check result, and generating a code optimization suggestion according to the normative check result.
In the embodiment of the disclosure, correctness checking can be performed on code data of a to-be-detected Gaussian database through a preset grammar rule to obtain an initial checking result, wherein the initial checking result can comprise code data with grammar errors and corresponding grammar rules, and if the code data of the to-be-detected Gaussian database passes through the detection of the preset grammar rule and no grammar errors exist, the initial checking result comprises preset information which can be used for describing that codes have no grammar errors.
Further, according to each item of gaussian database code checking rules in the target rule set, the to-be-detected gaussian database code data can be subjected to normative checking to obtain a normative checking result, the normative checking result can comprise normative checking scores, non-normative code data and corresponding gaussian database code checking rules, and if the to-be-detected gaussian database code data passes through the detection of the target rule set, the codes completely meet the normative requirements, preset information can be included in the normative checking result, and the preset information can be used for describing the irregular normative of the codes.
After the initial checking result and the normative checking result are obtained, a final quality checking result can be generated based on the initial checking result and the normative checking result, and the quality checking result can be combined with code correctness and code normative to describe code quality. For example, when an initial checking result is generated, when a grammar error occurs, a corresponding score may be determined based on the level of the grammar error, the scores of the grammar error occurring are accumulated, when the accumulated score reaches a preset score, the accumulation may be stopped, and the final quality checking result may be directly determined to be unqualified.
Alternatively, after the grammar checking is completed, if the error score does not reach the preset score, a final quality checking result may be determined in combination with the normative checking result, for example: the number of codes that do not meet the code normalization requirement (the number of code lines may be counted), and the score may be determined based on the number of codes, and the score may be positively correlated with the number of codes, i.e., the greater the number of codes that do not meet the code normalization requirement, the higher the score. And the error score and the score can be weighted and summed, the higher the score is, the higher the corresponding weight is, so that the final quality check score is obtained, the final quality check result can be obtained based on the final quality check score, and the higher the final quality check score is, the worse the data quality of the Gaussian database code to be detected, which is characterized by the final quality check result is.
After the normative checking result is obtained, a code optimization suggestion may be generated based on the normative checking result, for example: the Gaussian database code checking rule requires that the minimum code indentation distance is 2 spaces, and if the normalization checking result shows that the code field indentation distance is 1 space in the code, a corresponding code optimization suggestion can be generated based on the Gaussian database code checking rule: the code is set back a minimum distance of 2 spaces.
After the code optimization suggestion and the final quality inspection result are obtained, the final quality inspection result can be displayed in a result display area, and the code optimization suggestion can be displayed in an optimization suggestion display area in the result display area.
By adopting the code checking method for the Gaussian database, which is provided by the embodiment of the disclosure, the quality checking result and the code optimization suggestion can be obtained, the quality detection can be realized, the code optimization suggestion can be given, the user can perform code optimization based on the code optimization suggestion, the working efficiency can be improved, and meanwhile, the code performance is greatly improved.
In an exemplary embodiment, referring to fig. 7, the method may further include:
Step 702, when the initial checking result represents that error codes exist in the code data of the Gaussian database to be detected, positioning the error codes, and determining a target grammar rule corresponding to the error codes;
and step 704, modifying the error codes according to the target grammar rules to obtain modified Gaussian database code data to be detected.
In the embodiment of the disclosure, when the initial checking result represents that the error code exists in the code data of the Gaussian database to be detected, the error code is positioned according to the initial checking result, a target grammar rule corresponding to the error code is determined, and grammar errors of the error code are automatically corrected according to the target grammar rule, so that the code data of the Gaussian database to be detected after modification can be obtained.
For example, in locating an error code, the error code may be marked with a special mark in the code presentation area, such as: is displayed in red font. The result display area can comprise a correction control, the grammar of the error code can be automatically corrected by triggering the correction control, and the corrected correction position can be marked by special marks, such as: and displaying by adopting yellow fonts.
By adopting the code checking method for the Gaussian database, which is provided by the embodiment of the disclosure, the grammar error of the code data of the Gaussian database to be detected can be automatically repaired, and the code development efficiency can be greatly improved.
In an exemplary embodiment, referring to fig. 8, the method further includes:
step 802, generating a checking record according to a code checking result, and storing the checking record;
step 804, responding to the checking inquiry operation of the management user for the user group, obtaining the checking records of each user in the user group, generating the user group checking result according to the checking records of each user, and displaying the user group checking result in the display interface.
In the embodiment of the disclosure, after the code checking result is generated, a checking record may be generated based on the code checking result, the target user, the user group, the checking time and other information, and the checking record may be stored in the checking table.
The administrative user may view the check records for each user within the user group, for example: and inputting the user group, acquiring the check records of the users in the user group, generating a user group check result according to the check records of the users, and displaying the user group check result. For example: statistical analysis may be performed based on the checkrecords, including: the number of times of checking each user, the distribution of checking time, the distribution of quality, etc. The management user can also directly query the checking record of a certain user, and the grouping checking result and the query mode of the user are not particularly limited in the embodiment of the disclosure.
By adopting the code checking method for the Gaussian database, which is provided by the embodiment of the disclosure, grouping checking can be realized, and the summarizing efficiency of checking results can be greatly improved.
In order for those skilled in the art to better understand the disclosed embodiments, the disclosed embodiments are described below by way of specific examples.
The embodiment of the disclosure can be divided into a checking background and a management platform. The checking platform provides SQL code checking and correcting functions, and the management platform is a foreground interactive webpage for user configuration. The overall platform architecture may be as shown with reference to fig. 9.
The inspection background is developed by using Python language and is divided into an analysis engine, an inspection engine and a repair engine. And presetting a Gaussian database SQL language grammar structure in an analysis engine, and matching the code segments with the grammar structure in the analysis engine to form a complete grammar tree. Aiming at the problem that the rule cannot be customized (for example, a specific code composition specification specified by a team), a user can write a configurable rule based on a complete grammar tree, compare the grammar tree structure with a set rule structure in a checking engine, give optimization suggestions for SQL grammar and format and score the code quality. And automatically repairing the corresponding problems in the repairing engine and giving a repairing record.
Referring to fig. 10, the checkpost provides an interface using a flash framework (a lightweight Web application framework written using Python), performs process management using Gunicorn (WSGI HTTP server under UNIX), performs reverse proxy using ngginx (reverse proxy server), and is deployed on PaaS (Platform as a Service ) platform through a Docker container, and the open interface is used for SQL quality management platform and other platforms. The interface includes SQL language, code, selected rules and configuration file, and the returned results include checking pass/fail, code quality scoring, code problem location and description, code suggestion modification format, etc.
In the embodiment of the disclosure, a management platform uses a Java language and EUK (service discovery framework) framework to complete back-end logic development, a polar db (polar coordinate database) database is adopted at the bottom layer to manage user information, rule lists and call logs, a TypeScript language, a vue3.0 framework and an ElementUI Plus component library are adopted to complete front-end page development, a user can view a rule list and an internal meaning thereof provided by the platform at present, configure rules required to be used as rule groups on the visualization platform, upload files or carry out code editing on a simple IDE (Integrated Development Environment ) provided by the platform, click a "check" button, call an interface provided by a check background to execute code check and automatic restoration, and an administrator user can set a global rule group and monitor check execution history conditions and code quality scores of other users.
By adopting the code checking method for the Gaussian database, which is provided by the embodiment of the disclosure, the checking background can identify all Gaussian database grammar, and the user can customize grammar rules. Meanwhile, a management platform and an interactable page are provided, and users can be managed and controlled by taking groups as granularity.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a code checking device for the Gaussian database, which is used for realizing the code checking method for the Gaussian database. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in one or more embodiments of the code checking device for a gaussian database provided below may refer to the limitation of the code checking method for a gaussian database, which is not described herein.
In an exemplary embodiment, as shown in fig. 11, there is provided a code checking apparatus for a gaussian database, including: an acquisition module 1102, a first determination module 1104, a second determination module 1106, a check module 1108, and a presentation module 1110, wherein:
an obtaining module 1102, configured to obtain code data of a gaussian database to be detected submitted by a target user;
a first determining module 1104, configured to determine, in response to a selection operation for a target rule group, a user group to which the target user belongs, obtain rule groups associated with the user group, and display each rule group in a display interface, where the rule groups include at least one gaussian database code checking rule;
A second determining module 1106, configured to determine a target rule group from each rule group in response to a selection operation for the target rule group;
the checking module 1108 is configured to, when receiving a checking instruction for the code data to be detected, check the code data of the gaussian database to be detected according to a preset grammar rule and each gaussian database code checking rule in the target rule set, so as to obtain a code checking result;
and a display module 1110, configured to display the code checking result in a result display area of the display interface.
By adopting the code checking device for the Gaussian database, which is provided by the embodiment of the disclosure, the code checking of the Gaussian database to be checked can be carried out on the code data of the Gaussian database based on the preset grammar rule and each Gaussian database code checking rule in the target rule group by matching the target rule group of the user group corresponding to the target user, so that the code checking requirements of the Gaussian database language can be supported, the code checking requirements under different service scenes can be met, the checking of various dimensions of the code correctness and the code standardization can be realized, the checking flexibility is high, and the checking result is richer and more accurate.
In one embodiment, the apparatus further comprises:
a third determining module, configured to determine each gaussian database code verification rule in a rule set in response to a configuration operation of a management user on the rule set;
and a fourth determining module, configured to determine a user group to which the management user belongs, and establish an association relationship between the rule set and the user group to which the management user belongs.
In one embodiment, the checking module is further configured to:
according to a preset Gaussian database grammar structure, carrying out grammar structure analysis on the code data of the Gaussian database to be detected to obtain a corresponding target grammar tree;
and matching the target grammar tree with the preset grammar rule and each Gaussian database code checking rule in the target rule group to obtain a code checking result.
In one embodiment, the code check result includes a quality check result and a code optimization suggestion, and the check module is further configured to:
performing correctness checking on the code data of the Gaussian database to be detected according to the preset grammar rule to obtain an initial checking result;
according to each Gaussian database code checking rule in the target rule group, carrying out normative checking on the Gaussian database code data to be detected to obtain a normative checking result;
And generating the quality check result according to the initial check result and the normative check result, and generating the code optimization suggestion according to the normative check result.
In one embodiment, the apparatus further comprises:
a fifth determining module, configured to locate an error code when the initial checking result indicates that the code data of the to-be-detected gaussian database has the error code, and determine a target grammar rule corresponding to the error code;
and the correction module is used for correcting the error code according to the target grammar rule to obtain corrected Gaussian database code data to be detected.
In one embodiment, the apparatus further comprises:
the storage module is used for generating a checking record according to the code checking result and storing the checking record;
the processing module is used for responding to the checking inquiry operation of the management user for the user group, acquiring the checking records of each user in the user group, generating a user group checking result according to the checking records of each user, and displaying the user group checking result in a display interface.
The above-described respective modules in the code checking apparatus for gaussian database may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In an exemplary embodiment, a computer device, which may be a terminal, is provided, and an internal structure thereof may be as shown in fig. 12. The computer device includes a processor, a memory, an input/output interface, a communication interface, a display unit, and an input means. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a code checking method for a gaussian database. The display unit of the computer device is used for forming a visual picture, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be a key, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 12 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In an embodiment, there is also provided a computer device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the method embodiments described above when the computer program is executed.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, carries out the steps of the method embodiments described above.
In an embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
It should be noted that, the user information (including, but not limited to, user equipment information, user personal information, etc.) and the data (including, but not limited to, data for analysis, stored data, presented data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use, and processing of the related data are required to meet the related regulations.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the various embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the various embodiments provided herein may include at least one of relational databases and non-relational databases. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic units, quantum computing-based data processing logic units, etc., without being limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples only represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application shall be subject to the appended claims.

Claims (10)

1. A code checking method for a gaussian database, the method comprising:
acquiring code data of a Gaussian database to be detected submitted by a target user;
responding to a selection operation aiming at a target rule group, determining a user group to which the target user belongs, acquiring each rule group associated with the user group, and displaying each rule group in a display interface, wherein the rule group comprises at least one Gaussian database code checking rule;
Determining a target rule set from each of the rule sets in response to a selected operation for the target rule set;
when a checking instruction aiming at the code data to be detected is received, checking the code data of the Gaussian database to be detected according to a preset grammar rule and each Gaussian database code checking rule in the target rule group to obtain a code checking result;
and displaying the code checking result in a result display area of the display interface.
2. The method according to claim 1, wherein the method further comprises:
determining each item of Gaussian database code verification rule in a rule group in response to configuration operation of a management user on the rule group;
and determining a user group to which the management user belongs, and establishing an association relation between the rule group and the user group to which the management user belongs.
3. The method of claim 1, wherein the checking the code data of the gaussian database to be detected according to the preset grammar rule and each gaussian database code checking rule in the target rule set to obtain a code checking result comprises:
according to a preset Gaussian database grammar structure, carrying out grammar structure analysis on the code data of the Gaussian database to be detected to obtain a corresponding target grammar tree;
And matching the target grammar tree with the preset grammar rule and each Gaussian database code checking rule in the target rule group to obtain a code checking result.
4. A method according to any one of claims 1 to 3, wherein the code checking result includes a quality checking result and a code optimization suggestion, and the checking the code data of the gaussian database to be detected according to a preset grammar rule and each gaussian database code checking rule in the target rule set to obtain a code checking result includes:
performing correctness checking on the code data of the Gaussian database to be detected according to the preset grammar rule to obtain an initial checking result;
according to each Gaussian database code checking rule in the target rule group, carrying out normative checking on the Gaussian database code data to be detected to obtain a normative checking result;
and generating the quality check result according to the initial check result and the normative check result, and generating the code optimization suggestion according to the normative check result.
5. The method according to claim 4, wherein the method further comprises:
When the initial checking result represents that error codes exist in the code data of the Gaussian database to be checked, positioning the error codes, and determining a target grammar rule corresponding to the error codes;
and modifying the error code according to the target grammar rule to obtain modified Gaussian database code data to be detected.
6. The method according to claim 1, wherein the method further comprises:
generating a check record according to the code check result, and storing the check record;
responding to the checking inquiry operation of the management user for the user group, acquiring the checking records of each user in the user group, generating a user group checking result according to the checking records of each user, and displaying the user group checking result in a display interface.
7. A code checking apparatus for a gaussian database, the apparatus comprising:
the acquisition module is used for acquiring code data of the Gaussian database to be detected, which is submitted by a target user;
the first determining module is used for determining a user group to which a target user belongs in response to a selection operation for the target rule group, acquiring each rule group associated with the user group, and displaying each rule group in a display interface, wherein the rule group comprises at least one Gaussian database code checking rule;
A second determining module, configured to determine a target rule group from each rule group in response to a selected operation for the target rule group;
the checking module is used for checking the code data of the Gaussian database to be detected according to a preset grammar rule and each Gaussian database code checking rule in the target rule group when a checking instruction aiming at the code data to be detected is received, so as to obtain a code checking result;
and the display module is used for displaying the code checking result in a result display area of the display interface.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
CN202311732101.3A 2023-12-16 2023-12-16 Code checking method and device for Gaussian database and computer equipment Pending CN117648112A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311732101.3A CN117648112A (en) 2023-12-16 2023-12-16 Code checking method and device for Gaussian database and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311732101.3A CN117648112A (en) 2023-12-16 2023-12-16 Code checking method and device for Gaussian database and computer equipment

Publications (1)

Publication Number Publication Date
CN117648112A true CN117648112A (en) 2024-03-05

Family

ID=90047656

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311732101.3A Pending CN117648112A (en) 2023-12-16 2023-12-16 Code checking method and device for Gaussian database and computer equipment

Country Status (1)

Country Link
CN (1) CN117648112A (en)

Similar Documents

Publication Publication Date Title
US11093521B2 (en) Just-in-time data quality assessment for best record creation
CN102004752A (en) Flexible cube data warehousing
CN110221959B (en) Application program testing method, device and computer readable medium
CN114490375B (en) Performance test method, device, equipment and storage medium of application program
CN114049631A (en) Data labeling method and device, computer equipment and storage medium
CN111309586A (en) Command testing method, device and storage medium thereof
US20220374345A1 (en) Techniques for similarity determination across software testing configuration data entities
CN113342434A (en) Visualization method and device for display occupation of display object
CN116610583A (en) SCA tool maturity evaluation method, SCA tool maturity evaluation device, SCA tool maturity evaluation equipment, SCA tool maturity evaluation medium and SCA tool maturity evaluation product
CN117648112A (en) Code checking method and device for Gaussian database and computer equipment
CN115310011A (en) Page display method and system and readable storage medium
CN115203300A (en) Data verification method and device
CN114327377B (en) Method and device for generating demand tracking matrix, computer equipment and storage medium
CN116541454B (en) Event configuration method, device, computer equipment and storage medium
CN114677186B (en) Offer calculation method and device for financial product, computer equipment and storage medium
CN117522296A (en) Auditing flow generation method, auditing flow generation device, computer equipment and storage medium
CN117331812A (en) Service code verification method, device, computer equipment, storage medium and product
CN116701178A (en) Interface test method, device, computer equipment and storage medium
CN117743443A (en) Data acquisition method and device, electronic equipment and storage medium
CN115437935A (en) Test case generation method and device, computer equipment and storage medium
CN117555955A (en) Data conversion method, data conversion device, computer device, and storage medium
CN117592757A (en) Report data processing method, device, computer equipment and storage medium
CN115964062A (en) Application cloud deployment method, device, equipment, storage medium and program product
CN116049009A (en) Test method, test device, computer equipment and computer readable storage medium
CN114924964A (en) Software testing method and device and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination