CN110347394B - Software code analysis method and device - Google Patents

Software code analysis method and device Download PDF

Info

Publication number
CN110347394B
CN110347394B CN201910502555.9A CN201910502555A CN110347394B CN 110347394 B CN110347394 B CN 110347394B CN 201910502555 A CN201910502555 A CN 201910502555A CN 110347394 B CN110347394 B CN 110347394B
Authority
CN
China
Prior art keywords
software code
target
target software
analysis
user terminal
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.)
Active
Application number
CN201910502555.9A
Other languages
Chinese (zh)
Other versions
CN110347394A (en
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.)
Wireless Life Hangzhou Information Technology Co ltd
Original Assignee
Wireless Life Hangzhou 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 Wireless Life Hangzhou Information Technology Co ltd filed Critical Wireless Life Hangzhou Information Technology Co ltd
Priority to CN201910502555.9A priority Critical patent/CN110347394B/en
Publication of CN110347394A publication Critical patent/CN110347394A/en
Application granted granted Critical
Publication of CN110347394B publication Critical patent/CN110347394B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code

Abstract

The disclosure relates to a software code analysis method and device. The method comprises the following steps: calling a camera of a user terminal to shoot a target picture comprising a target software code; carrying out image identification and code structure analysis on the target picture, and determining a UML class diagram corresponding to the target software code; and displaying the UML class diagram corresponding to the target software code on a display screen of the user terminal. According to the method and the device, the camera of the user terminal is called to shoot the target software code, and the target picture comprising the target software code is automatically subjected to image recognition and code structure analysis, so that the UML class diagram corresponding to the target software code is directly obtained and displayed on the display screen, the problem that the UML class diagram cannot be reversely generated for Java codes on non-electronic equipment (such as books and blackboards) in the related art is solved, the operation is simple, and the convenience and the efficiency of code analysis can be improved.

Description

