CN110333898A - A kind of code relation generation method, device, electronic equipment and storage medium - Google Patents

A kind of code relation generation method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110333898A
CN110333898A CN201910446541.XA CN201910446541A CN110333898A CN 110333898 A CN110333898 A CN 110333898A CN 201910446541 A CN201910446541 A CN 201910446541A CN 110333898 A CN110333898 A CN 110333898A
Authority
CN
China
Prior art keywords
code
relation
variable
module
function
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
CN201910446541.XA
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.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN201910446541.XA priority Critical patent/CN110333898A/en
Publication of CN110333898A publication Critical patent/CN110333898A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/75Structural analysis for program understanding

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the invention provides a kind of code relation generation method, device, electronic equipment and storage mediums, specially carry out global code scanning to program code to be analyzed, obtain multiple primary variables;Judge the action type of the execution function of each primary variable;The call relation between code module is generated according to all action types for executing function and preset functions of modules and service database, visual code relation map is generated according to the call relation between code module.This programme utilizes the discovery of conversed analysis method and the non-characterization interactive relation of location code, and introduce code function and service logic, ultimately generate can clear, whole call relations in accurate description program code relation maps, to enable programmers to that easily program code is modified or adjusted.

Description

A kind of code relation generation method, device, electronic equipment and storage medium
Technical field
This disclosure relates to which computer software technical field more particularly to a kind of code relation generation method, device, electronics are set Standby and storage medium.
Background technique
There is different relationships between different code in computer software, analyzing and describe these relationships can be code Use provide convenience.Currently, the relationship between code mainly realizes that this mode can not expire by characterizing the analysis of layer The use demand of the current code relation of foot.
Summary of the invention
For clarity, the interactive relation in accurate description program code, the disclosure provide a kind of code relation generation method, Device, electronic equipment and storage medium.
In a first aspect, providing a kind of code relation generation method, optionally, comprising:
Whole scan program code to be analyzed obtains multiple primary variables;
Identify the action type of the execution function of each primary variable;
It is generated between code module according to all action types for executing function and preset functional module knowledge base Call relation, visual code relation map is generated according to the call relation.
Optionally, the primary variable includes the variable defined for the first time in said program code, and the primary variable is also Including the variable established by java standard library or general open source library.
Optionally, the action type of the execution function of each primary variable of judgement, comprising:
For the basic underlying variables in the primary variable, institute is judged to its assignment or reading according to the execution function State action type;
For the variable that the primary variable Plays library or general open source library are established, according to pre-defined function function Dictionary judges the action type.
Optionally, described to generate generation according to all action types for executing function and preset functional module knowledge base Call relation between code module, comprising:
For each primary variable, called according to the basis that the action type searches the primary variable;
It calls reversely to recall for starting point with each basis and successively searches corresponding upstream calling, to obtain the tune With relationship.
Optionally, further includes:
The functional module knowledge base is extracted from daily code module deployment record.
Second aspect provides a kind of code relation generating means, comprising:
Primary variable analysis module is configured as whole scan program code to be analyzed, obtains multiple primary variables;
Variable operates determination module, is configured to identify the action type of the execution function of each primary variable;
Interactive relation visualization model is configured as according to all action types and preset function for executing function Module knowledge base generates the call relation between code module, generates visual code relation figure according to the call relation Spectrum.
Optionally, the primary variable includes the variable defined for the first time in said program code, and the primary variable is also Including the variable established by java standard library or general open source library.
Optionally, the variable operation determination module includes:
First judging unit is configured as the basic underlying variables in the primary variable, according to the execution function pair Its assignment or reading judges the action type;
Second judging unit is configured as the change established for the primary variable Plays library or general open source library Amount, judges the action type according to pre-defined function function dictionary.
Optionally, the interactive relation visualization model includes:
First searching unit, is configured as each primary variable, searches the original according to the action type It calls on the basis for the amount of changing;
Second searching unit is configured as calling reversely to recall for starting point with each basis successively searching on corresponding Trip is called, to obtain the call relation.
Optionally, further includes:
Database deployment module is configured as disposing in record extracting the functional module knowledge from daily code module Library.
The third aspect provides a kind of electronic equipment, comprising:
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to executing code relation map generation method as described in relation to the first aspect.
Fourth aspect provides a kind of non-transitorycomputer readable storage medium, when the instruction in the storage medium by When the processor of mobile terminal executes, so that mobile terminal is able to carry out code relation generation method as described in relation to the first aspect.
5th aspect, provides a kind of application program, including the step in code relation generation method as described in relation to the first aspect Suddenly.
The technical scheme provided by this disclosed embodiment can include the following benefits: this programme utilizes conversed analysis side Method discovery and the non-characterization interactive relation of location code, and code function and service logic are introduced, ultimately generating can be clear, accurate Ground describes in program code the code relation map of whole call relations, thus enable programmers to easily to program code into Row modification or adjustment.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not The disclosure can be limited.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows and meets implementation of the invention Example, and be used to explain the principle of the present invention together with specification.
Fig. 1 is a kind of flow chart of code relation generation method shown according to an exemplary embodiment;
Fig. 2 is a kind of schematic diagram of visual code relation shown according to an exemplary embodiment;
Fig. 3 is the flow chart of another code relation generation method shown according to an exemplary embodiment;
Fig. 4 is a kind of block diagram of code relation generating means shown according to an exemplary embodiment;
Fig. 5 is the block diagram of another code relation generating means shown according to an exemplary embodiment;
Fig. 6 is the block diagram of a kind of electronic equipment shown according to an exemplary embodiment;
Fig. 7 is the block diagram of another electronic equipment shown according to an exemplary embodiment.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment Described in embodiment do not represent all embodiments consistented with the present invention.On the contrary, they be only with it is such as appended The example of device and method being described in detail in claims, some aspects of the invention are consistent.
Fig. 1 is a kind of flow chart of code relation generation method shown according to an exemplary embodiment, as shown in Figure 1, The code relation generation method is for including the following steps in server, terminal or one-of-a-kind system.
S1, it scans to obtain multiple primary variables by global code.
Primary variable is defines for the first time in some class, rather than the variable of example or reference from other classes, to original The operation for the amount of changing is entirely encapsulated in the class method for defining the variable, will not be generated to the calling outside class;In addition, being clear The boundary of code interaction analysis, the variable using the creation in java standard library and general open source library are also considered as primary variable.
It here, is that corresponding primary change is obtained by way of carrying out global code scanning to program code to be analyzed Amount, and all primary variables are generated into corresponding primary variable list.
Consider that code calling is tree-shaped relationship, analyzes and position the purpose of primary variable, find code call relation Leaf node, then again using such leaf node as starting point (each primary variable operates one by one), reversed retrospective search upstream tune With, and the get or set of the primary variable are operated according to upstream caller, can confirm caller dependence (get according to Rely in set).
The action type for executing function of S2, the primary variable of identification.
Obtain include multiple primary variables primary variable list after, determine wherein each primary variable read-write (get/ Set) the specific execution function operated, this class function determine the dependence of upstream caller: the calling of get generic operation function Side relies on the function call side set in logic, and the action type for accordingly executing function is judged by above-mentioned rule.
Basic underlying variables in primary variable, such as integer floating type can be sentenced according to function to its assignment or reading Break its action type;And for the variable of the creation by java standard library or general open source library, read-write operation is by open interface Definition, for example, the put/add/push of List class is operated, the operation such as get/hget/set/hset of Redis database can lead to The mode for crossing pre-defined function function dictionary determines.
S3, code relation map is generated according to action type and functional module knowledge base.
The information lists such as functions of modules knowledge base, the i.e. module type of stzwctlrred definition, affiliated project and deployment further include The information such as the affiliated business/department of code module, code module owner/guardian.In the execution for the primary variable for determining code On the basis of the action type of function, the terminal node that positioning confirmation code module calls, and reverse search, to obtain code Call relation between module.On the basis of call relation between clear code module, by way of visualization output Visual code relation map is exported, it is specific as shown in Fig. 2, including corresponding service level and department's level in the map Interactive relation.
Specifically, the basis for generating the code relation map is that the calling obtained between the functional module of program code is closed System, according to noted earlier, when determining that the call relation between functional module passes through here, first against each primary variable, root It is called according to the basis that action type searches each primary variable, i.e. the leaf node of call relation;Then, each leaf is being obtained On the basis of node, calls reversely to recall for starting point with each basis and successively search corresponding upstream calling, to make final obtain To code relation map be able to reflect the complete call relation of each functional module.
It can be seen from the above technical proposal that present embodiments providing a kind of code relation generation method, specially treat The program code of analysis carries out global code scanning, obtains multiple primary variables;Judge the execution function of each primary variable Action type;The tune between code module is generated according to all action types for executing function and preset functional module knowledge base With relationship, visual code relation map is generated according to the call relation.This programme using conversed analysis method discovery and The non-characterization interactive relation of location code, and code function and service logic are introduced, ultimately generating being capable of clear, accurate description program The code relation map of whole call relations in code, to enable programmers to that easily program code is modified or adjusted It is whole.
Fig. 3 is the flow chart of another code relation generation method shown according to an exemplary embodiment, such as Fig. 3 institute Show, the code relation generation method is for including the following steps in server, terminal or one-of-a-kind system.
S0, constructing function module knowledge base.
Specifically, which can be disposed record by daily code module and extract corresponding information building. It include corresponding module function and business information, the as module type of stzwctlrred definition, affiliated project in functional module knowledge base With deployment etc., further include the information such as the affiliated business/department of module, module owner/guardian, specific functions of modules knowledge base As shown in table 1.
Table 1
The content of functional module knowledge base indicates information as the extension of code interactive relation, can close from basic code interaction System expands to the level of inter-sectional code interactive relation.
S1, it scans to obtain multiple primary variables by global code.
Primary variable is defines for the first time in some class, rather than the variable of example or reference from other classes, to original The operation for the amount of changing is entirely encapsulated in the class method for defining the variable, will not be generated to the calling outside class;In addition, being clear The boundary of code interaction analysis, the variable using the creation in java standard library and general open source library are also considered as primary variable.
It here, is that corresponding primary change is obtained by way of carrying out global code scanning to program code to be analyzed Amount, and all primary variables are generated into corresponding primary variable list.
Consider that code calling is tree-shaped relationship, analyzes and position the purpose of primary variable, find code call relation Leaf node, then again using such leaf node as starting point (each primary variable operates one by one), reversed retrospective search upstream tune With, and the get or set of the primary variable are operated according to upstream caller, can confirm caller dependence (get according to Rely in set).
The action type for executing function of S2, the primary variable of identification.
Obtain include multiple primary variables primary variable list after, determine wherein each primary variable read-write (get/ Set) the specific execution function operated, this class function determine the dependence of upstream caller: the calling of get generic operation function Side relies on the function call side set in logic, and the action type for accordingly executing function is judged by above-mentioned rule.
Basic underlying variables in primary variable, such as integer floating type can be sentenced according to function to its assignment or reading Break its action type;And for the variable of the creation by java standard library or general open source library, read-write operation is by open interface Definition, for example, the put/add/push of List class is operated, the operation such as get/hget/set/hset of Redis database can lead to The mode for crossing pre-defined function function dictionary determines.
S3, code relation map is generated according to action type and functional module knowledge base.
The information lists such as functions of modules knowledge base, the i.e. module type of stzwctlrred definition, affiliated project and deployment further include The information such as the affiliated business/department of code module, code module owner/guardian.In the execution for the primary variable for determining code On the basis of the action type of function, the terminal node that positioning confirmation code module calls, and reverse search, to obtain code Call relation between module.On the basis of call relation between clear code module, by way of visualization output Visual code relation map is exported, it is specific as shown in Fig. 2, including corresponding service level and department's level in the map Interactive relation to get the code relation map arrived can coded description pass through data base read-write, file read-write and remote service Call the interactive relation generated.
Specifically, the basis for generating the code relation map is that the calling obtained between the functional module of program code is closed System, according to noted earlier, when determining that the call relation between functional module passes through here, first against each primary variable, root It is called according to the basis that action type searches each primary variable, i.e. the leaf node of call relation;Then, each leaf is being obtained On the basis of node, calls reversely to recall for starting point with each basis and successively search corresponding upstream calling, to make final obtain To code relation map be able to reflect the complete call relation of each functional module.
It can be seen from the above technical proposal that present embodiments providing a kind of code relation generation method, specially treat The program code of analysis carries out global code scanning, obtains multiple primary variables;Judge the execution function of each primary variable Action type;The tune between code module is generated according to all action types for executing function and preset functional module knowledge base With relationship;Visual code relation map is generated according to the call relation between code module.This programme utilizes conversed analysis Method discovery and the non-characterization interactive relation of location code, and code function and service logic are introduced, ultimately generating can be clear, quasi- Really in description program code whole call relations code relation map, thus enable programmers to easily to program code into Row modification or adjustment.
Obtained in a upper specific embodiment code relation map be based on functional module knowledge base be to have been built up this One it is assumed that and present embodiment is then not required to based on this it is assumed that i.e. regardless of whether knowing in the presence of the functional module constructed in advance Goal of the invention of the invention can be realized by knowing library, so that present embodiment is more perfect.
Fig. 4 is a kind of block diagram of code relation generating means shown according to an exemplary embodiment, as shown in figure 4, should Code relation generating means are used in server, terminal or one-of-a-kind system, including the operation of primary variable analysis module 10, variable Determination module 20 and interactive relation visualization model 30.
Primary variable analysis module is configured as scanning to obtain multiple primary variables by global code.
Primary variable is defines for the first time in some class, rather than the variable of example or reference from other classes, to original The operation for the amount of changing is entirely encapsulated in the class method for defining the variable, will not be generated to the calling outside class;In addition, being clear The boundary of code interaction analysis, the variable using the creation in java standard library and general open source library are also considered as primary variable.
It here, is that corresponding primary change is obtained by way of carrying out global code scanning to program code to be analyzed Amount, and all primary variables are generated into corresponding primary variable list.
Consider that code calling is tree-shaped relationship, analyzes and position the purpose of primary variable, find code call relation Leaf node, then again using such leaf node as starting point (each primary variable operates one by one), reversed retrospective search upstream tune With, and the get or set of the primary variable are operated according to upstream caller, can confirm caller dependence (get according to Rely in set).
Variable operation determination module is configured as identifying the action type of the execution function of primary variable.
Obtain include multiple primary variables primary variable list after, determine wherein each primary variable read-write (get/ Set) the specific execution function operated, this class function determine the dependence of upstream caller: the calling of get generic operation function Side relies on the function call side set in logic, and the action type for accordingly executing function is judged by above-mentioned rule.
The module specifically includes the first judging unit and the second judging unit, and the first judging unit is used for for primary variable In basic underlying variables, such as integer floating type can determine whether its action type according to function to its assignment or reading;And second Judging unit is used for the variable for the creation by java standard library or general open source library, and read-write operation is determined by open interface Justice, for example, the put/add/push of List class is operated, the operation such as get/hget/set/hset of Redis database can pass through The mode of pre-defined function function dictionary determines.
Interactive relation visualization model is configured as generating code relation figure according to action type and functional module knowledge base Spectrum.
The information lists such as functions of modules knowledge base, the i.e. module type of stzwctlrred definition, affiliated project and deployment further include The information such as the affiliated business/department of code module, code module owner/guardian.In the execution for the primary variable for determining code On the basis of the action type of function, the terminal node that positioning confirmation code module calls, and reverse search, to obtain code Call relation between module.On the basis of call relation between clear code module, by way of visualization output Visual code relation map is exported, it is specific as shown in Fig. 2, including corresponding service level and department's level in the map Interactive relation to get the code relation map arrived can coded description pass through data base read-write, file read-write and remote service Call the interactive relation generated.
Specifically, the basis for generating the code relation map is that the calling obtained between the functional module of program code is closed System, therefore, which includes but is not limited to the first searching unit and the second searching unit, according to front institute It states, when determining that the call relation between functional module passes through here, the first searching unit is used to be directed to each primary variable, according to The basis that action type searches each primary variable is called, i.e. the leaf node of call relation;Second searching unit is used to obtain To on the basis of each leaf node, calls reversely to recall for starting point with each basis and successively search corresponding upstream calling, from And finally obtained code relation map is made to be able to reflect the complete call relation of each functional module.
It can be seen from the above technical proposal that present embodiments providing a kind of code relation map generation method, specially Global code scanning is carried out to program code to be analyzed, obtains multiple primary variables;Judge the execution letter of each primary variable Several action types;It is generated between code module according to all action types for executing function and preset functional module knowledge base Call relation;Visual code relation map is generated according to the call relation between code module.This programme is using inversely Analysis method discovery and the non-characterization interactive relation of location code, and code function and service logic are introduced, ultimately generating can be clear Clear, whole call relations in accurate description program code code relation maps, to enable programmers to easily to program Code is modified or is adjusted.
In addition, the code relation map generating means further include database in this application in a specific embodiment Deployment module 40, as shown in Figure 5.
The database deployment module is configured as constructing function module knowledge base.
Specifically, which can be disposed record by daily code module and extract corresponding information building. It include corresponding module function and business information, the as module type of stzwctlrred definition, affiliated project in functional module knowledge base With deployment etc., further include the information such as the affiliated business/department of module, module owner/guardian.
The content of functional module knowledge base indicates information as the extension of code interactive relation, can close from basic code interaction System expands to the level of inter-sectional code interactive relation.It is based on function that the code relation map is obtained in a upper specific embodiment Can module knowledge base be have been built up this it is assumed that and present embodiment be then not required to based on this it is assumed that i.e. regardless of whether Goal of the invention of the invention can be realized in the presence of the functional module knowledge base constructed in advance, so that present embodiment It is more perfect.
Fig. 6 is the block diagram of a kind of electronic equipment shown according to an exemplary embodiment.
For example, electronic equipment 600 can be mobile phone, computer, digital broadcasting terminal, messaging device, game Console, tablet device, Medical Devices, body-building equipment, the mobile terminals such as personal digital assistant.
Electronic equipment 600 may include following one or more components: processing component 602, memory 604, electric power assembly 606, multimedia component 609, audio component 610, the interface 612 of input/output (I/O), sensor module 614, and communication Component 616.
The integrated operation of the usual controlling electronic devices 600 of processing component 602, such as with display, call, data are logical Letter, camera operation and record operate associated operation.Processing component 602 may include one or more processors 620 to hold Row instruction, to perform all or part of the steps of the methods described above.In addition, processing component 602 may include one or more moulds Block, convenient for the interaction between processing component 602 and other assemblies.For example, processing component 602 may include multi-media module, with Facilitate the interaction between multimedia component 609 and processing component 602.
Memory 604 is configured as storing various types of data to support the operation in equipment 600.These data are shown Example includes the instruction of any application or method for operating on electronic equipment 600, contact data, telephone directory number According to, message, picture, video etc..Memory 604 can by any kind of volatibility or non-volatile memory device or they Combination realize, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM) is erasable Programmable read only memory (EPROM), programmable read only memory (PROM), read-only memory (ROM), magnetic memory, quick flashing Memory, disk or CD.
Power supply module 606 provides electric power for the various assemblies of electronic equipment 600.Power supply module 606 may include power supply pipe Reason system, one or more power supplys and other with for electronic equipment 600 generate, manage, and distribute the associated component of electric power.
Multimedia component 609 includes the screen of one output interface of offer between the electronic equipment 600 and user. In some embodiments, screen may include liquid crystal display (LCD) and touch panel (TP).If screen includes touch surface Plate, screen may be implemented as touch screen, to receive input signal from the user.Touch panel includes one or more touches Sensor is to sense the gesture on touch, slide, and touch panel.The touch sensor can not only sense touch or sliding The boundary of movement, but also detect duration and pressure associated with the touch or slide operation.In some embodiments, Multimedia component 609 includes a front camera and/or rear camera.When equipment 600 is in operation mode, as shot mould When formula or video mode, front camera and/or rear camera can receive external multi-medium data.Each preposition camera shooting Head and rear camera can be a fixed optical lens system or have focusing and optical zoom capabilities.
Audio component 610 is configured as output and/or input audio signal.For example, audio component 610 includes a Mike Wind (MIC), when electronic equipment 600 is in operation mode, when such as call mode, recording mode, and voice recognition mode, microphone It is configured as receiving external audio signal.The received audio signal can be further stored in memory 604 or via logical Believe that component 616 is sent.In some embodiments, audio component 610 further includes a loudspeaker, is used for output audio signal.
I/O interface 612 provides interface between processing component 602 and peripheral interface module, and above-mentioned peripheral interface module can To be keyboard, click wheel, button etc..These buttons may include, but are not limited to: home button, volume button, start button and lock Determine button.
Sensor module 614 includes one or more sensors, for providing the state of various aspects for electronic equipment 600 Assessment.For example, sensor module 614 can detecte the state that opens/closes of equipment 600, the relative positioning of component, such as institute The display and keypad that component is electronic equipment 600 are stated, sensor module 614 can also detect electronic equipment 600 or electronics The position change of 600 1 components of equipment, the existence or non-existence that user contacts with electronic equipment 600,600 orientation of electronic equipment Or the temperature change of acceleration/deceleration and electronic equipment 600.Sensor module 614 may include proximity sensor, be configured to It detects the presence of nearby objects without any physical contact.Sensor module 614 can also include optical sensor, such as CMOS or ccd image sensor, for being used in imaging applications.In some embodiments, which can be with Including acceleration transducer, gyro sensor, Magnetic Sensor, pressure sensor or temperature sensor.
Communication component 616 is configured to facilitate the communication of wired or wireless way between electronic equipment 600 and other equipment. Electronic equipment 600 can access the wireless network based on communication standard, such as WiFi, carrier network (such as 2G, 3G, 4G or 5G), Or their combination.In one exemplary embodiment, communication component 616 receives via broadcast channel and comes from external broadcasting management The broadcast singal or broadcast related information of system.In one exemplary embodiment, the communication component 616 further includes that near field is logical (NFC) module is believed, to promote short range communication.For example, radio frequency identification (RFID) technology, infrared data association can be based in NFC module Meeting (IrDA) technology, ultra wide band (UWB) technology, bluetooth (BT) technology and other technologies are realized.
In the exemplary embodiment, electronic equipment 600 can be by one or more application specific integrated circuit (ASIC), number Word signal processor (DSP), digital signal processing appts (DSPD), programmable logic device (PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic components are realized, for executing such as Fig. 1 or generation shown in Fig. 3 Code relationship generation method.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instruction, example are additionally provided It such as include the memory 604 of instruction, above-metioned instruction can be executed by the processor 620 of electronic equipment 600 to complete the above method.Example Such as, the non-transitorycomputer readable storage medium can be ROM, random access memory (RAM), CD-ROM, tape, soft Disk and optical data storage devices etc..
Fig. 7 is the block diagram of another electronic equipment shown according to an exemplary embodiment.
For example, electronic equipment 700 may be provided as a server, including processing component 722, it further comprise one Or multiple processors, and the memory resource as representated by memory 732, it can be by the execution of processing component 722 for storing Instruction, such as application program.
The application program stored in memory 732 may include it is one or more each correspond to one group of instruction Module.In addition, processing component 722 is configured as executing instruction, to execute such as Fig. 1 or code relation generation side shown in Fig. 3 Method.Electronic equipment 700 can also include a power supply module 726 be configured as execute electronic equipment 700 power management, one Wired or wireless network interface 750 is configured as electronic equipment 700 being connected to network and input and output (I/O) interface 758.Electronic equipment 700 can be operated based on the operating system for being stored in memory 732, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or similar.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to of the invention its Its embodiment.This application is intended to cover any variations, uses, or adaptations of the invention, these modifications, purposes or Person's adaptive change follows general principle of the invention and including the undocumented common knowledge in the art of the disclosure Or conventional techniques.The description and examples are only to be considered as illustrative, and true scope and spirit of the invention are by following Claim is pointed out.
It should be understood that the present invention is not limited to the precise structure already described above and shown in the accompanying drawings, and And various modifications and changes may be made without departing from the scope thereof.The scope of the present invention is limited only by the attached claims.

Claims (10)

1. a kind of code relation generation method characterized by comprising
Whole scan program code to be analyzed obtains multiple primary variables;
Identify the action type of the execution function of each primary variable;
The tune between code module is generated according to all action types for executing function and preset functional module knowledge base Visual code relation map is generated with relationship, and according to the call relation.
2. code relation generation method as described in claim 1, which is characterized in that the primary variable includes described program generation The variable defined for the first time in code further includes the variable established by java standard library or general open source library.
3. code relation generation method as described in claim 1, which is characterized in that each primary variable of judgement Execute the action type of function, comprising:
For the basic underlying variables in the primary variable, the behaviour is judged to its assignment or reading according to the execution function Make type;
For the variable that the primary variable Plays library or general open source library are established, according to pre-defined function function dictionary Judge the action type.
4. code relation generation method as described in claim 1, which is characterized in that described described to execute functions according to all Action type and preset functional module knowledge base generate the call relation between code module, comprising:
For each primary variable, called according to the basis that the action type searches the primary variable;
It calls reversely to recall for starting point with each basis and successively searches corresponding upstream calling, closed to obtain the calling System.
5. such as the described in any item code relation generation methods of Claims 1 to 4, which is characterized in that further include:
The functional module knowledge base is extracted from daily code module deployment record.
6. a kind of code relation generating means characterized by comprising
Primary variable analysis module is configured as carrying out global code scanning to program code to be analyzed, obtain multiple primary Variable;
Variable operates determination module, is configured to judge the action type of the execution function of each primary variable;
Interactive relation visualization model is configured as according to all action types and preset functional module for executing function Knowledge base generates the call relation between code module, and generates visual code relation map according to the call relation.
7. code relation generating means as claimed in claim 6, which is characterized in that the primary variable includes described program generation The variable defined for the first time in code, the primary variable further include the variable established by java standard library or general open source library.
8. code relation generating means as claimed in claim 6, which is characterized in that the variable operates determination module and includes:
First judging unit, is configured as the basic underlying variables in the primary variable, according to the execution function to its Assignment or reading judge the action type;
Second judging unit is configured as the variable established for the primary variable Plays library or general open source library, The action type is judged according to pre-defined function function dictionary.
9. a kind of electronic equipment characterized by comprising
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to executing code relation generation method as claimed in any one of claims 1 to 5.
10. a kind of non-transitorycomputer readable storage medium, which is characterized in that when the instruction in the storage medium is by moving When the processor of terminal executes, so that mobile terminal is able to carry out code relation as claimed in any one of claims 1 to 5 and generates Method.
CN201910446541.XA 2019-05-27 2019-05-27 A kind of code relation generation method, device, electronic equipment and storage medium Pending CN110333898A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910446541.XA CN110333898A (en) 2019-05-27 2019-05-27 A kind of code relation generation method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910446541.XA CN110333898A (en) 2019-05-27 2019-05-27 A kind of code relation generation method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110333898A true CN110333898A (en) 2019-10-15

Family

ID=68140259

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910446541.XA Pending CN110333898A (en) 2019-05-27 2019-05-27 A kind of code relation generation method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110333898A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110879722A (en) * 2019-11-27 2020-03-13 京东数字科技控股有限公司 Method and device for generating logic schematic diagram and computer storage medium
CN111638907A (en) * 2020-04-20 2020-09-08 北京达佳互联信息技术有限公司 Method, device, terminal and storage medium for replacing third-party code segment
CN112181370A (en) * 2020-09-17 2021-01-05 武汉联影医疗科技有限公司 Data interaction relation generation method, computer equipment and storage medium
CN112364107A (en) * 2020-11-10 2021-02-12 平安普惠企业管理有限公司 System analysis visualization method and device, electronic equipment and computer readable storage medium
CN112783720A (en) * 2021-01-05 2021-05-11 广州品唯软件有限公司 Topological structure diagram generation method and device, computer equipment and display system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508689A (en) * 2011-11-08 2012-06-20 上海交通大学 Data processing system capable of maintaining dependency relationship in advanced language program data flow diagram extraction
US20140109106A1 (en) * 2012-10-17 2014-04-17 Microsoft Corporation Code dependency calculation
CN103902255A (en) * 2012-12-24 2014-07-02 腾讯科技(深圳)有限公司 Generating method and system of function relationship call tree
CN107545030A (en) * 2017-07-17 2018-01-05 阿里巴巴集团控股有限公司 Processing method, device and the equipment of data genetic connection
CN109101410A (en) * 2017-06-20 2018-12-28 北京明略软件系统有限公司 A kind of risk driven test method and device and computer readable storage medium
CN109522192A (en) * 2018-10-17 2019-03-26 北京航空航天大学 A kind of prediction technique of knowledge based map and complex network combination

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508689A (en) * 2011-11-08 2012-06-20 上海交通大学 Data processing system capable of maintaining dependency relationship in advanced language program data flow diagram extraction
US20140109106A1 (en) * 2012-10-17 2014-04-17 Microsoft Corporation Code dependency calculation
CN103902255A (en) * 2012-12-24 2014-07-02 腾讯科技(深圳)有限公司 Generating method and system of function relationship call tree
CN109101410A (en) * 2017-06-20 2018-12-28 北京明略软件系统有限公司 A kind of risk driven test method and device and computer readable storage medium
CN107545030A (en) * 2017-07-17 2018-01-05 阿里巴巴集团控股有限公司 Processing method, device and the equipment of data genetic connection
CN109522192A (en) * 2018-10-17 2019-03-26 北京航空航天大学 A kind of prediction technique of knowledge based map and complex network combination

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110879722A (en) * 2019-11-27 2020-03-13 京东数字科技控股有限公司 Method and device for generating logic schematic diagram and computer storage medium
CN110879722B (en) * 2019-11-27 2020-12-22 京东数字科技控股有限公司 Method and device for generating logic schematic diagram and computer storage medium
CN111638907A (en) * 2020-04-20 2020-09-08 北京达佳互联信息技术有限公司 Method, device, terminal and storage medium for replacing third-party code segment
CN112181370A (en) * 2020-09-17 2021-01-05 武汉联影医疗科技有限公司 Data interaction relation generation method, computer equipment and storage medium
CN112181370B (en) * 2020-09-17 2023-02-28 武汉联影医疗科技有限公司 Data interaction relation generation method, computer equipment and storage medium
CN112364107A (en) * 2020-11-10 2021-02-12 平安普惠企业管理有限公司 System analysis visualization method and device, electronic equipment and computer readable storage medium
WO2022100032A1 (en) * 2020-11-10 2022-05-19 平安普惠企业管理有限公司 System analysis visualization method and apparatus, electronic device, and computer readable storage medium
CN112783720A (en) * 2021-01-05 2021-05-11 广州品唯软件有限公司 Topological structure diagram generation method and device, computer equipment and display system
CN112783720B (en) * 2021-01-05 2023-05-19 广州品唯软件有限公司 Topology structure diagram generation method, device, computer equipment and display system

Similar Documents

Publication Publication Date Title
CN110333898A (en) A kind of code relation generation method, device, electronic equipment and storage medium
CN109389162B (en) Sample image screening technique and device, electronic equipment and storage medium
EP3171270A1 (en) Method and device for information push
CN105975156B (en) Application interface display methods and device
CN104636453B (en) The recognition methods of disabled user's data and device
CN109117874A (en) Operation behavior prediction technique and device
CN105956067B (en) Resource search method and device
CN109961791A (en) A kind of voice information processing method, device and electronic equipment
CN108307308B (en) Positioning method, device and storage medium for wireless local area network equipment
CN106157602A (en) The method and apparatus of calling vehicle
KR20170038178A (en) Method, apparatus, and mobile terminal for identificating fingerprint
CN106537288B (en) The method and device of self-starting is applied in control
CN109039877A (en) A kind of method, apparatus, electronic equipment and storage medium showing unread message quantity
CN107783715A (en) Using startup method and device
CN109446323A (en) Information aggregation method, device and equipment
CN105589575B (en) Input method call method and device
CN106775240B (en) Triggering method, device and the terminal of application program
CN106156299B (en) The subject content recognition methods of text information and device
CN105101410B (en) A kind of method and device in determining mobile terminal geographical location
CN106101372B (en) Using prompting setting method and device
CN109447124B (en) Image classification method, device, electronic equipment and storage medium
CN109842688A (en) A kind of content recommendation method, device, electronic equipment and storage medium
CN106453981B (en) Electronic equipment method for processing voice messages and device
CN105988602B (en) Mouse emulation method and apparatus
CN109413337A (en) Video Rendering method, apparatus, electronic equipment 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20191015

RJ01 Rejection of invention patent application after publication