CN104636471A - Procedure code finding method and device - Google Patents
Procedure code finding method and device Download PDFInfo
- Publication number
- CN104636471A CN104636471A CN201510075869.7A CN201510075869A CN104636471A CN 104636471 A CN104636471 A CN 104636471A CN 201510075869 A CN201510075869 A CN 201510075869A CN 104636471 A CN104636471 A CN 104636471A
- Authority
- CN
- China
- Prior art keywords
- code
- data
- tables
- self
- program
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/43—Checking; Contextual analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/31—Programming languages or programming paradigms
- G06F8/312—List processing, e.g. LISP programming language
Abstract
The invention provides a procedure code finding method and device. The method comprises the following steps: after receiving a data table changing message, obtaining a code section of a data accessing layer procedure, and extracting a data table mark in the data table changing message; finding a code of data table execution operation corresponding to the data table mark in the code section; and if the code is found, recording a procedure mark of the code section so as to find the related data accessing layer procedure after the data table is changed. The technical problems that the efficiency of a manual finding manner is lower and omission is easy to cause are avoided.
Description
Technical field
The application relates to codelookup technical field, especially a kind of lookup method of program code and device.
Background technology
At present, various software systems all can use Database Systems, and application layer program needs the data that store in tables of data in accessing database, realizes corresponding function.For banking system, software systems are when realizing the functions such as credit transaction, credit transaction module needs to find account balance table, and is deposited in account balance table by various information such as amount depositeds, and this process can be described as program to the operation of tables of data or access.
But, tables of data self information can change, and in order to ensure the correct access of program to the tables of data after change, needs application developer to revise respective code, therefore, need to find in a large amount of system codes with change after tables of data there is the program of access relation.Current mode of searching is for manually to search, and this kind of mode efficiency is lower and easily occur slipping.
Summary of the invention
In view of this, the invention provides a kind of lookup method and device of program code, in order to realize when tables of data changes, realize the Automatic inquirying to the program relevant to this tables of data.For realizing described object, technical scheme provided by the invention is as follows:
A lookup method for program code, comprising:
When receiving tables of data and changing message, obtain the code segment of data access layer program;
Extract the tables of data mark in described tables of data change message, and in described code segment, search the tables of data corresponding to described tables of data mark and perform the first code operated; Wherein, described first operation comprises increase, deletes, searches, revises or connect;
If find, record the program identification that described code segment is corresponding.
Preferably, the lookup method of above-mentioned program code, described in described code segment, search and the code of tables of data execution first operation corresponding to described tables of data mark is comprised:
Utilize preset data table access template, in described code segment, search code tables of data being performed to the first operation; Wherein, described preset data table access template comprises the format code to tables of data executable operations, and described tables of data is the tables of data of described tables of data mark correspondence;
When comprising the code to view execution second operation in described code segment, in the code of view, search the code described tables of data being performed to the first operation; Wherein, described second operation comprises and searches or connect;
When comprising the code calling self-defined storing process in described code segment, utilizing the code of described self-defined storing process, searching the code described tables of data being performed to the first operation.
Preferably, the lookup method of above-mentioned program code also comprises:
When comprising dynamic operation mark in described code segment and described tables of data identifies as parameter, marking program identification corresponding to described code segment is Alternative procedures;
When comprise the code of calling system storing process in described code segment and described tables of data mark as parameter time, marking program identification corresponding to described code segment is Alternative procedures.
Preferably, the lookup method of above-mentioned program code, in the code of view, search and the code of described tables of data execution first operation is comprised:
Utilize preset data table access template, in the code of described view, search the code described tables of data being performed to the first operation;
When comprising the code to new view execution second operation in the code of described view, Returning utilization preset data table access template, in the code of new view, searches the code described tables of data being performed to the first operation.
Preferably, the lookup method of above-mentioned program code, the described code utilizing described self-defined storing process, search and the code of described tables of data execution first operation is comprised:
When comprising the code calling self-defined storing process in described code segment, utilizing preset data table access template, in the code of this self-defined storing process, searching the code described tables of data being performed to the first operation;
When comprising the code to view execution second operation in the code of described self-defined storing process, in the code of view, search the code described tables of data being performed to the first operation;
When comprising the code calling self-defining function in the code of described self-defined storing process, utilize the code of described self-defining function, search the code described tables of data being performed to the first operation;
When comprising the code of new self-defined storing process in the code of described self-defined storing process, the code of self-defined storing process new described in Returning utilization, searches the code described tables of data being performed to the first operation.
Preferably, the lookup method of above-mentioned program code, the described code utilizing described self-defining function, search and the code of described tables of data execution first operation is comprised:
Utilize preset data table access template, in the code of described self-defining function, search the code described tables of data being performed to the first operation;
When comprising the code to view execution second operation in the code of described self-defining function, return in the code of view, search the code described tables of data being performed to the first operation.
Preferably, the lookup method of above-mentioned program code also comprises:
Comprise in the code of described self-defining function described dynamic operation mark and described tables of data as parameter time, marking program identification corresponding to described code segment is Alternative procedures.
Preferably, the lookup method of above-mentioned program code also comprises:
When there is comment statement in described code segment, delete the comment statement in described code segment.
What present invention also provides a kind of program code searches device, comprising:
Code segment acquisition module, for when receiving tables of data and changing message, obtains the code segment of data access layer program;
Operation code searches module, and the tables of data changed in message for extracting described tables of data identifies, and in described code segment, searches the code that the tables of data corresponding to described tables of data mark performs the first operation; Wherein, described first operation comprises increase, deletes, searches, revises or connect; If find, trigger identification record module;
Program identification logging modle, for recording program identification corresponding to described code segment.
Preferably, above-mentioned program code search device, also comprise:
Comment statement removing module, for when there is comment statement in described code segment, deletes the comment statement in described code segment.
As known from the above, the present invention has following beneficial effect:
Codelookup method provided by the invention, after receiving tables of data change message, obtain the code segment of data access layer program, and the tables of data mark extracted in tables of data change message, and then the code searched in code segment tables of data executable operations corresponding to tables of data mark, if find, record the program identification of this code segment, thus realize after tables of data changes, to searching of the data access layer program associated with it, avoid manually searching the technical matters of the lower and easy careless omission of mode efficiency.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only embodiments of the invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to the accompanying drawing provided.
The process flow diagram of the lookup method of the program code that Fig. 1 provides for the embodiment of the present invention;
The process flow diagram of the lookup method of the program code that Fig. 2 provides for another embodiment of the present invention;
The partial process view of the lookup method of the program code that Fig. 3 provides for further embodiment of this invention;
The partial process view of the lookup method of the program code that Fig. 4 provides for further embodiment of this invention;
The process flow diagram of the lookup method of the program code that Fig. 5 provides for further embodiment of this invention;
The partial process view of the lookup method of the program code that Fig. 6 provides for further embodiment of this invention;
The structural representation searching device of the program code that Fig. 7 provides for the embodiment of the present invention;
The part-structure schematic diagram searching device of the program code that Fig. 8 provides for another embodiment of the present invention;
The structural representation searching device of the program code that Fig. 9 provides for further embodiment of this invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
See Fig. 1, it illustrates the flow process of the lookup method of the program code that the embodiment of the present invention provides, specifically comprise the following steps:
Step S101: when receiving tables of data and changing message, obtain the code segment of data access layer program.
Wherein, when tables of data changes, can generate change message, this change message can be sent to the actuating unit of the present embodiment, triggers the code segment that this actuating unit obtains data access layer program.Wherein, the code segment of data access layer program is stored on code server, code server is downloaded whole data access layer programs, it should be noted that, these programs are programs of all visit data tables, but need the program finding the tables of data that access is changed wherein.
Step S102: extract the tables of data mark in described tables of data change message, and in described code segment, search the tables of data corresponding to described tables of data mark and perform the first code operated; Wherein, described first operation comprises increase, deletes, searches, revises or connect; If find, perform step S103.
Wherein, judge that whether the tables of data changed is by the routine access of data access layer, only needs the tables of data whether having one section of code access to change in all code segments of determining program.Tables of data changes in message and comprises tables of data mark, and this mark represents the tables of data changed.Tables of data mark is extracted in this change message, and in each program code segments, search the code of this tables of data of access, if find, illustrate that the tables of data of this program and change has incidence relation, in other words, the tables of data changed can have influence on the program of this data access, and then execution step S103 records this program.
Program associates the operation of the program of referring to tables of data with tables of data, specifically comprises the record in tables of data in increase record, deletion tables of data, searches the record in record, Update Table table or multiple tables of data connected in tables of data.It should be noted that, operation is herein called as the first operation, is for convenience of description and distinguishes with operation hereafter, does not refer in particular to the implication of order.
Step S103: record the program identification that described code segment is corresponding.
Particularly, if the code segment of certain program comprises the operation to changing tables of data, the program identification of this code segment is recorded.Program identification can be program name, and the mode of record can be by program identification record in lists, and certainly, program identification can be any mark uniquely representing program, and can carry out record by other mode to program identification.It should be noted that, the program got in step S101 can be multiple, and step S102 searches each program, if all find the access of the tables of data after to change in any number of program, then this step can record multiple program identification.
From above technical scheme, the lookup method of the program code that the present embodiment provides, after the message receiving tables of data change, first the code segment of data access layer program is obtained, and the tables of data mark extracted in this tables of data change message, tables of data after this tables of data mark representative change, and then the code searched in each code segment got this tables of data executable operations, if find, then record the program identification that this code segment is corresponding, thus obtain each program of the tables of data after access change, this kind of mode avoids manually searching the technical matters of the lower and easy careless omission of mode efficiency.In addition, find each program, just can be developer's update routine and provide foundation, final guarantee program is to the accurate access of the tables of data after change.
In above-described embodiment, connection can be that inner (inner join), outside connection (outer join) or the cartesian product of connecting connects (cross join), and outside connection specifically can comprise left join, right join or full join tri-kinds.And, this embodiment can be applied in Rule programming language environment, the database of tables of data application can be DB2, the mode of routine access DB2 can be ESQL mode, certainly, this is only a kind of embody rule example, can also be that the program design language being applied in other mentions in database product.
Comment statement may be comprised in the program code segments downloaded, therefore, in search procedure, mistakenly comment statement is resolved to the statement of real accessing database, need to judge before parsing, namely also comprise after step slol and before step S102: judge whether there is comment statement in code segment, if exist, the comment statement in delete code section.
It should be noted that, above and below each embodiment can but be not limited in banking system, as long as utilize tables of data to store data, and application program need access to change after the situation of tables of data all applicable.
In above-described embodiment, searching of step S102 is a complicated resolving, except will except program code segments itself is searched, also needs the view quoted when verifying access or storing process etc., is specifically described below in conjunction with Fig. 2 to search procedure.As shown in Figure 2, the specific implementation process of step S102 can comprise following content:
Step S201: utilize preset data table access template, in described code segment, searches code tables of data being performed to the first operation; Wherein, described preset data table access template comprises the format code to tables of data executable operations, and described tables of data is the tables of data of described tables of data mark correspondence.
Particularly, may comprise " Simple SQL " in code segment, additions and deletions are carried out to tables of data look into and change or the code of attended operation namely merely.Therefore, in order to realize the access statement finding out this kind of form, preset data table access template can be utilized, in code segment, searching code tables of data being performed to aforesaid operations.Wherein, tables of data access templates comprises the format code to tables of data executable operations, if find the code meeting any one format code in this template in code segment to be found, the lookup result of description of step S102 for finding, and then performs the program identification that step S103 records this section of code.
Such as, the find formatting code that tables of data access templates comprises is: select ... the set of from tables of data, each format code in this tables of data access templates is utilized to mate with code to be found, if when comprising select in code to be found, and then judge whether selcet code below meets the form of from tables of data set, if so, illustrate that this section of code is code tables of data being performed to search operation, and then perform the program identification that step S103 records this section of code.Such as, one section of code: select is comprised in code segment to be found ... from T1, XX; Where T1.id=XX.id.Search explanation according to above-mentioned, this section of code meets the find formatting code in tables of data access templates, therefore, needs to carry out record to the program identification of this section of code.
It should be noted that, according to tables of data access rule, to search operations often maximum in the operation of tables of data, therefore, in order to improve overall search efficiency, the tables of data access templates of setting can be that search operation is placed on first place, thus, as shown in Figure 3, when utilizing tables of data access templates to search code segment, first can search whether comprise search operation statement.Thereafter, can be search the code whether comprising increase, amendment, deletion or connect successively, further, attended operation can also have sequencing, as first searched inner connection, then searching outside connection, finally searches cartesian product and connects.Certainly, above-mentioned sequencing of searching is only a kind of example, is not limited thereto during enforcement, can also be other orders any, or perform simultaneously.
Certainly, the form of routine access tables of data may be non-Simple SQL mode, as called view or storing process.Therefore, except Simple SQL searched by needs, also to judge view and storing process.
Step S202: when comprising the code to view execution second operation in described code segment, in the code of view, search the code described tables of data being performed to the first operation; Wherein, described second operation comprises and searches or connect.
Particularly, possible operation view in program, the tables of data that view possible operation upgrades, this situation belongs to the operation of program to updated data table equally.Therefore, judge the code whether comprised in code segment view executable operations, this operation comprises searches view or connect view, wherein, the format code of searching view is select ... from set A, set A comprises view, and the format code of connect view is innerjoin view, outer join view or cross join view.If comprise, need to judge whether this view have accessed the tables of data of renewal further, namely in the code of view, search the code whether existed the tables of data executable operations upgraded, if find, the lookup result of description of step S102 is yes, and then performs the program identification of this section of code that step S103 record is downloaded.
It should be noted that, can be a recursive procedure to the search procedure of view code, namely view can call view, and therefore, in view code, same needs judges whether to call new view.The specific implementation process of this step comprises: utilize preset data table access template, in the code of described view, search the code described tables of data being performed to the first operation, judge in the code of described view, whether to comprise the code new view being performed to the second operation, if, Returning utilization preset data table access template, in the code of new view, searches the code described tables of data being performed to the first operation.
In this search procedure, searching the mode of the code of tables of data executable operations in view code can be utilize tables of data access templates.Further, can first carry out this kind and search, if this result of searching is not for find, search in this view code whether call new view further again, on the contrary, if find, directly can perform the recording process of step S103, further search procedure need not be performed.In addition, if desired search in view whether call new view further, mode of searching, as this step, does not repeat.
Step S203: when comprising the code calling self-defined storing process in described code segment, utilizes the code of described self-defined storing process, searches the code described tables of data being performed to the first operation.
In like manner, program also may call self-defined storing process, the operation to updated data table may be comprised in self-defined storing process, therefore, judge whether call self-defining storing process in code segment, if so, this self-defined storing process is utilized to search code to updated data table executable operations further.As shown in Figure 4, the search procedure of this step can specifically comprise:
Step S401: when comprising the code calling self-defined storing process in described code segment, utilizes preset data table access template, in the code of this self-defined storing process, searches the code described tables of data being performed to the first operation.Step S402: when comprising the code to view execution second operation in the code of described self-defined storing process, in the code of view, search the code described tables of data being performed to the first operation.Step S403: when comprising the code calling self-defining function in the code of described self-defined storing process, utilize the code of described self-defining function, searches the code described tables of data being performed to the first operation.Step S404: when comprising the code of new self-defined storing process in the code of described self-defined storing process, the code of self-defined storing process new described in Returning utilization, searches the code described tables of data being performed to the first operation.
Because self-defined storing process can continue to call view, self-defining function and new self-defined storing process, therefore, above-mentioned search procedure specifically, one is utilize tables of data access templates, in this self-defined storing process, directly search the operation to updated data table, two is search in this self-defined storing process whether comprise calling view, if, in the code of view, then search the operation to updated data table, three is search in this self-defined storing process whether comprise calling self-defining function, if, in the code of self-defining function, then search the operation to updated data table, four is search in this self-defined storing process whether comprise calling new self-defined storing process, if, in the code of new self-defined storing process, then search the operation to updated data table.
As can be seen here, need in self-defined storing process, carry out four kinds of different searching.It should be noted that, searching for these four kinds can be carry out simultaneously, also can be successively to perform, if the lookup result that any one is searched is yes, then the lookup result of description of step S102 is yes, and then directly performs step S103.Certainly, searching for these four kinds can also be successively perform, and namely current a kind of lookup result searched is no, and after just performing, one is searched.Certainly, the sequencing searched can be not limited to the above-mentioned sequence of positions of word, can be arbitrary arrangement order.
Further, as utilized searching of view, utilizing searching in the native codes that can be included in self-defining function of self-defining function to search, continuing to search in the view that can also call at it.That is: utilize preset data table access template, in the code of self-defining function, search the code described tables of data being performed to the first operation; When comprising the code to view execution second operation in the code of self-defining function, return in the code of view, search the code described tables of data being performed to the first operation.Visible, utilize the search procedure of self-defining function also can be a recursive procedure, namely self-defining function may call view, and as above-mentioned about the explanation of view, view can call new view.Wherein, search in code in the view the mode of tables of data executable operations see describing above, can not repeated.
On the whole, above-mentioned steps S201 utilizes the searching of tables of data access templates, step S202 utilizes view code searches and step S203 utilizes searching of self-defined storing process, and can be to perform, also can be successively perform simultaneously.
It should be noted that, program, except utilizing any one visit data off-balancesheet in these three kinds of modes of Simple SQL, view or self-defined storing process, may be also with dynamic sql or system stored procedures mode visit data table.But, first three kind mode is after finding corresponding format code, just routine access change tables of data can directly be determined clearly, but latter two mode is quite different, therefore, after the format code finding latter two mode, it directly can not be carried out record in the mode of step S103, but be labeled as Alternative procedures, determine to manually for related personnel.Therefore, as shown in Figure 5, if when the lookup result of step S102 is not for finding, can also comprise:
Step S104: when comprising dynamic operation mark in described code segment and described tables of data identifies as parameter, or, when comprise the code of calling system storing process in described code segment and described tables of data mark as parameter time, marking program identification corresponding to described code segment is Alternative procedures.
Particularly, with being embodied as of dynamic sql mode visit data table, in code segment, comprise dynamic sql operation mark.Therefore, judge whether to comprise dynamic sql operation mark in code segment, if comprise, and change tables of data as the parameter of dynamic operation, then need the program identification of this code segment to be labeled as Alternative procedures.
With being embodied as of the mode visit data table of calling system storing process, in code segment, comprise the code of Calling Stored Procedure.It should be noted that, system stored procedures is default, and be kept in Database Systems, therefore, judge in code segment, whether to comprise the system stored procedures prestored in Database Systems, if comprise, and change tables of data as parameter when calling, then need the program identification of this code segment to be labeled as Alternative procedures.
In addition, also may visit data table in a dynamic fashion in self-defining function, therefore, as shown in Figure 6, step S304 utilizes the code of self-defined storing process, when to search the lookup result of the code of described tables of data executable operations be no, can also comprise:
Step S405: comprise in the code of described self-defining function described dynamic operation mark and described tables of data as parameter time, marking program identification corresponding to described code segment is Alternative procedures.
Be introduced the device of searching of the program code that the embodiment of the present invention provides below, it should be noted that, the explanation of searching device of relevant procedures code can refer to the lookup method of program code above, does not repeat below.
With reference to Fig. 7, the program code that it illustrates the embodiment of the present invention provides searches the structure of device, specifically comprises code segment acquisition module 100, operation code searches module 200 and program identification logging modle 300; Wherein:
Code segment acquisition module 100, for when receiving tables of data and changing message, obtains the code segment of data access layer program;
Operation code searches module 200, and the tables of data changed in message for extracting described tables of data identifies, and in described code segment, searches the code that the tables of data corresponding to described tables of data mark performs the first operation; Wherein, described first operation comprises increase, deletes, searches, revises or connect; If find, trigger identification record module;
Program identification logging modle 300, for recording program identification corresponding to described code segment.
As can be seen from the above technical solutions, searching in device of the program code that the present embodiment provides, code segment acquisition module 100 is after receiving tables of data change message, obtain the code segment of data access layer program, and then operation code is searched module 200 and is utilized tables of data to change tables of data mark in message, in code segment, searches the code to tables of data executable operations, the program identification of program identification logging modle 300 and then record code section, thus achieve searching program code.
In addition, above-mentioned device of searching can also comprise: comment statement removing module, for when there is comment statement in described code segment, deletes the comment statement in described code segment.
In addition, as shown in Figure 8, operation code is searched module 200 and can specifically be comprised: first searches submodule 201, second searches submodule 202 and the 3rd and search submodule 203; Wherein:
First searches submodule 201, for utilizing preset data table access template, in described code segment, searches code tables of data being performed to the first operation; Wherein, described preset data table access template comprises the format code to tables of data executable operations, and described tables of data is the tables of data of described tables of data mark correspondence;
Second searches submodule 202, for when comprising the code to view execution second operation in described code segment, in the code of view, searches the code described tables of data being performed to the first operation; Wherein, described second operation comprises and searches or connect;
3rd searches submodule 203, for when comprising the code calling self-defined storing process in described code segment, utilizes the code of described self-defined storing process, searches the code described tables of data being performed to the first operation.
In addition, as shown in Figure 9, above-mentioned search device and can also comprise: Alternative procedures mark module 400, for when comprising dynamic operation mark in described code segment and described tables of data identifies as parameter, or, when comprise the code of calling system storing process in described code segment and described tables of data mark as parameter time, marking program identification corresponding to described code segment is Alternative procedures.
In addition, second searches submodule 202 can specifically comprise: search unit and cycling element, wherein:
Searching unit, for utilizing preset data table access template, in the code of described view, searching the code described tables of data being performed to the first operation;
Cycling element, for when comprising the code to new view execution second operation in the code of described view, return triggering lookup unit and utilize preset data table access template, in the code of new view, search the code described tables of data being performed to the first operation.
In addition, the 3rd search submodule 203 and specifically comprise: first searches unit, second searches unit, the 3rd and search unit and the 4th and search unit; Wherein:
First searches unit, for when comprising the code calling self-defined storing process in described code segment, utilizes preset data table access template, in the code of this self-defined storing process, searches the code described tables of data being performed to the first operation;
Second searches unit, for when comprising the code to view execution second operation in the code of described self-defined storing process, in the code of view, searches the code described tables of data being performed to the first operation;
3rd searches unit, for when comprising the code calling self-defining function in the code of described self-defined storing process, utilizes the code of described self-defining function, searches the code described tables of data being performed to the first operation;
4th searches unit, and for when comprising the code of new self-defined storing process in the code of described self-defined storing process, the code of self-defined storing process new described in Returning utilization, searches the code described tables of data being performed to the first operation.
Particularly, the 3rd search unit and comprise: search subelement and circulation subelement; Wherein:
Searching subelement, for utilizing preset data table access template, in the code of described self-defining function, searching the code described tables of data being performed to the first operation;
Circulation subelement, for when comprising the code to view execution second operation in the code of described self-defining function, returning in the code of view, searching the code described tables of data being performed to the first operation.
In addition, above-mentioned device of searching can also comprise: Alternative procedures mark subelement, for when comprise in the code of described self-defining function described dynamic operation identify and described tables of data as parameter time, marking program identification corresponding to described code segment is Alternative procedures.
It should be noted that, each embodiment in this instructions all adopts the mode of going forward one by one to describe, and what each embodiment stressed is the difference with other embodiments, between each embodiment identical similar part mutually see.
Also it should be noted that, in this article, the such as relational terms of first and second grades and so on is only used for an entity or operation to separate with another entity or operational zone, and not necessarily requires or imply the relation that there is any this reality between these entities or operation or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, article or equipment and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method, article or equipment.When not more restrictions, the key element limited by statement " comprising ... ", and be not precluded within process, method, article or the equipment comprising above-mentioned key element and also there is other identical element.
To the above-mentioned explanation of the disclosed embodiments, professional and technical personnel in the field are realized or uses the present invention.To be apparent for those skilled in the art to the multiple amendment of these embodiments, General Principle as defined herein can without departing from the spirit or scope of the present invention, realize in other embodiments.Therefore, the present invention can not be restricted to these embodiments shown in this article, but will meet the widest scope consistent with principle disclosed herein and features of novelty.
Claims (10)
1. a lookup method for program code, is characterized in that, comprising:
When receiving tables of data and changing message, obtain the code segment of data access layer program;
Extract the tables of data mark in described tables of data change message, and in described code segment, search the tables of data corresponding to described tables of data mark and perform the first code operated; Wherein, described first operation comprises increase, deletes, searches, revises or connect;
If find, record the program identification that described code segment is corresponding.
2. the lookup method of program code according to claim 1, is characterized in that, described in described code segment, searches and comprises the code of tables of data execution first operation corresponding to described tables of data mark:
Utilize preset data table access template, in described code segment, search code tables of data being performed to the first operation; Wherein, described preset data table access template comprises the format code to tables of data executable operations, and described tables of data is the tables of data of described tables of data mark correspondence;
When comprising the code to view execution second operation in described code segment, in the code of view, search the code described tables of data being performed to the first operation; Wherein, described second operation comprises and searches or connect;
When comprising the code calling self-defined storing process in described code segment, utilizing the code of described self-defined storing process, searching the code described tables of data being performed to the first operation.
3. the lookup method of program code according to claim 1, is characterized in that, also comprises:
When comprising dynamic operation mark in described code segment and described tables of data identifies as parameter, marking program identification corresponding to described code segment is Alternative procedures;
When comprise the code of calling system storing process in described code segment and described tables of data mark as parameter time, marking program identification corresponding to described code segment is Alternative procedures.
4. the lookup method of program code according to claim 2, is characterized in that, in the code of view, searches and comprises the code of described tables of data execution first operation:
Utilize preset data table access template, in the code of described view, search the code described tables of data being performed to the first operation;
When comprising the code to new view execution second operation in the code of described view, Returning utilization preset data table access template, in the code of new view, searches the code described tables of data being performed to the first operation.
5. the lookup method of program code according to claim 2, is characterized in that, the described code utilizing described self-defined storing process, searches and comprises the code of described tables of data execution first operation:
When comprising the code calling self-defined storing process in described code segment, utilizing preset data table access template, in the code of this self-defined storing process, searching the code described tables of data being performed to the first operation;
When comprising the code to view execution second operation in the code of described self-defined storing process, in the code of view, search the code described tables of data being performed to the first operation;
When comprising the code calling self-defining function in the code of described self-defined storing process, utilize the code of described self-defining function, search the code described tables of data being performed to the first operation;
When comprising the code of new self-defined storing process in the code of described self-defined storing process, the code of self-defined storing process new described in Returning utilization, searches the code described tables of data being performed to the first operation.
6. the lookup method of program code according to claim 5, is characterized in that, the described code utilizing described self-defining function, searches and comprises the code of described tables of data execution first operation:
Utilize preset data table access template, in the code of described self-defining function, search the code described tables of data being performed to the first operation;
When comprising the code to view execution second operation in the code of described self-defining function, return in the code of view, search the code described tables of data being performed to the first operation.
7. the lookup method of program code according to claim 6, is characterized in that, also comprises:
Comprise in the code of described self-defining function described dynamic operation mark and described tables of data as parameter time, marking program identification corresponding to described code segment is Alternative procedures.
8. the lookup method of program code according to claim 1, is characterized in that, also comprises:
When there is comment statement in described code segment, delete the comment statement in described code segment.
9. program code search a device, it is characterized in that, comprising:
Code segment acquisition module, for when receiving tables of data and changing message, obtains the code segment of data access layer program;
Operation code searches module, and the tables of data changed in message for extracting described tables of data identifies, and in described code segment, searches the code that the tables of data corresponding to described tables of data mark performs the first operation; Wherein, described first operation comprises increase, deletes, searches, revises or connect; If find, trigger identification record module;
Program identification logging modle, for recording program identification corresponding to described code segment.
10. program code according to claim 9 search device, it is characterized in that, also comprise:
Comment statement removing module, for when there is comment statement in described code segment, deletes the comment statement in described code segment.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510075869.7A CN104636471A (en) | 2015-02-12 | 2015-02-12 | Procedure code finding method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510075869.7A CN104636471A (en) | 2015-02-12 | 2015-02-12 | Procedure code finding method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN104636471A true CN104636471A (en) | 2015-05-20 |
Family
ID=53215217
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510075869.7A Pending CN104636471A (en) | 2015-02-12 | 2015-02-12 | Procedure code finding method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104636471A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108984612A (en) * | 2018-06-12 | 2018-12-11 | 中国平安人寿保险股份有限公司 | Acquisition methods, device, computer equipment and the storage medium of target SQL statement |
CN110309145A (en) * | 2019-04-15 | 2019-10-08 | 中国银行股份有限公司 | A kind of tables of data method of adjustment, tables of data creation method and device |
CN110659293A (en) * | 2019-09-24 | 2020-01-07 | 支付宝(杭州)信息技术有限公司 | Data table determining method and device based on change codes |
CN112925552A (en) * | 2021-02-26 | 2021-06-08 | 北京百度网讯科技有限公司 | Code processing method, device, equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS6413645A (en) * | 1987-07-07 | 1989-01-18 | Fujitsu Ltd | Automatic update method for data base |
US20070143530A1 (en) * | 2005-12-15 | 2007-06-21 | Rudelic John C | Method and apparatus for multi-block updates with secure flash memory |
CN103631601A (en) * | 2013-12-10 | 2014-03-12 | 北京中电普华信息技术有限公司 | Code generation method and code generation device |
CN103677869A (en) * | 2012-09-06 | 2014-03-26 | 中国科学院计算技术研究所 | Wireless sensor network node remote code updating system and method |
-
2015
- 2015-02-12 CN CN201510075869.7A patent/CN104636471A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS6413645A (en) * | 1987-07-07 | 1989-01-18 | Fujitsu Ltd | Automatic update method for data base |
US20070143530A1 (en) * | 2005-12-15 | 2007-06-21 | Rudelic John C | Method and apparatus for multi-block updates with secure flash memory |
CN103677869A (en) * | 2012-09-06 | 2014-03-26 | 中国科学院计算技术研究所 | Wireless sensor network node remote code updating system and method |
CN103631601A (en) * | 2013-12-10 | 2014-03-12 | 北京中电普华信息技术有限公司 | Code generation method and code generation device |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108984612A (en) * | 2018-06-12 | 2018-12-11 | 中国平安人寿保险股份有限公司 | Acquisition methods, device, computer equipment and the storage medium of target SQL statement |
CN108984612B (en) * | 2018-06-12 | 2024-02-02 | 中国平安人寿保险股份有限公司 | Method and device for acquiring target SQL statement, computer equipment and storage medium |
CN110309145A (en) * | 2019-04-15 | 2019-10-08 | 中国银行股份有限公司 | A kind of tables of data method of adjustment, tables of data creation method and device |
CN110659293A (en) * | 2019-09-24 | 2020-01-07 | 支付宝(杭州)信息技术有限公司 | Data table determining method and device based on change codes |
CN110659293B (en) * | 2019-09-24 | 2022-02-11 | 支付宝(杭州)信息技术有限公司 | Data table determining method and device based on change codes |
CN112925552A (en) * | 2021-02-26 | 2021-06-08 | 北京百度网讯科技有限公司 | Code processing method, device, equipment and storage medium |
CN112925552B (en) * | 2021-02-26 | 2023-07-28 | 北京百度网讯科技有限公司 | Code processing method, device, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11341155B2 (en) | Mapping instances of a dataset within a data management system | |
US8510338B2 (en) | Indexing information about entities with respect to hierarchies | |
US9646030B2 (en) | Computer-readable medium storing program and version control method | |
CN102279749B (en) | Method and equipment for merging codes | |
US20080133570A1 (en) | Determining boolean logic and operator precedence of query conditions | |
CN104965735A (en) | Apparatus for generating upgrade SQL script | |
US10296505B2 (en) | Framework for joining datasets | |
CN106407360B (en) | Data processing method and device | |
CN104573022A (en) | Data query method and device for HBase | |
CN103810224A (en) | Information persistence and query method and device | |
CN104636471A (en) | Procedure code finding method and device | |
CN105224527A (en) | Be applicable to the general ETL method of multiple object table update mode | |
US9053207B2 (en) | Adaptive query expression builder for an on-demand data service | |
CN111143370B (en) | Method, apparatus and computer-readable storage medium for analyzing relationships between a plurality of data tables | |
CN115543402A (en) | Software knowledge graph increment updating method based on code submission | |
CN105677805A (en) | Data storing and reading method and device using protobuf | |
CN109634585B (en) | Method for adaptively displaying and updating server data based on form | |
CN110866024A (en) | Vector database increment updating method and system | |
CN100527131C (en) | Interdynamic access method and tool of IMS data base | |
CN114385587A (en) | Relational database version snapshot oriented construction method and query method | |
CN108197187A (en) | Optimization method, device, storage medium and the computer equipment of query statement | |
CN110147396B (en) | Mapping relation generation method and device | |
WO2016022019A1 (en) | Method for data input into a database | |
CN111143356B (en) | Report retrieval method and device | |
CN114968348A (en) | Data analysis method and device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20150520 |
|
WD01 | Invention patent application deemed withdrawn after publication |