CN116820482A - Coding error-reporting positioning method, device, equipment, storage medium and program product - Google Patents

Coding error-reporting positioning method, device, equipment, storage medium and program product Download PDF

Info

Publication number
CN116820482A
CN116820482A CN202310785869.0A CN202310785869A CN116820482A CN 116820482 A CN116820482 A CN 116820482A CN 202310785869 A CN202310785869 A CN 202310785869A CN 116820482 A CN116820482 A CN 116820482A
Authority
CN
China
Prior art keywords
error
compiling
stored procedure
code
stored
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
CN202310785869.0A
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202310785869.0A priority Critical patent/CN116820482A/en
Publication of CN116820482A publication Critical patent/CN116820482A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Stored Programmes (AREA)

Abstract

The disclosure provides a compiling error-reporting positioning method, relates to the technical field of databases, and can be applied to the technical field of finance. The method comprises the following steps: compiling the target stored procedure code in response to the stored procedure code compiling instruction; after determining to generate the compiling error reporting information, annotating the stored process code according to the compiling error reporting information and the stored process number; performing secondary compiling on the annotated stored procedure code to reduce the annotation range of the stored procedure code; and repeating the annotation compilation operation until a stored procedure error statement is determined. The disclosure also provides a compiling error locating device, equipment, a storage medium and a program product.

Description