Software code analysis method and device
Technical Field
The disclosure relates to the technical field of intelligent equipment, in particular to a software code analysis method and device.
Background
To facilitate analysis of Java code, a Unified Modeling Language (UML) class diagram is typically generated from the Java code in reverse.
In the related art, a UML class diagram is generated for Java code in a reverse direction, usually using some Integrated Development Environment (IDE) tools for Java Development.
Disclosure of Invention
In order to overcome the problems in the related art, embodiments of the present disclosure provide a method and an apparatus for analyzing a software code. The technical scheme is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a software code parsing method applied to a user terminal, including:
calling a camera of the user terminal to shoot a target picture comprising a target software code;
performing image recognition and code structure analysis on the target picture, and determining a unified modeling language UML class diagram corresponding to the target software code;
and displaying the UML class diagram corresponding to the target software code on a display screen of the user terminal.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: according to the technical scheme, the target software code is shot through the camera of the user terminal, and the target picture comprising the target software code is automatically subjected to image recognition and code structure analysis, so that the UML class diagram corresponding to the target software code is directly obtained and displayed on the display screen, the problem that the UML class diagram cannot be reversely generated by Java codes on non-electronic equipment (such as books and blackboards) in the related art is solved, the operation is simple, and the convenience and the efficiency of code analysis can be improved.
In one embodiment, the performing image recognition and code structure analysis on the target picture to determine a unified modeling language UML class diagram corresponding to the target software code includes:
sending a first analysis request carrying the target picture to a cloud server;
and receiving a first analysis response returned by the cloud server, wherein the first analysis response comprises the UML class diagram corresponding to the target software code.
In one embodiment, the performing image recognition and code structure analysis on the target picture to determine a unified modeling language UML class diagram corresponding to the target software code includes:
performing image recognition on the target picture to acquire the target software code displayed on the target picture;
sending a second analysis request carrying the target software code to a cloud server;
and receiving a second analysis response returned by the cloud server, wherein the second analysis response comprises the UML class diagram corresponding to the target software code.
According to a second aspect of the embodiments of the present disclosure, there is provided a software code parsing method applied to a cloud server, including:
receiving a first analysis request carrying a target picture sent by a user terminal;
responding to the first analysis request, carrying out image recognition on the target picture, and acquiring a target software code displayed on the target picture;
carrying out structural analysis on the target software code, and determining a Unified Modeling Language (UML) class diagram corresponding to the target software code;
and sending a first analysis response to the user terminal, wherein the first analysis response comprises the UML class diagram corresponding to the target software code.
According to a third aspect of the embodiments of the present disclosure, there is provided a software code parsing apparatus including:
the shooting module is used for calling a camera of the user terminal to shoot a target picture comprising a target software code;
the determining module is used for carrying out image identification and code structure analysis on the target picture and determining a Unified Modeling Language (UML) class diagram corresponding to the target software code;
and the display module is used for displaying the UML class diagram corresponding to the target software code on a display screen of the user terminal.
In one embodiment, the determining module includes:
the first sending submodule is used for sending a first analysis request carrying the target picture to a cloud server;
and the first receiving submodule is used for receiving a first analysis response returned by the cloud server, and the first analysis response comprises a UML class diagram corresponding to the target software code.
In one embodiment, the determining module includes:
the identification submodule is used for carrying out image identification on the target picture and acquiring the target software code displayed on the target picture;
the second sending submodule is used for sending a second analysis request carrying the target software code to the cloud server;
and the second receiving submodule is used for receiving a second analysis response returned by the cloud server, and the second analysis response comprises the UML class diagram corresponding to the target software code.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a software code parsing apparatus, including:
the receiving module is used for receiving a first analysis request which is sent by a user terminal and carries a target picture;
the identification module is used for responding to the first analysis request, carrying out image identification on the target picture and acquiring a target software code displayed on the target picture;
the analysis module is used for carrying out structural analysis on the target software code and determining a Unified Modeling Language (UML) class diagram corresponding to the target software code;
and the sending module is used for sending a first analysis response to the user terminal, wherein the first analysis response comprises the UML class diagram corresponding to the target software code.
According to a fifth aspect of the embodiments of the present disclosure, there is provided a software code parsing apparatus including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
calling a camera of the user terminal to shoot a target picture comprising a target software code;
carrying out image recognition and code structure analysis on the target picture, and determining a Unified Modeling Language (UML) class diagram corresponding to the target software code;
and displaying the UML class diagram corresponding to the target software code on a display screen of the user terminal.
According to a sixth aspect of the embodiments of the present disclosure, there is provided a software code parsing apparatus, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
receiving a first analysis request carrying a target picture sent by a user terminal;
responding to the first analysis request, carrying out image recognition on the target picture, and acquiring a target software code displayed on the target picture;
carrying out structural analysis on the target software code, and determining a Unified Modeling Language (UML) class diagram corresponding to the target software code;
and sending a first analysis response to the user terminal, wherein the first analysis response comprises the UML class diagram corresponding to the target software code.
According to a seventh aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the steps of the method of the first aspect described above.
According to an eighth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium having stored thereon computer instructions, which when executed by a processor, implement the steps of the method according to the second aspect.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flowchart illustrating a software code parsing method according to an example embodiment.
FIG. 2 is a flowchart illustrating a software code parsing method according to an example embodiment.
FIG. 3 is a flowchart illustrating a software code parsing method according to an example embodiment.
Fig. 4 is a block diagram illustrating a software code parsing apparatus according to an example embodiment.
Fig. 5 is a block diagram illustrating a software code parsing apparatus according to an example embodiment.
Fig. 6 is a block diagram illustrating a software code parsing apparatus according to an example embodiment.
Fig. 7 is a block diagram illustrating a software code parsing apparatus according to an example embodiment.
Fig. 8 is a block diagram illustrating a software code parsing apparatus according to an example embodiment.
Fig. 9 is a block diagram illustrating a software code parsing apparatus according to an example embodiment.
Fig. 10 is a block diagram illustrating a software code parsing apparatus according to an example embodiment.
Fig. 11 is a block diagram illustrating a software code parsing apparatus according to an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below do not represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
In the related art, a UML class diagram is generated for Java code in reverse, usually using some Java developed IDE tools. However, the related art cannot generate the UML diagram for the Java code on a non-computer (for example, on a book or a blackboard); this makes the operation of the related art complicated, and the convenience and efficiency of code analysis are low.
In order to solve the above problem, an embodiment of the present disclosure provides a software code parsing method, which is applied to a user terminal, and the method includes: calling a camera of a user terminal to shoot a target picture comprising a target software code; carrying out image identification and code structure analysis on the target picture, and determining a UML class diagram corresponding to the target software code; and displaying the UML class diagram corresponding to the target software code on a display screen of the user terminal. According to the software code analysis method provided by the embodiment of the disclosure, the target software code is shot by calling the camera of the user terminal, and the target picture including the target software code is automatically subjected to image recognition and code structure analysis, so that the UML class diagram corresponding to the target software code is directly obtained and displayed on the display screen, the problem that the UML class diagram cannot be reversely generated for the Java code on non-electronic equipment (such as a book and a blackboard) in the related art is solved, the operation is simple, and the convenience and the efficiency of code analysis can be improved.
Based on the above analysis, the following specific examples are proposed.
Fig. 1 is a flowchart illustrating a software code parsing method according to an exemplary embodiment, where an execution subject of the method may be a user terminal; as shown in fig. 1, the method comprises the following steps 101-103:
in step 101, a camera of the user terminal is called to take a target picture including a target software code.
Illustratively, when a user needs to obtain a corresponding UML class diagram of the target software code, a camera of the user terminal is called to perform shooting operation on the target software code, and a target picture with the target software code is obtained through shooting.
In step 102, image recognition and code structure analysis are performed on the target picture, and a UML class diagram corresponding to the target software code is determined.
For example, the step 102 may include any one of the following implementation manners:
in the method 1, a user terminal sends a first analysis request carrying a target picture to a cloud server. Carrying out image recognition and code structure analysis on a target picture comprising a target software code by a cloud server to obtain a UML class diagram corresponding to the target software code; the cloud server sends a first analysis response to the user terminal, wherein the first analysis response comprises the UML class diagram corresponding to the target software code. And the user terminal receives a first analysis response returned by the cloud server.
In the mode 2, the user terminal performs image recognition on the target picture to acquire a target software code displayed on the target picture; and the user terminal sends a second analysis request carrying the target software code to the cloud server. After the code structure of the target software code is analyzed by the cloud server, a UML class diagram corresponding to the target software code is obtained; and the cloud server sends a second analysis response to the user terminal, wherein the second analysis response comprises the UML class diagram corresponding to the target software code. And the user terminal receives a second analysis response returned by the cloud server.
In an alternative scheme, the user terminal performs image recognition on a target picture to acquire a target software code displayed on the target picture; and the user terminal sends a second analysis request carrying the target software code to the cloud server. The cloud server receives a second analysis request sent by the user terminal; the cloud server responds to the second analysis request, carries out structural analysis on the target software code, and determines a UML class diagram corresponding to the target software code; and the cloud server sends a second analysis response to the user terminal, wherein the second analysis response comprises the UML class diagram corresponding to the target software code. And the user terminal receives a second analysis response returned by the cloud server to obtain the UML class diagram corresponding to the target software code.
In step 103, a UML class diagram corresponding to the target software code is displayed on a display screen of the user terminal.
According to the technical scheme provided by the embodiment of the disclosure, the target software code is shot by calling the camera of the user terminal, and the target picture comprising the target software code is automatically subjected to image recognition and code structure analysis, so that the UML class diagram corresponding to the target software code is directly obtained and displayed on the display screen, the problem that the UML class diagram cannot be reversely generated for the Java code on non-electronic equipment (such as books and blackboards) in the related art is solved, the operation is simple, and the convenience and the efficiency of code analysis can be improved.
Fig. 2 is a flowchart illustrating a software code parsing method according to an exemplary embodiment, where an execution subject of the method may be a cloud server; as shown in fig. 2, the method comprises the following steps 201-204:
in step 201, a first parsing request carrying a target picture sent by a user terminal is received.
In step 202, in response to the first parsing request, image recognition is performed on the target picture, and a target software code displayed on the target picture is acquired.
In step 203, the structure of the target software code is analyzed, and the UML class diagram corresponding to the target software code is determined.
In step 204, a first parsing response is sent to the user terminal, where the first parsing response includes the UML class diagram corresponding to the target software code.
According to the technical scheme provided by the embodiment of the disclosure, the target image displayed with the target software code is subjected to image recognition through the cloud server to obtain the target software code, and the target software code is subjected to structural analysis to determine the UML class diagram corresponding to the target software code, so that the user terminal can directly display the UML class diagram corresponding to the target software code on the display screen, the problem that the UML class diagram cannot be reversely generated for the Java code on non-electronic equipment (such as a book and a blackboard) in the related art is solved, an IDE tool capable of generating the UML class diagram from the software code is not required to be installed on the user terminal, the Java code is not required to be copied into the user terminal in advance, the operation is simple, and the convenience and the efficiency of code analysis can be improved.
FIG. 3 is a flow diagram illustrating a method of software code parsing in accordance with an example embodiment. As shown in fig. 3, on the basis of the embodiment shown in fig. 1, the software code parsing method according to the present disclosure may include the following steps 301 to 307:
in step 301, the user terminal calls a camera of the user terminal to take a target picture including the target software code.
For example, a designated App is installed on a user terminal, and a camera of the user terminal is called by the designated App to scan or shoot a target software code on an electronic device or on a non-electronic device (e.g., a book or a blackboard), so as to obtain a target picture including the target software code.
In step 302, the user terminal sends a first parsing request carrying a target picture to the cloud server. The cloud server receives a first analysis request carrying a target picture sent by a user terminal.
In step 303, the cloud server performs image recognition on the target picture in response to the first parsing request, and acquires a target software code displayed on the target picture.
In step 304, the cloud server performs structure analysis on the target software code, and determines a UML class diagram corresponding to the target software code.
In step 305, the cloud server sends a first parsing response to the user terminal, where the first parsing response includes the UML class diagram corresponding to the target software code. The user terminal receives a first analysis response returned by the cloud server.
In step 306, the user terminal obtains the UML class diagram corresponding to the target software code according to the first parsing response.
In step 307, the user terminal displays the UML class diagram corresponding to the target software code on a display screen of the user terminal.
According to the technical scheme provided by the embodiment of the disclosure, the target image displayed with the target software code is subjected to image recognition through the cloud server to obtain the target software code, and the target software code is subjected to structural analysis to determine the UML class diagram corresponding to the target software code, so that the UML class diagram corresponding to the target software code can be directly displayed on the display screen by the user terminal, the software code on the electronic equipment or on the non-electronic equipment (such as a book and a blackboard) can be directly displayed on the display screen by using the user terminal for scanning or shooting, the problem that the UML class diagram cannot be reversely generated by the Java code on the non-electronic equipment in the related technology is solved, an IDE tool capable of generating the UML class diagram by the software code is not required to be installed on the user terminal, the Java code is not required to be copied into the user terminal in advance, the operation is simple, and the convenience and the efficiency of code analysis can be improved.
The following are embodiments of the disclosed apparatus that may be used to perform embodiments of the disclosed methods.
FIG. 4 is a block diagram illustrating a software code parsing apparatus that may be implemented in various ways, such as implementing all components of the apparatus in a user terminal or implementing components of the apparatus in a coupled manner at a user terminal side, according to an example embodiment; the apparatus may implement the method related to the present disclosure through software, hardware, or a combination of the two, as shown in fig. 4, the software code parsing apparatus includes: a shooting module 401, a determining module 402 and a display module 403, wherein:
the shooting module 401 is configured to call a camera of the user terminal to shoot a target picture including a target software code;
the determining module 402 is configured to perform image recognition and code structure analysis on the target picture, and determine a UML class diagram corresponding to the target software code;
the display module 403 is configured to display the UML class diagram corresponding to the target software code on a display screen of the user terminal.
The device provided by the embodiment of the present disclosure can be used for executing the technical solution of the embodiment shown in fig. 1, and the execution mode and the beneficial effects are similar, which are not described herein again.
In one possible implementation, as shown in fig. 5, the software code parsing apparatus shown in fig. 4 may further include a determining module 402 configured to include: a first sending submodule 501 and a first receiving submodule 502, wherein:
the first sending submodule 501 is configured to send a first parsing request carrying a target picture to a cloud server;
the first receiving submodule 502 is configured to receive a first parsing response returned by the cloud server, where the first parsing response includes a UML class diagram corresponding to the target software code.
In one possible embodiment, as shown in fig. 6, the software code parsing apparatus shown in fig. 4 may further include configuring the determining module 402 to include: an identification sub-module 601, a second sending sub-module 602, and a second receiving sub-module 603, wherein:
the identification submodule 601 is configured to perform image identification on a target picture, and acquire a target software code displayed on the target picture;
the second sending submodule 602 is configured to send a second parsing request carrying the target software code to the cloud server;
the second receiving submodule 603 is configured to receive a second parsing response returned by the cloud server, where the second parsing response includes the UML class diagram corresponding to the target software code.
Fig. 7 is a block diagram illustrating a software code parsing apparatus according to an example embodiment, which may be implemented in various ways, such as implementing all components of the apparatus in a cloud server, or implementing components of the apparatus in a coupled manner on the cloud server side; the apparatus may implement the method related to the present disclosure through software, hardware, or a combination of the two, as shown in fig. 7, the software code parsing apparatus includes: a receiving module 701, an identifying module 702, an analyzing module 703 and a sending module 704, wherein:
the receiving module 701 is configured to receive a first parsing request carrying a target picture sent by a user terminal;
the identification module 702 is configured to perform image identification on the target picture in response to the first parsing request, and acquire a target software code displayed on the target picture;
the analysis module 703 is configured to perform structural analysis on the target software code, and determine a UML class diagram corresponding to the target software code;
the sending module 704 is configured to send a first parsing response to the user terminal, where the first parsing response includes the UML class diagram corresponding to the target software code.
The device provided by the embodiment of the present disclosure can be used for executing the technical scheme of the embodiment shown in fig. 2, and the execution mode and the beneficial effect are similar, which are not described herein again.
Fig. 8 is a block diagram illustrating a software code parsing apparatus 800 according to an exemplary embodiment, where the software code parsing apparatus 800 is adapted to a user terminal, and the software code parsing apparatus 800 includes:
a processor 801;
a memory 802 for storing processor-executable instructions;
wherein the processor 801 is configured to:
calling a camera of a user terminal to shoot a target picture comprising a target software code;
carrying out image identification and code structure analysis on the target picture, and determining a UML class diagram corresponding to the target software code;
and displaying the UML class diagram corresponding to the target software code on a display screen of the user terminal.
In one embodiment, the processor 801 may be further configured to:
sending a first analysis request carrying a target picture to a cloud server;
and receiving a first analysis response returned by the cloud server, wherein the first analysis response comprises the UML class diagram corresponding to the target software code.
In one embodiment, the processor 801 may be further configured to:
carrying out image recognition on the target picture to obtain a target software code displayed on the target picture;
sending a second analysis request carrying the target software code to the cloud server;
and receiving a second analysis response returned by the cloud server, wherein the second analysis response comprises the UML class diagram corresponding to the target software code.
Fig. 9 is a block diagram illustrating a software code parsing apparatus 900 according to an exemplary embodiment, where the software code parsing apparatus 900 is suitable for a cloud server, and the software code parsing apparatus 900 includes:
a processor 901;
a memory 902 for storing processor-executable instructions;
wherein the processor 901 is configured to:
receiving a first analysis request carrying a target picture sent by a user terminal;
responding to the first analysis request, carrying out image recognition on the target picture, and acquiring a target software code displayed on the target picture;
carrying out structure analysis on the target software code, and determining a UML class diagram corresponding to the target software code;
and sending a first analysis response to the user terminal, wherein the first analysis response comprises the UML class diagram corresponding to the target software code.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
FIG. 10 is a block diagram illustrating a software code parsing apparatus in accordance with an exemplary embodiment; the software code analysis device 1000 is suitable for a user terminal; the software code parsing apparatus 1000 may include one or more of the following components: processing component 1002, memory 1004, power component 1006, multimedia component 1008, audio component 1010, input/output (I/O) interface 1012, sensor component 1014, and communications component 1016.
The processing component 1002 generally controls the overall operation of the software code parsing device 1000, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 1002 may include one or more processors 1020 to execute instructions to perform all or a portion of the steps of the methods described above. Further, processing component 1002 may include one or more modules that facilitate interaction between processing component 1002 and other components. For example, the processing component 1002 may include a multimedia module to facilitate interaction between the multimedia component 1008 and the processing component 1002.
The memory 1004 is configured to store various types of data to support operations at the software code parsing apparatus 1000. Examples of such data include instructions for any application or method operating on the software code parsing device 1000, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 1004 may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power component 1006 provides power to the various components of the software code parser 1000. The power components 1006 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the software code parsing device 1000.
The multimedia component 1008 includes a screen that provides an output interface between the software code parsing device 1000 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1008 includes a front facing camera and/or a rear facing camera. When the software code analysis device 1000 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 1010 is configured to output and/or input audio signals. For example, the audio component 1010 includes a Microphone (MIC) configured to receive an external audio signal when the software code interpreting device 1000 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 1004 or transmitted via the communication component 1016. In some embodiments, audio component 1010 also includes a speaker for outputting audio signals.
I/O interface 1012 provides an interface between processing component 1002 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 1014 includes one or more sensors for providing status evaluation of various aspects to the software code-parsing device 1000. For example, the sensor component 1014 may detect an open/closed state of the software code-resolving device 1000, a relative positioning of components, such as a display and a keypad of the software code-resolving device 1000, the sensor component 1014 may also detect a change in position of the software code-resolving device 1000 or a component of the software code-resolving device 1000, the presence or absence of user contact with the software code-resolving device 1000, an orientation or acceleration/deceleration of the software code-resolving device 1000, and a change in temperature of the software code-resolving device 1000. The sensor assembly 1014 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 1014 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1014 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 1016 is configured to facilitate communication between the software code parsing apparatus 1000 and other devices in a wired or wireless manner. The software code parsing device 1000 can access a wireless network based on a communication standard, such as WiFi,2G/3G/4G/5G, or a combination thereof. In an exemplary embodiment, the communication component 1016 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communications component 1016 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the software code parsing apparatus 1000 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as the memory 1004 comprising instructions, executable by the processor 1020 of the software code parsing device 1000 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Wherein the instructions in the non-transitory computer readable storage medium, when executed by the processor, enable the software code parsing apparatus 1000 to perform a method comprising:
calling a camera of a user terminal to shoot a target picture comprising a target software code;
carrying out image identification and code structure analysis on the target picture, and determining a UML class diagram corresponding to the target software code;
and displaying the UML class diagram corresponding to the target software code on a display screen of the user terminal.
In one embodiment, performing image recognition and code structure analysis on a target picture, and determining a UML class diagram corresponding to a target software code, includes:
sending a first analysis request carrying a target picture to a cloud server;
and receiving a first analysis response returned by the cloud server, wherein the first analysis response comprises the UML class diagram corresponding to the target software code.
In one embodiment, performing image recognition and code structure analysis on a target picture, and determining a UML class diagram corresponding to a target software code, includes:
carrying out image recognition on the target picture to obtain a target software code displayed on the target picture;
sending a second analysis request carrying the target software code to the cloud server;
and receiving a second analysis response returned by the cloud server, wherein the second analysis response comprises the UML class diagram corresponding to the target software code.
Fig. 11 is a block diagram illustrating a software code parsing apparatus according to an example embodiment. For example, the software code parsing device 1100 can be provided as a cloud server. The software code parsing device 1100 comprises a processing component 1102, which further comprises one or more processors, and memory resources, represented by memory 1103, for storing instructions, e.g. applications, executable by the processing component 1102. The application stored in the memory 1103 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1102 is configured to execute instructions to perform the above-described methods.
The software code parsing device 1100 may further comprise a power component 1106 configured to perform power management of the software code parsing device 1100, a wired or wireless network interface 1105 configured to connect the device 1100 to a network, and an input output (I/O) interface 1108. The software code parser 1100 may operate based on an operating system stored in memory 1103, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, or the like.
A non-transitory computer readable storage medium having instructions therein, which when executed by a processor of a software code parsing device 1100, enable the software code parsing device 1100 to perform a method comprising:
receiving a first analysis request carrying a target picture sent by a user terminal;
responding to the first analysis request, carrying out image recognition on the target picture, and acquiring a target software code displayed on the target picture;
carrying out structure analysis on the target software code, and determining a UML class diagram corresponding to the target software code;
and sending a first analysis response to the user terminal, wherein the first analysis response comprises the UML class diagram corresponding to the target software code.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (8)