Coding error-reporting positioning method, device, equipment, storage medium and program product
Technical Field
The present disclosure relates to the field of database technologies, and in particular, to the field of database migration technologies, and more particularly, to a method, an apparatus, a device, a storage medium, and a program product for coding and error reporting positioning.
Background
In the signal creation transformation, a large number of codes are stored process codes in a traditional database, the stored process of the traditional database is migrated to a domestic novel database for compiling, debugging and running through tools and manual rewriting, but the domestic novel database has a storage process compiling function because of the problems of development period and the like, error reporting information is not accurate enough, for example, tens of stored processes contained in a storage process are compiled in the database together, the error reporting may not provide line numbers, suggested keywords may be searched for hundreds in the package, and specific positions cannot be clearly located. Often, an experienced technician is required to manually check, and a problem is analyzed and positioned from half a day to one day, and a storage process package may have a plurality of compiling errors in the migration process, so that the workload of a developer in the process of trafficking and transformation of the storage process is greatly increased, and the engineering period is influenced.
It should be noted that the information disclosed in the above background section is only for enhancing understanding of the background of the present disclosure and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
In view of the foregoing, the present disclosure provides a coding error localization method, apparatus, device, storage medium, and program product for improving database migration efficiency.
According to a first aspect of the present disclosure, there is provided a compiling error-reporting positioning method, the method comprising:
compiling the target stored procedure code in response to the stored procedure code compiling instruction;
after determining to generate the compiling error reporting information, annotating the stored process code according to the compiling error reporting information and the stored process number;
performing secondary compiling on the annotated stored procedure code to reduce the annotation range of the stored procedure code; and
the annotation compilation operation is repeated until it is determined to store the procedure error statement.
According to an embodiment of the present disclosure, further comprising:
recompilation is carried out on the code annotated by the error reporting statement in the storage process until no error reporting information exists in the storage process;
recording the error-reporting storage process name, the error-reporting statement initial line number, the error-reporting statement content, the error-reporting keyword and the compiling time stamp into an error information table; and
And outputting the error information table.
According to an embodiment of the present disclosure, the annotating stored procedure code according to compiled error-reporting information and stored procedure number includes:
determining the error reporting statement line number and the total number of storage processes before the error reporting statement line number according to the compiling error reporting information; and
and annotating half of the stored procedure codes of the total number of the stored procedures according to a halving principle.
According to an embodiment of the disclosure, the performing the second compiling on the annotated stored procedure code to reduce the annotation range of the stored procedure code includes:
performing secondary compiling on the annotated stored procedure code;
if the compiling is successful, determining that the storage process error report statement is in the annotated half of the storage process codes; and
if the error is compiled, it is determined that the stored procedure error statement is in the stored procedure code that is not annotated.
According to an embodiment of the present disclosure, before compiling the target stored procedure code, further comprising:
and generating a target stored procedure code according to the stored procedure package of the source database.
According to an embodiment of the present disclosure, the generating the stored procedure code from the stored procedure package of the source database includes:
acquiring codes and definitions of a source database storage process;
Converting code and definition of the source database storage process; and
a line number is added to the converted code to generate a target stored procedure code.
A second aspect of the present disclosure provides a coding error localization apparatus, the apparatus comprising:
the first compiling module is used for compiling the target stored process code in response to the stored process code compiling instruction;
the annotation module is used for annotating the stored process codes according to the compiled error reporting information and the stored process number after determining to generate the compiled error reporting information;
the second compiling module is used for performing secondary compiling on the annotated stored procedure codes so as to reduce the annotation range of the stored procedure codes; and
and the first error reporting and positioning module is used for repeating the annotation compiling operation until the error reporting statement in the storage process is determined.
According to an embodiment of the present disclosure, the apparatus further comprises: the system comprises a second error reporting and positioning module, a recording module and an output module.
The second error reporting positioning module is used for recompiling the code annotated by the error reporting statement in the storage process until no error reporting information exists in the storage process;
the recording module is used for recording the error-reporting storage process name, the error-reporting statement initial line number, the error-reporting statement content, the error-reporting keyword and the compiling time stamp into an error information table; and
And the output module is used for the error information table.
According to an embodiment of the present disclosure, the annotation module comprises: a first determination sub-module and an annotation sub-module.
The first determining submodule is used for determining the error reporting statement line number and the total number of storage processes before the error reporting statement line number according to the compiling error reporting information; and
and the annotating sub-module is used for annotating half of the stored procedure codes of the total number of the stored procedures according to the halving principle.
According to an embodiment of the present disclosure, the second compiling module includes: the second determination sub-module is configured to determine a second determination sub-module.
The secondary compiling sub-module is used for performing secondary compiling on the annotated stored process codes;
the second determining submodule is used for determining that the storage process error report statement is in the annotated half of the storage process codes if the compiling is successful; and
and a third determining sub-module, configured to determine that the stored procedure error statement is in the stored procedure code that is not annotated if the compiling is error-reporting.
According to an embodiment of the present disclosure, before the first compiling module compiles the target stored procedure code, further comprising: and the target storage process code generation module.
And the target stored procedure code generating module is used for generating the target stored procedure code according to the stored procedure packet of the source database.
According to an embodiment of the present disclosure, the object storage process code generation module includes: the device comprises an acquisition sub-module, a conversion sub-module and a generation sub-module.
The acquisition sub-module is used for acquiring codes and definitions of the storage process of the source database;
a conversion sub-module for converting codes and definitions of the source database storage process; and
and the generation sub-module is used for adding a line number to the converted code to generate the target storage process code.
A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the above-described compile-error localization method.
A fourth aspect of the present disclosure also provides a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the above-described compile-error localization method.
A fifth aspect of the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor, implements the above-described compile-error localization method.
According to the compiling error-reporting positioning method provided by the embodiment of the disclosure, after a compiling instruction of a stored process code is received, a target stored process code is compiled; after determining to generate the compiling error reporting information, annotating the stored process code according to the compiling error reporting information and the stored process number; performing secondary compiling on the annotated stored procedure code to reduce the annotation range of the stored procedure code; and repeating the annotation compilation operation until a stored procedure error statement is determined. Compared with the compiling and error reporting positioning method in the related art, the compiling and error reporting positioning method provided by the embodiment of the disclosure can quickly and accurately position the storage process name of the error reporting and the line number of the error reporting statement level, and improves the development efficiency.
Drawings
The foregoing and other objects, features and advantages of the disclosure will be more apparent from the following description of embodiments of the disclosure with reference to the accompanying drawings, in which:
FIG. 1 schematically illustrates an architecture diagram of a compiled error-locating device in accordance with an embodiment of the present disclosure;
FIG. 2 schematically illustrates application scenario diagrams of a compile-error localization method, apparatus, device, storage medium and program product according to embodiments of the present disclosure;
FIG. 3 schematically illustrates a flow chart of a method for coding error localization according to an embodiment of the present disclosure;
FIG. 4a schematically illustrates one of the flowcharts of a method for coding error localization according to another embodiment of the present disclosure;
FIG. 4b schematically illustrates a second flowchart of a method for coding error localization according to another embodiment of the present disclosure;
FIG. 5 schematically illustrates a flow chart of a stored procedure code annotation method provided according to another embodiment of the disclosure;
FIG. 6 schematically illustrates a flow chart of a method for coding error localization according to yet another embodiment of the present disclosure;
FIG. 7 schematically illustrates a flow chart of a method for coding error localization according to another embodiment of the present disclosure;
FIG. 8 schematically illustrates a block diagram of a compiled error-locating device in accordance with an embodiment of the present disclosure;
fig. 9 schematically illustrates a block diagram of an electronic device adapted to implement a compiled error-localization method in accordance with an embodiment of the disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is only exemplary and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and/or the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein should be construed to have meanings consistent with the context of the present specification and should not be construed in an idealized or overly formal manner.
Where expressions like at least one of "A, B and C, etc. are used, the expressions should generally be interpreted in accordance with the meaning as commonly understood by those skilled in the art (e.g.," a system having at least one of A, B and C "shall include, but not be limited to, a system having a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
The terms appearing in the embodiments of the present disclosure will first be explained:
the storage process comprises the following steps: a stored procedure is a set of sentences stored in a database system that can perform a specific function, and the stored procedure is called again after the first compilation without need of recompilation, and the user can run the stored procedure by making the name of the stored procedure.
In the process of trafficking and transformation, the following disadvantages exist due to the fact that the domestic novel database stores the process of compiling and reporting errors:
1) The compiling error reporting and error reporting position is inaccurate, which statement can not be determined specifically, although the statement has the prompting keywords, hundreds of identical keywords can exist in the storage process package, the statement can not be positioned to the specific position definitely, the statement can only be checked manually by experienced technicians, high requirements are provided for personnel qualification, and the quick popularization of database transformation is not facilitated;
2) Because the error reporting position is inaccurate, a great number of suspicious points need to be removed, and one compiling error reporting problem is analyzed and positioned from half a day to one day, the workload is large, and the human resource investment is large;
3) Each time the compiling can only find one error, the compiling is stopped, the current error needs to be modified to find the next error, and the working efficiency is low.
Based on the technical problems, an embodiment of the present disclosure provides a compiling error-reporting positioning method, which includes: compiling the target stored procedure code in response to the stored procedure code compiling instruction; after determining to generate the compiling error reporting information, annotating the stored process code according to the compiling error reporting information and the stored process number; performing secondary compiling on the annotated stored procedure code to reduce the annotation range of the stored procedure code; and repeating the annotation compilation operation until a stored procedure error statement is determined.
Fig. 1 schematically illustrates an architecture diagram of a compiled error-locating device according to an embodiment of the disclosure. As shown in fig. 1, a coding error-reporting positioning device provided in an embodiment of the present disclosure includes: the system comprises a traditional database A1, a stored procedure code and definition extraction conversion unit A2, a stored procedure compiling processing unit A3, a domestic novel database A4, a compiling information storage unit A5, a compiling result output unit A6 and a version management unit A7. The traditional database A1 refers to a traditional classical database, such as Oracle, and the like, and is widely used in the financial industry after long-term grinding of various global application scenes. The stored procedure code and definition extraction conversion unit A2 is responsible for deriving the code and definition of the stored procedure of the traditional database A1, and then converting the code and definition into the code and definition conforming to the syntax of the novel database A4, the number of stored procedure lines of one traditional database A1 instance often has millions, up to tens of millions, a single stored procedure package (the stored procedure package is a collection of a plurality of related stored procedures, similar to the relationship of JAVA CLASS and method), often has tens of thousands of lines of codes, and dozens of stored procedures need to be compiled together.
The stored procedure compiling processing unit A3 is responsible for storing the stored procedure codes and the stored procedure source codes output by the definition extraction conversion unit A2 into the compiling information storage unit A5, marking the stored procedure source codes as converted version 1, annotating each row of codes on the basis of the version 1, and adding unique marks in the annotates for marking the stored procedure row numbers to generate compiling intermediate temporary codes. The novel database A4 refers to a domestic database with autonomous controllability, is superior to the traditional database in development prospect, but has a certain gap in partial usability scenes, such as inaccurate compiling and error reporting position in a storage process, and only reports the first error encountered in one-time compiling. The compiling information storing unit A5 stores compiling related information including a storing process package name, a version 1 (not annotated with a line number), a version 2 (annotated with a line number), compiling a reporting error storing process package name, a storing process name, a reporting error sentence content, a reporting error keyword, a compiling occurrence time stamp, and the like. Itself may be a database, and if a distributed storage system is used for storing more data. The compiling result output unit A6 sends the compiling information provided by the storing process compiling processing unit A3 to the relevant developer by means of mail or the like, the developer modifies the compiling error relevant point, and the version 1 (un-annotated version number) code is stored in the version management unit A7. The version management unit A7 is used for finally saving a unit storing the process package definition code.
Fig. 2 schematically illustrates an application scenario diagram of a coding error localization method, apparatus, device, storage medium and program product according to an embodiment of the disclosure.
As shown in fig. 2, the application scenario 200 according to this embodiment may include a compiled error localization scenario. The network 204 is the medium used to provide communication links between the terminal devices 201, 202, 203 and the server 205. The network 204 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 205 via the network 204 using the terminal devices 201, 202, 203 to receive or send messages or the like. Various communication client applications, such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only) may be installed on the terminal devices 201, 202, 203.
The terminal devices 201, 202, 203 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 205 may be a compiling and error reporting positioning server, which is configured to compile the converted stored procedure packet, execute the compiling and error reporting positioning method provided by the embodiment of the present disclosure when compiling and error reporting occurs, perform positioning and collection of error reporting statement codes, and output an error information table.
It should be noted that the method for locating a coding error provided by the embodiments of the present disclosure may be generally performed by the server 205. Accordingly, the coding error locator provided by the embodiments of the present disclosure may be generally disposed in the server 205. The compiled error-localization method provided by the embodiments of the present disclosure may also be performed by a server or a cluster of servers that are different from the server 205 and that are capable of communicating with the terminal devices 201, 202, 203 and/or the server 205. Accordingly, the coding error localization apparatus provided by the embodiments of the present disclosure may also be provided in a server or a server cluster that is different from the server 205 and is capable of communicating with the terminal devices 201, 202, 203 and/or the server 205.
It should be understood that the number of terminal devices, networks and servers in fig. 2 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
It should be noted that, the method and the device for locating the coding and reporting errors determined by the embodiments of the present disclosure may be used in the technical field of cloud computing, or may be used in the technical field of finance, or may be used in any field other than the financial field, and the application field of the method and the device for locating the coding and reporting errors determined by the embodiments of the present disclosure is not limited.
The compiling error locating method according to the embodiment of the disclosure will be described in detail below by using fig. 3 to 7 based on the system architecture described in fig. 1 and the application scenario described in fig. 2.
Fig. 3 schematically illustrates a flowchart of a method for coding error localization according to an embodiment of the present disclosure. As shown in fig. 3, the method for locating a coding error in this embodiment includes operations S210 to S240, and the method may be performed by a server or other computing device.
In operation S210, the target stored procedure code is compiled in response to the stored procedure code compiling instruction.
After determining that the compiled error-reporting information is generated, the stored procedure code is annotated according to the compiled error-reporting information and the stored procedure number in operation S220.
In operation S230, the annotated stored procedure code is secondarily compiled to narrow the annotation range of the stored procedure code.
In operation S240, the annotation compilation operation is repeated until it is determined to store a procedure error statement.
In one example, the application scenario of the embodiment of the disclosure is a compiling scenario of a storage process package of a novel domestic database, the target storage process code is obtained by converting a conventional database, due to the limitation of the novel database, in the converting process, the condition that the compiling has error reporting may be caused, due to the fact that the error reporting information is compiled and the error reporting statement cannot be accurately identified, and one storage process package includes a plurality of storage processes, each storage process may include hundreds of thousands of lines of codes, and the database storage process compiling error reporting positioning is difficult.
In one example, to enable quick localization of error-reporting statements. And after determining to generate the compiling error reporting information, annotating the stored process code according to the compiling error reporting information and the stored process number. And performing secondary compiling on the annotated stored process codes, and further reducing the annotation range of the stored process codes according to the compiling error reporting information, namely further reducing the range of error reporting sentences. Through the annotation compiling operation until the compiling is not error-reporting, the storage process name where the error-reporting statement is located in the storage process and the specific error-reporting statement content can be determined.
According to the compiling error-reporting positioning method provided by the embodiment of the disclosure, after a compiling instruction of a stored process code is received, a target stored process code is compiled; after determining to generate the compiling error reporting information, annotating the stored process code according to the compiling error reporting information and the stored process number; performing secondary compiling on the annotated stored procedure code to reduce the annotation range of the stored procedure code; and repeating the annotation compilation operation until a stored procedure error statement is determined. The compiling error-reporting positioning method provided by the embodiment of the disclosure can rapidly and accurately position the error-reporting storage process name and the error-reporting statement level line number, and improves the development efficiency.
Fig. 4a schematically illustrates one of the flowcharts of a method for coding error localization according to another embodiment of the present disclosure. Fig. 4b schematically illustrates a second flowchart of a method for coding error localization according to another embodiment of the present disclosure. As shown in fig. 4a, operation S410 is further included before operation S210.
In operation S410, a target stored procedure code is generated from the stored procedure package of the source database.
As shown in fig. 4b, operation S410 includes operations S411 to S413.
In operation S411, the code and definition of the source database storage process are acquired.
In operation S412, the codes and definitions of the source database storage process are converted.
In operation S413, a line number is added to the converted code to generate a target stored procedure code.
In one example, before compiling, the storage process package is further converted to generate a target storage process code, specifically, the code and definition of the storage process of the source database (traditional database) are obtained and converted to the code and definition conforming to the syntax of the novel database, the number of storage process lines of the traditional database instance is often millions, and up to tens of millions, a single storage process package (the storage process package is a collection of a plurality of related storage processes, similar to the relationship of JAVA CLASS and method), often tens of thousands of lines of codes and hundreds of storage processes need to be compiled together. In order to facilitate the later compiling and error reporting positioning, a line number is added to the converted code to generate a compiling intermediate temporary code, namely a target storage process code is as follows:
Examples of compiled error messages are as follows:
ERROR:syntax error at end of input
LINE 45:end
^
QUERY:PACKAGE DECLARE
FUNCTION proc_lqwl(ddd IN VARCHAR2)
the compiling and error reporting information can know that the compiling and running reaches 45-line error reporting, but the specific position of the error reporting statement is not determined, so that repeated compiling and error testing are needed through annotating part of codes. A specific positioning process will be described with reference to fig. 5 to 7. Fig. 5 schematically illustrates a flow chart of a stored procedure code annotation method provided according to another embodiment of the present disclosure. Fig. 6 schematically illustrates a flowchart of a method for coding error localization according to a further embodiment of the present disclosure. As shown in fig. 5, operation S220 includes operation S221 and operation S222.
In operation S221, an error-reporting statement line number and a total number of stored procedures before the error-reporting statement line number are determined according to the compiled error-reporting information.
In operation S222, one half of the stored procedure codes of the total number of stored procedures are annotated according to a halving principle.
As shown in fig. 6, operation S230 includes operation S231 and operation S233.
In operation S231, performing a secondary compilation of the annotated stored procedure code;
in operation S232, if the compiling is successful, determining that the stored procedure error statement is in the annotated half of the stored procedure codes; and
in operation S233, if the error is compiled, it is determined that the stored procedure error statement is in the stored procedure code that is not annotated.
In one example, it can be seen from the above error reporting information that the last line number 45 of the code is defined for the last stored procedure packet, and the total number of stored procedures before the line number of the error reporting statement is determined from the back to the front, preferably, a halving method is adopted, and the halved meaning refers to half of the number of stored procedures processed each time the code is annotated, so as to maximally improve the positioning efficiency. Annotating code of the storage process except for the object definition (such as variable definition) until compiling is not error-prone; and reducing the number of annotation storage processes, and finally positioning the first error reporting storage process. The above example annotates code within FUNCTION proc lqw other than the object definition (e.g., variable definition), namely annotating lines 34-44 of code. The following is shown:
if the coding and error reporting information is unchanged and the error reporting information is still 45 line statement error reporting, the code except the object definition (such as variable definition) in the FUNCTION proc_ lqw2 is continuously annotated, namely, the code of 20-28 lines is annotated. The following is shown:
if the compiling is successful at this time, the first error reporting position is determined to be the code compiling error in FUNCTION proc lqw2, and according to the method, the annotation range is continuously reduced in the storage process, and the statement is annotated according to the halving method until the first statement error reporting statement is found. And storing the determined stored process packet name (pckg test in the example) stored process name (FUNCTION proc lqw2 in the example), the content of the error report statement, the error report keyword, the compiling time stamp and other information into a memory.
Fig. 7 schematically illustrates a flowchart of a method for coding error localization according to another embodiment of the present disclosure. As shown in fig. 7, after operation S240, operations S310 to S330 are further included.
At operation S310, recompiling the code annotated by the error-reporting statement in the storage process until no error-reporting information is generated in the storage process;
in operation S320, recording the error-reported stored procedure name, the error-reported statement start line number, the error-reported statement content, the error-reported keyword, and the compiling timestamp to an error information table; and
in operation S330, the error information table is output.
In one example, since there may be multiple error reporting sentences in a storage process packet, after determining the first error reporting sentence, annotating the error reporting sentence, releasing the annotation line in the earlier stage of the storage process, compiling again, finding out a new error, and performing loop processing until the storage process has no error reporting information. The compiling and error reporting storage process package name, storage process name, statement content of error reporting, error reporting key word and compiling occurrence time are recorded into an error information table, the error information table is output and sent to relevant developers in a mail mode and the like, and the relevant compiling error points are modified by the developers. Therefore, all compiling errors in the tens of thousands of lines of storage process packages are output together at one time, batch modification of developers is facilitated, repeated work is reduced, and development efficiency is improved.
The embodiment of the disclosure provides a novel database for information creation, and a method for quickly locating and searching compiling errors in a storage process, which can quickly and accurately locate all compiling errors in a storage process package of tens of thousands of lines in a transformation process of the information creation database, reduce development workload, reduce requirements on developers, improve development efficiency, and make up for the defects of the novel database in compiling and reporting errors in the storage process.
Based on the compiling and error reporting positioning method, the disclosure also provides a compiling and error reporting positioning device. The device will be described in detail below in connection with fig. 8.
Fig. 8 schematically illustrates a block diagram of a compiling error locating device according to an embodiment of the disclosure. As shown in fig. 8, the compiling error locating device 800 of the embodiment includes a first compiling module 810, an annotating module 820, a second compiling module 830 and a first error locating module 840.
The first compilation module 810 compiles the target stored procedure code in response to the stored procedure code compilation instructions. In an embodiment, the first compiling module 810 may be used to perform the operation S210 described above, which is not described herein.
The annotating module 820 is configured to annotate the stored procedure code according to the compiled error-reporting information and the stored procedure number after determining to generate the compiled error-reporting information. In an embodiment, the annotation module 820 may be used to perform the operation S220 described above, which is not described herein.
The second compiling module 830 is configured to perform secondary compiling on the annotated stored procedure code to reduce the annotation range of the stored procedure code. In an embodiment, the second compiling module 830 may be configured to perform the operation S230 described above, which is not described herein.
The first error localization module 840 is configured to repeat the annotation compilation operation until it is determined to store a procedure error statement. In an embodiment, the first error locating module 840 may be used to perform the operation S240 described above, which is not described herein.
According to an embodiment of the present disclosure, the apparatus further comprises: the system comprises a second error reporting and positioning module, a recording module and an output module.
And the second error reporting and positioning module is used for recompiling the code annotated by the error reporting statement in the storage process until no error reporting information exists in the storage process. In an embodiment, the second error-locating module may be configured to perform the operation S310 described above, which is not described herein.
The recording module is used for recording the error-reporting storage process name, the error-reporting statement starting line number, the error-reporting statement content, the error-reporting keyword and the compiling time stamp into an error information table. In an embodiment, the recording module may be configured to perform the operation S320 described above, which is not described herein.
And the output module is used for the error information table. In an embodiment, the output module may be configured to perform the operation S330 described above, which is not described herein.
According to an embodiment of the present disclosure, the annotation module comprises: a first determination sub-module and an annotation sub-module.
The first determining sub-module is used for determining the line number of the error reporting statement and the total number of the storage processes before the line number of the error reporting statement according to the compiling error reporting information. In an embodiment, the first determining sub-module may be used to perform the operation S221 described above, which is not described herein.
And the annotating sub-module is used for annotating half of the stored procedure codes of the total number of the stored procedures according to the halving principle. In an embodiment, the annotation sub-module may be configured to perform the operation S222 described above, which is not described herein.
According to an embodiment of the present disclosure, the second compiling module includes: the second determination sub-module is configured to determine a second determination sub-module.
The secondary compiling sub-module is used for performing secondary compiling on the annotated stored process codes; in an embodiment, the secondary compiling sub-module may be used to perform the operation S231 described above, which is not described herein.
And the second determining submodule is used for determining that the stored procedure error statement is in the annotated half of the stored procedure codes if the compiling is successful. In an embodiment, the second determining sub-module may be used to perform the operation S232 described above, which is not described herein.
And a third determining sub-module, configured to determine that the stored procedure error statement is in the stored procedure code that is not annotated if the compiling is error-reporting. In an embodiment, the third determining sub-module may be used to perform the operation S233 described above, which is not described herein.
According to an embodiment of the present disclosure, before the first compiling module compiles the target stored procedure code, further comprising: and the target storage process code generation module.
And the target stored procedure code generating module is used for generating the target stored procedure code according to the stored procedure packet of the source database. In an embodiment, the target storage procedure code generating module may be configured to perform the operation S410 described above, which is not described herein.
According to an embodiment of the present disclosure, the object storage process code generation module includes: the device comprises an acquisition sub-module, a conversion sub-module and a generation sub-module.
And the acquisition sub-module is used for acquiring codes and definitions of the storage process of the source database. In an embodiment, the obtaining sub-module may be used to perform the operation S411 described above, which is not described herein.
And the conversion sub-module is used for converting codes and definitions of the storage process of the source database. In an embodiment, the conversion sub-module may be used to perform the operation S412 described above, which is not described herein.
And the generation sub-module is used for adding a line number to the converted code to generate the target storage process code. In an embodiment, the generating sub-module may be configured to perform the operation S413 described above, which is not described herein.
Any of the first compiling module 810, the annotating module 820, the second compiling module 830, and the first error localization module 840 may be combined in one module to be implemented, or any of the modules may be split into a plurality of modules, according to an embodiment of the present disclosure. Alternatively, at least some of the functionality of one or more of the modules may be combined with at least some of the functionality of other modules and implemented in one module. According to embodiments of the present disclosure, at least one of the first compiling module 810, the annotating module 820, the second compiling module 830, and the first error localization module 840 may be implemented at least in part as hardware circuitry, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware in any other reasonable way of integrating or packaging the circuitry, or in any one of or a suitable combination of three of software, hardware, and firmware. Alternatively, at least one of the first compiling module 810, the annotating module 820, the second compiling module 830 and the first error localization module 840 may be at least partially implemented as a computer program module, which when executed may perform the respective functions.
Fig. 9 schematically illustrates a block diagram of an electronic device adapted to implement a compiled error-localization method in accordance with an embodiment of the disclosure.
As shown in fig. 9, an electronic device 900 according to an embodiment of the present disclosure includes a processor 901 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 902 or a program loaded from a storage portion 908 into a Random Access Memory (RAM) 903. The processor 901 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or an associated chipset and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), or the like. Processor 901 may also include on-board memory for caching purposes. Processor 901 may include a single processing unit or multiple processing units for performing the different actions of the method flows according to embodiments of the present disclosure.
In the RAM 903, various programs and data necessary for the operation of the electronic device 900 are stored. The processor 901, the ROM 902, and the RAM 903 are connected to each other by a bus 904. The processor 901 performs various operations of the method flow according to the embodiments of the present disclosure by executing programs in the ROM 902 and/or the RAM 903. Note that the program may be stored in one or more memories other than the ROM 902 and the RAM 903. The processor 901 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the disclosure, the electronic device 900 may also include an input/output (I/O) interface 905, the input/output (I/O) interface 905 also being connected to the bus 904. The electronic device 900 may also include one or more of the following components connected to the I/O interface 905: an input section 906 including a keyboard, a mouse, and the like; an output portion 907 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage portion 908 including a hard disk or the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as needed. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on the drive 910 so that a computer program read out therefrom is installed into the storage section 908 as needed.
The present disclosure also provides a computer-readable storage medium that may be embodied in the apparatus/device/system described in the above embodiments; or may exist alone without being assembled into the apparatus/device/system. The computer-readable storage medium carries one or more programs that, when executed, implement a compile-error localization method according to embodiments of the present disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example, but is not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to embodiments of the present disclosure, the computer-readable storage medium may include ROM 902 and/or RAM 903 and/or one or more memories other than ROM 902 and RAM 903 described above.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowcharts. When the computer program product runs in a computer system, the program code is used for enabling the computer system to realize the compiling error locating method provided by the embodiment of the disclosure.
The above-described functions defined in the system/apparatus of the embodiments of the present disclosure are performed when the computer program is executed by the processor 901. The systems, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed, and downloaded and installed in the form of a signal on a network medium, via communication portion 909, and/or installed from removable medium 911. The computer program may include program code that may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In such an embodiment, the computer program may be downloaded and installed from the network via the communication portion 909 and/or installed from the removable medium 911. The above-described functions defined in the system of the embodiments of the present disclosure are performed when the computer program is executed by the processor 901. The systems, devices, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
According to embodiments of the present disclosure, program code for performing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, such computer programs may be implemented in high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. Programming languages include, but are not limited to, such as Java, c++, python, "C" or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that the features recited in the various embodiments of the disclosure and/or in the claims may be provided in a variety of combinations and/or combinations, even if such combinations or combinations are not explicitly recited in the disclosure. In particular, the features recited in the various embodiments of the present disclosure and/or the claims may be variously combined and/or combined without departing from the spirit and teachings of the present disclosure. All such combinations and/or combinations fall within the scope of the present disclosure.
The embodiments of the present disclosure are described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the embodiments cannot be used advantageously in combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be made by those skilled in the art without departing from the scope of the disclosure, and such alternatives and modifications are intended to fall within the scope of the disclosure.

Claims (10)

1. A method for locating a compiled error, the method comprising:
compiling the target stored procedure code in response to the stored procedure code compiling instruction;
After determining to generate the compiling error reporting information, annotating the stored process code according to the compiling error reporting information and the stored process number;
performing secondary compiling on the annotated stored procedure code to reduce the annotation range of the stored procedure code; and
the annotation compilation operation is repeated until it is determined to store the procedure error statement.
2. The method as recited in claim 1, further comprising:
recompilation is carried out on the code annotated by the error reporting statement in the storage process until no error reporting information exists in the storage process;
recording the error-reporting storage process name, the error-reporting statement initial line number, the error-reporting statement content, the error-reporting keyword and the compiling time stamp into an error information table; and
and outputting the error information table.
3. The method of claim 1, wherein annotating stored procedure code based on compiled error-reporting information and stored procedure numbers comprises:
determining the error reporting statement line number and the total number of storage processes before the error reporting statement line number according to the compiling error reporting information; and
and annotating half of the stored procedure codes of the total number of the stored procedures according to a halving principle.
4. The method of claim 3, wherein secondarily compiling the annotated stored procedure code to narrow the annotation range of the stored procedure code comprises:
Performing secondary compiling on the annotated stored procedure code;
if the compiling is successful, determining that the storage process error report statement is in the annotated half of the storage process codes; and
if the error is compiled, it is determined that the stored procedure error statement is in the stored procedure code that is not annotated.
5. The method of any of claims 1 to 4, further comprising, prior to compiling the target stored procedure code:
and generating a target stored procedure code according to the stored procedure package of the source database.
6. The method of claim 5, wherein generating stored procedure codes from stored procedure packages of a source database comprises:
acquiring codes and definitions of a source database storage process;
converting code and definition of the source database storage process; and
a line number is added to the converted code to generate a target stored procedure code.
7. A compiled error locating device, the device comprising:
the first compiling module is used for compiling the target stored process code in response to the stored process code compiling instruction;
the annotation module is used for annotating the stored process codes according to the compiled error reporting information and the stored process number after determining to generate the compiled error reporting information;
The second compiling module is used for performing secondary compiling on the annotated stored procedure codes so as to reduce the annotation range of the stored procedure codes; and
and the first error reporting and positioning module is used for repeating the annotation compiling operation until the error reporting statement in the storage process is determined.
8. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the compiled error locating method of any of claims 1-6.
9. A computer readable storage medium having stored thereon executable instructions which when executed by a processor cause the processor to perform a compiled error localization method according to any one of claims 1 to 6.
10. A computer program product comprising a computer program which, when executed by a processor, implements a compiled error-localization method according to any one of claims 1 to 6.
CN202310785869.0A 2023-06-29 2023-06-29 Coding error-reporting positioning method, device, equipment, storage medium and program product Pending CN116820482A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310785869.0A CN116820482A (en) 2023-06-29 2023-06-29 Coding error-reporting positioning method, device, equipment, storage medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310785869.0A CN116820482A (en) 2023-06-29 2023-06-29 Coding error-reporting positioning method, device, equipment, storage medium and program product