1. A software code analysis method is applied to a user terminal, and the method comprises the following steps:
calling a camera of the user terminal to shoot a target picture comprising a target software code, wherein the target software code comprises a Java code;
carrying out image recognition and code structure analysis on the target picture, and determining a Unified Modeling Language (UML) class diagram corresponding to the target software code;
displaying the UML class diagram corresponding to the target software code on a display screen of the user terminal;
the image recognition and code structure analysis are carried out on the target picture, and a unified modeling language UML class diagram corresponding to the target software code is determined, wherein the method comprises the following steps:
sending a first analysis request carrying the target picture to a cloud server; receiving a first analysis response returned by the cloud server, wherein the first analysis response comprises a UML class diagram corresponding to the target software code; or
Performing image recognition on the target picture to acquire the target software code displayed on the target picture; sending a second analysis request carrying the target software code to a cloud server; and receiving a second analysis response returned by the cloud server, wherein the second analysis response comprises the UML class diagram corresponding to the target software code.
2. A software code analysis method is applied to a cloud server, and comprises the following steps:
receiving a first analysis request carrying a target picture or a second analysis request carrying a target software code sent by a user terminal; the target picture is a target picture which is obtained by calling a camera of the user terminal by the user terminal and comprises a target software code; the target software code is displayed on the target picture obtained by the user terminal performing image recognition on the target picture;
responding to the first analysis request, carrying out image recognition on the target picture, and acquiring a target software code displayed on the target picture, or responding to the second analysis request, and directly acquiring the target software code; performing structural analysis on the target software code, and determining a unified modeling language UML class diagram corresponding to the target software code;
sending a first analysis response to the user terminal, wherein the first analysis response comprises the UML class diagram corresponding to the target software code, so that the UML class diagram corresponding to the target software code is displayed on a display screen of the user terminal; wherein the object software code comprises Java code.
3. A software code parsing apparatus, the apparatus comprising:
the shooting module is used for calling a camera of the user terminal to shoot a target picture comprising a target software code, wherein the target software code comprises a Java code;
the determining module is used for carrying out image identification and code structure analysis on the target picture and determining a Unified Modeling Language (UML) class diagram corresponding to the target software code;
a display module, configured to display a UML class diagram corresponding to the target software code on a display screen of the user terminal;
the determining module includes:
the first sending submodule is used for sending a first analysis request carrying the target picture to a cloud server; the first receiving submodule is used for receiving a first analysis response returned by the cloud server, and the first analysis response comprises a UML class diagram corresponding to the target software code; or;
the determining module includes:
the identification submodule is used for carrying out image identification on the target picture and acquiring the target software code displayed on the target picture; the second sending submodule is used for sending a second analysis request carrying the target software code to the cloud server; and the second receiving submodule is used for receiving a second analysis response returned by the cloud server, and the second analysis response comprises the UML class diagram corresponding to the target software code.
4. A software code parsing apparatus, the apparatus comprising:
the receiving module is used for receiving a first analysis request carrying a target picture or a second analysis request carrying a target software code sent by a user terminal; the target picture is a target picture which is obtained by calling a camera of the user terminal by the user terminal and comprises a target software code; the target software code is displayed on the target picture obtained by the user terminal performing image recognition on the target picture; wherein the object software code comprises Java code;
the identification module is used for responding to the first analysis request, carrying out image identification on the target picture and acquiring a target software code displayed on the target picture; or responding to the second analysis request, and directly acquiring the target software code;
the analysis module is used for carrying out structural analysis on the target software code and determining a Unified Modeling Language (UML) class diagram corresponding to the target software code;
a sending module, configured to send a first parsing response to the user terminal, where the first parsing response includes the UML class diagram corresponding to the target software code, so as to display the UML class diagram corresponding to the target software code on a display screen of the user terminal.
5. A software code parsing apparatus, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
calling a camera of a user terminal to shoot a target picture comprising a target software code, wherein the target software code comprises a Java code;
carrying out image recognition and code structure analysis on the target picture, and determining a Unified Modeling Language (UML) class diagram corresponding to the target software code;
displaying the UML class diagram corresponding to the target software code on a display screen of the user terminal;
the image recognition and code structure analysis are carried out on the target picture, and a unified modeling language UML class diagram corresponding to the target software code is determined, wherein the method comprises the following steps:
sending a first analysis request carrying the target picture to a cloud server; receiving a first analysis response returned by the cloud server, wherein the first analysis response comprises a UML class diagram corresponding to the target software code; or
Performing image recognition on the target picture to acquire the target software code displayed on the target picture; sending a second analysis request carrying the target software code to a cloud server; and receiving a second analysis response returned by the cloud server, wherein the second analysis response comprises the UML class diagram corresponding to the target software code.
6. A software code analysis apparatus, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
receiving a first analysis request carrying a target picture or a second analysis request carrying a target software code sent by a user terminal; the target picture is a target picture which is obtained by calling a camera of the user terminal by the user terminal and comprises a target software code; the target software code is displayed on the target picture obtained by the user terminal performing image recognition on the target picture; wherein the object software code comprises Java code;
responding to the first analysis request, carrying out image recognition on the target picture, and acquiring a target software code displayed on the target picture; or responding to the second analysis request, and directly acquiring the target software code;
carrying out structural analysis on the target software code, and determining a Unified Modeling Language (UML) class diagram corresponding to the target software code;
and sending a first analysis response to the user terminal, wherein the first analysis response comprises the UML class diagram corresponding to the target software code, so that the UML class diagram corresponding to the target software code is displayed on a display screen of the user terminal.
7. A computer-readable storage medium having stored thereon computer instructions, which when executed by a processor, perform the steps of the method of claim 1.
8. A computer-readable storage medium having stored thereon computer instructions, which when executed by a processor, perform the steps of the method of claim 2.
CN201910502555.9A 2019-06-11 2019-06-11 Software code analysis method and device Active CN110347394B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910502555.9A CN110347394B (en) 2019-06-11 2019-06-11 Software code analysis method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910502555.9A CN110347394B (en) 2019-06-11 2019-06-11 Software code analysis method and device

Publications (2)

Publication Number Publication Date
CN110347394A CN110347394A (en) 2019-10-18
CN110347394B true CN110347394B (en) 2023-03-10

Family

ID=68181857

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910502555.9A Active CN110347394B (en) 2019-06-11 2019-06-11 Software code analysis method and device

Country Status (1)

Country Link
CN (1) CN110347394B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101729976A (en) * 2009-11-20 2010-06-09 天津市阿波罗信息技术有限公司 Code generating method suitable for Internet access through mobile phone photograph
US8707252B1 (en) * 2008-09-03 2014-04-22 Emc Corporation Techniques for automatic generation of parsing code
CN104391706A (en) * 2014-12-02 2015-03-04 南京大学 Reverse engineering based model base structuring method
WO2015039601A1 (en) * 2013-09-22 2015-03-26 Tencent Technology (Shenzhen) Company Limited Methods, devices, terminal device and systems for pattern recognition
CN105335163A (en) * 2015-11-30 2016-02-17 上海斐讯数据通信技术有限公司 Software code reading method and system
CN107148615A (en) * 2014-11-27 2017-09-08 乐金信世股份有限公司 Computer executable model reverse engineering approach and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100258630A1 (en) * 2009-04-14 2010-10-14 Research In Motion Limited Systems and methods for updating resolved content of a mobile code

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8707252B1 (en) * 2008-09-03 2014-04-22 Emc Corporation Techniques for automatic generation of parsing code
CN101729976A (en) * 2009-11-20 2010-06-09 天津市阿波罗信息技术有限公司 Code generating method suitable for Internet access through mobile phone photograph
WO2015039601A1 (en) * 2013-09-22 2015-03-26 Tencent Technology (Shenzhen) Company Limited Methods, devices, terminal device and systems for pattern recognition
CN107148615A (en) * 2014-11-27 2017-09-08 乐金信世股份有限公司 Computer executable model reverse engineering approach and device
CN104391706A (en) * 2014-12-02 2015-03-04 南京大学 Reverse engineering based model base structuring method
CN105335163A (en) * 2015-11-30 2016-02-17 上海斐讯数据通信技术有限公司 Software code reading method and system