Publications (1)

Publication Number Publication Date
CN116820482A true CN116820482A (en) 2023-09-29

Family

ID=88128830

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310785869.0A Pending CN116820482A (en) 2023-06-29 2023-06-29 Coding error-reporting positioning method, device, equipment, storage medium and program product

Country Status (1)

Country Link
CN (1) CN116820482A (en)

Similar Documents

Publication Publication Date Title
US10830817B2 (en) Touchless testing platform
US10983789B2 (en) Systems and methods for automating and monitoring software development operations
US8875110B2 (en) Code inspection executing system for performing a code inspection of ABAP source codes
US8156473B2 (en) Model oriented debugging
US9122540B2 (en) Transformation of computer programs and eliminating errors
US20140331203A1 (en) Analysis of source code changes
US8826227B2 (en) Computer aided visualization of a business object model lifecycle
US9417991B2 (en) Translation verification testing
CN110865889A (en) Method and apparatus for transferring events between components
US10346294B2 (en) Comparing software projects having been analyzed using different criteria
CN111597069B (en) Program processing method, device, electronic equipment and storage medium
CN115599386A (en) Code generation method, device, equipment and storage medium
CN115016831A (en) Dependent component information acquisition method and device and storage medium
CN114281803A (en) Data migration method, device, equipment, medium and program product
CN112650526B (en) Method, device, electronic equipment and medium for detecting version consistency
CN113419740A (en) Program data stream analysis method and device, electronic device and readable storage medium
CN112825068B (en) Data blood margin generation method and device
CN116820482A (en) Coding error-reporting positioning method, device, equipment, storage medium and program product
US9652359B1 (en) Annotation natural keys for source code analysis
CN113138767B (en) Code language conversion method, device, electronic equipment and storage medium
US11119761B2 (en) Identifying implicit dependencies between code artifacts
CN116382703B (en) Software package generation method, code development method and device, electronic equipment and medium
Farah et al. Analysis of intercrossed open-source software repositories data in GitHub
US20240061762A1 (en) On-demand contextual trace log generation
CN114896273B (en) SQL statement configuration method and equipment compatible with storage process and storage medium

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