Also Published As

Publication number Publication date
CN110347394A (en) 2019-10-18

Similar Documents

Publication Publication Date Title
US9667774B2 (en) Methods and devices for sending virtual information card
US9800666B2 (en) Method and client terminal for remote assistance
EP3099063A1 (en) Video communication method and apparatus
US9648152B2 (en) Methods and devices for labeling a number
CN107423106B (en) Method and apparatus for supporting multi-frame syntax
EP3147802B1 (en) Method and apparatus for processing information
EP3163884A1 (en) Image acquiring method and apparatus, computer program and recording medium
EP3176776A1 (en) Luminance adjusting method and apparatus, computer program and recording medium
CN108764003B (en) Picture identification method and device
CN106354504B (en) Message display method and device
CN106547547B (en) data acquisition method and device
CN107508573B (en) Crystal oscillator oscillation frequency correction method and device
EP3322227A1 (en) Methods and apparatuses for controlling wireless connection, computer program and recording medium
CN107463372B (en) Data-driven page updating method and device
CN107562500B (en) Debugging device, method and equipment
CN114741292A (en) Test script management method and device, electronic equipment and storage medium
EP3142337A1 (en) Method and apparatus for installing application and smart device using them
CN109992754B (en) Document processing method and device
CN109976872B (en) Data processing method and device, electronic equipment and storage medium
CN111694571B (en) Compiling method and device
EP3190555A1 (en) Method for operating a display device and display
CN110333903B (en) Method and device for determining page loading duration
CN107885464B (en) Data storage method, device and computer readable storage medium
CN110347394B (en) Software code analysis method and device
CN106354595B (en) Mobile terminal, hardware component state detection method and device

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
GR01 Patent grant
GR01 Patent grant