CN105988801B - Method and device for displaying annotation information - Google Patents

Method and device for displaying annotation information Download PDF

Info

Publication number
CN105988801B
CN105988801B CN201510080488.8A CN201510080488A CN105988801B CN 105988801 B CN105988801 B CN 105988801B CN 201510080488 A CN201510080488 A CN 201510080488A CN 105988801 B CN105988801 B CN 105988801B
Authority
CN
China
Prior art keywords
program
information
displaying
steps
flow
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
CN201510080488.8A
Other languages
Chinese (zh)
Other versions
CN105988801A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201510080488.8A priority Critical patent/CN105988801B/en
Publication of CN105988801A publication Critical patent/CN105988801A/en
Application granted granted Critical
Publication of CN105988801B publication Critical patent/CN105988801B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses a method and a device for displaying annotation information, and belongs to the field of computers. The method comprises the following steps: acquiring step description information and step flow relation information of a program from a program file of the program, wherein the step description information comprises operation types and description information of all steps in the program, and the step flow relation information comprises flow relations among all steps in the program; drawing a flow chart of the program according to the step description information and the step flow relation information of the program; and taking the flow chart as the annotation information of the program, and displaying the annotation information of the program. The device comprises: the device comprises an acquisition module, a creation module and a display module. The invention can improve the efficiency of acquiring information.

Description

Method and device for displaying annotation information
Technical Field
The present invention relates to the field of computers, and in particular, to a method and an apparatus for displaying annotation information.
Background
At present, after a programmer writes a program, the programmer can transfer the program to a tester for testing, and the tester needs to know the logic and functions of program execution before testing.
In order to facilitate a tester to know the logic and functions of program execution, a programmer needs to add annotation information in a program when writing the program, wherein the annotation information describes the logic of the whole program execution and the functions realized by the program, and then the annotation information and the written program are stored in the same file. When testing the program, the tester can look at the annotated text information to know the logic and function executed by the program.
In the process of implementing the invention, the inventor finds that the prior art has at least the following problems:
when the logic of the program execution is complex, the annotation information includes more content, the logic is complex and is difficult to understand, and the logic and the function of the program execution are difficult to understand, so that the information acquisition efficiency is low.
Disclosure of Invention
For the problems of the prior art, the present invention provides a method and apparatus for displaying annotation information. The technical scheme is as follows:
a method of displaying annotation information, the method comprising:
acquiring step description information and step flow relation information of a program from a program file of the program, wherein the step description information comprises operation types and description information of all steps in the program, and the step flow relation information comprises flow relations among all steps in the program;
drawing a flow chart of the program according to the step description information and the step flow relation information of the program;
and taking the flow chart as the annotation information of the program, and displaying the annotation information of the program.
An apparatus to display annotation information, the apparatus comprising:
an obtaining module, configured to obtain step description information and step flow relationship information of a program from a program file of the program, where the step description information includes operation types and description information of steps in the program, and the step flow relationship information includes flow relationships among the steps in the program;
the drawing module is used for drawing a flow chart of the program according to the step description information and the step flow relation information of the program;
and the display module is used for taking the flow chart as the annotation information of the program and displaying the annotation information of the program.
In the embodiment of the invention, the flow chart of the program is created and is used as the annotation information of the program to be displayed, and the flow chart is easier to understand than the character information, so that the user can be helped to understand the logic and the function executed by the program more quickly, and the information acquisition efficiency is improved.
Drawings
FIG. 1-1 is a schematic diagram of a program editor interface according to an embodiment of the invention;
fig. 1-2 are flowcharts of a method for displaying annotation information according to embodiment 1 of the present invention;
fig. 2-1 is a flowchart of a method for displaying annotation information according to embodiment 2 of the present invention;
fig. 2-2 is an interface schematic diagram of a display program provided in embodiment 2 of the present invention;
fig. 2-3 are schematic diagrams of graph nodes provided in embodiment 2 of the present invention;
FIGS. 2 to 4 are flowcharts of a procedure provided in embodiment 2 of the present invention;
fig. 2-5 are schematic diagrams of a first interface for displaying a flowchart according to embodiment 2 of the present invention;
fig. 2-6 are schematic diagrams of a second interface for displaying a flowchart according to embodiment 2 of the present invention;
fig. 3 is a schematic structural diagram of an apparatus for displaying annotation information according to embodiment 3 of the present invention;
fig. 4 is a schematic structural diagram of a terminal provided in embodiment 4 of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
The programmer can write implementation codes of a program in a program editor, and can write step description information and step flow relation information of the program when writing the implementation codes, wherein the step description information comprises operation types and description information of all steps in the program, and the step flow relation information comprises flow relations among all the steps in the program, and then the implementation codes, the step description information and the step flow relation information of the program are stored in a program file.
For example, referring to fig. 1-1, a programmer may write implementation code of a program in a program editor, where the program is a program login () for implementing login, and the execution process of the login program login () is "start the process, first obtain a token from a, then verify whether the token is expired, if so, obtain the token again, and if not, obtain the user key, and end the process. "so login procedure login () includes five steps, the first step is the start of the flow, which can be identified by a step identification st; the second step is to obtain token from a, which can be identified by a step identifier op; the third step is to verify whether the token is expired, which can be identified by the step identifier cond; the fourth step is to acquire a user key if the key is not expired, and the key can be identified by the step identifier op 2; the fifth step is the end of the process, which may be identified by step identifier e.
Referring to fig. 1-1, the step description information of the login procedure login () includes an operation type start of the first step and description information "start", and may be represented by "st ═ start: start means that the operation type indicated by start is a start type; the operation type operation and description information "acquire token from a" of the second step may be represented by "op ═ operation: acquiring token' from A, wherein the operation type represented by the operation is a processing type; the operation type condition and the description information "verify whether the token is expired" in the third step may be represented by "cond ═ condition: verifying whether the token is expired or not, wherein the condition indicates that the operation type is a verification type; the operation type operation and the description information "get user key" of the fourth step may be represented by "op 2 ═ operation: acquiring a user key' representation; and the operation type end and description information "end" of the fifth step may be used for "e ═ end: end "indicates that the operation type indicated by end is an end type.
The step flow relation information of the login program login () is a relation graph with a direction edge, the relation graph comprises step identifiers of all steps, and if a precedence relation exists between two steps, a direction edge exists between the two steps. For example, the step flow relationship information includes step identifiers st, op, cond, op2, and e of the first to fifth steps, and there is a precedence relationship between the first and second steps and between the second and third steps, so that there is a direction edge between the step identifiers st and op, and there is a direction edge between op and cond, which is represented by "st- > op- > cond"; the third step and the fourth step and the third step and the second step have a precedence relationship, so that a direction edge exists between the step identifier cond and the op2, and a direction edge exists between the cond and the op, which is represented by 'cond (yes) - > op2, cond (no) - > op'; the fourth step and the fifth step have precedence relation, so that a direction exists between the step identifiers op2 and e, and the direction is represented by "op 2- > e".
Step description information, step flow relation information and realization code public voidingin () of the login program login () are stored in the same program file. When the technician opens and displays the program file, the comment information of the program, through which the logic and functions performed by the program are known, can be displayed by the scheme provided in any of the following embodiments.
Example 1
Referring to fig. 1-2, an embodiment of the present invention provides a method for displaying annotation information, including:
step 101: acquiring step description information and step flow relation information of a program from a program file of the program, wherein the step description information comprises operation types and description information of all steps in the program, and the step flow relation information comprises flow relations among all steps in the program.
Step 102: and drawing a flow chart of the program according to the step description information and the step flow relation information of the program.
Step 103: the program comment information is displayed by using the flowchart of the program as the program comment information.
In the embodiment of the invention, the flow chart of the program is created and is used as the annotation information of the program to be displayed, and the flow chart is easier to understand than the character information, so that the user can be helped to understand the logic and the function executed by the program more quickly, and the information acquisition efficiency is improved.
Example 2
The embodiment of the invention provides a method for displaying annotation information, wherein an execution main body of the method can be a terminal, the terminal can be a Personal Computer (PC) or a notebook Computer and the like, a user can open and display a program file of a program on the terminal, and the user can move a mouse when wanting to know the execution logic and the function of the program, so that the focus of the mouse is moved to a screen area for displaying the program, and the terminal is triggered to execute the method of the embodiment to display the annotation information of the program. Referring to fig. 2-1, the method includes:
step 201: the current position of the focus of the mouse is obtained and if the current position is located in the screen area for displaying the program, step 202 is performed.
The user can open a program file of the program on the terminal, and the terminal acquires and displays step description information, step flow relation information and implementation codes included in the program from the program file. The screen area for displaying the program includes a screen area for displaying the step description information, a screen area for displaying the step flow relation information, and a screen area for displaying the implementation code. For example, referring to fig. 2-2, the terminal displays a program file of the login program log (), and screen areas for displaying the login program log () include areas 1, 2, and 3.
Step 202: and acquiring step description information and step flow relation information of the program from a program file of the program.
For example, step description information and step flow relationship information of the login program login () are acquired from the program file of the login program login (), where the step description information is "st ═ start: to begin, op > operation: token, cond > condition is obtained from a: verifying if token is expired, op2 ═ operation: acquiring a user key, e ═ end: ending ' and the step flow relation information is ' st- > op- > cond, cond (yes) > op2, cond (no) > op, op2- > e '
Step 203: and creating graph nodes corresponding to all steps in the program according to the step description information of the program.
Specifically, the type and the description information of each step included in the program are acquired from the step description information of the program, a graph corresponding to each step is respectively created according to the type of each step, and the description information of each step is respectively filled in the graph corresponding to each step to obtain a graph node corresponding to each step.
For example, the operation type and the description information of five steps included in the login program login () are acquired from the step description information of the login program login (), the operation type start and the description information "start" of the first step, the operation type operation and the description information "acquire token from a" of the second step, the operation type condition and the description information "verify whether the token is expired" of the third step, the operation type operation and the description information "acquire user key" of the fourth step, and the operation type end and the description information "end" of the fifth step, respectively. Wherein start represents a start type, operation represents a process type, condition represents a verification type, and end represents an end type.
Referring to fig. 2-3, a corresponding graph is created as an oval frame for the first step according to the type start of the first step, a corresponding graph is created as a rectangular frame for the second step according to the type operataion of the second step, a corresponding graph is created as a diamond frame for the third step according to the type condition of the third step, a corresponding graph is created as a rectangular frame for the fourth step according to the type operation of the fourth step, and a corresponding graph is created as an oval frame for the fifth step according to the type end of the fifth step.
Then, the description information "start" of the first step is filled in the oval frame corresponding to the first step, the description information "acquire token" of the second step from a is filled in the rectangular frame corresponding to the second step, the description information "verify whether the token is expired" of the third step is filled in the diamond frame corresponding to the third step, the description information "acquire user's key" of the fourth step is filled in the rectangular frame corresponding to the fourth step, and the description information "end" of the fifth step is filled in the oval frame corresponding to the fifth step.
Step 204: and adding directional edges between the graph nodes corresponding to each step according to the step flow relation information of the program to obtain a flow chart of the program.
Specifically, for any two steps in the program, whether a direction edge exists between the two steps is determined according to the step flow relation information, if so, the precedence relation between the two steps is obtained according to the step flow relation information, and the direction edge is added between the graph nodes corresponding to the two steps according to the precedence relation. If the operation type of the step executed in advance in the two steps is the verification type, the verification conditions of the two steps are also obtained from the step flow relation information, and the verification conditions are added on the direction edges of the two steps.
For example, the step flow relationship information of the login program logic () is "st- > op- > cond, cond (yes) op2, cond (no) op, op2- > e". Referring to fig. 2-4, for the first step and the second step, according to the step flow relationship information, it is determined that a direction edge exists between the first step and the second step, the precedence relationship between the first step and the second step is obtained as the first step is executed first, the second step is executed later, and a direction edge is added between the graph node corresponding to the first step and the graph node corresponding to the second step according to the precedence relationship.
And for the second step and the third step, determining that a direction edge exists between the second step and the third step according to the flow relation information of the step, acquiring the precedence relationship between the second step and the third step, executing the second step in advance, executing the third step in the later process, and adding a direction edge between the graph node corresponding to the second step and the graph node corresponding to the third step according to the precedence relationship.
For the third step and the second step, determining that a direction edge exists between the third step and the second step according to the flow relation information of the step, acquiring the precedence relationship between the third step and the second step, wherein the precedence relationship is executed for the third step, the second step is executed later, and a direction edge is added between a graph node corresponding to the third step and a graph node corresponding to the second step according to the precedence relationship; the operation type of the third step is an authentication type, the authentication condition between the third step and the second step is obtained from the step flow relationship information as "no", and the authentication condition "no" is added to the direction edge between the third step and the second step.
For the third step and the fourth step, determining that a direction edge exists between the third step and the fourth step according to the flow relation information of the step, acquiring the precedence relationship between the third step and the fourth step, wherein the precedence relationship is executed for the third step, the fourth step is executed later, and a direction edge is added between the graph node corresponding to the third step and the graph node corresponding to the fourth step according to the precedence relationship; the operation type of the third step is the verification type, the verification condition between the third step and the fourth step is acquired from the step flow relation information and is 'yes', and the verification condition 'yes' is added on the direction edge between the third step and the fourth step.
And for the fourth step and the fifth step, determining that a direction edge exists between the fourth step and the fifth step according to the flow relation information of the step, acquiring the precedence relationship between the fourth step and the fifth step, executing the fourth step in advance, executing the fifth step in the later period, and adding a direction edge between the graph node corresponding to the fourth step and the graph node corresponding to the fifth step according to the precedence relationship.
Step 205: a flowchart of the procedure is shown.
There may be the following first or second two display modes, including:
first, a flow chart of the program is displayed in a floating manner above the program.
An exit interface can be displayed in a floating mode above the program, and when an exit command triggered by clicking the exit interface by a user is detected, the displayed flowchart is exited.
For example, referring to FIGS. 2-5, the flow diagrams shown in FIGS. 2-4 and an exit interface may be displayed floating above the login procedure login ().
Second, the screen area is divided into two columns of areas, the program is displayed in one column of area and the flow chart of the program is displayed in the other column of area.
And an exit interface can be further displayed in the other column area, and when an exit command triggered by clicking the exit interface by the user is detected, the displayed flowchart is exited.
For example, referring to fig. 2-6, the screen area is divided into two column areas, the login procedure login () is displayed in the left column area and the flowchart shown in fig. 2-4 is displayed in the right column area. Further, an exit interface is also displayed in the right column area.
In the embodiment of the invention, the flow chart of the program is created and is used as the annotation information of the program to be displayed, and the flow chart is easier to understand than the character information, so that the user can be helped to understand the logic and the function executed by the program more quickly, and the information acquisition efficiency is improved.
Example 3
Referring to fig. 3, an embodiment of the present invention provides an apparatus for displaying annotation information, including:
an obtaining module 301, configured to obtain step description information and step flow relationship information of a program from a program file of the program, where the step description information includes operation types and description information of steps in the program, and the step flow relationship information includes flow relationships among the steps in the program;
a drawing module 302, configured to draw a flowchart of the program according to the step description information and the step flow relationship information of the program;
a display module 303, configured to use the flowchart as annotation information of the program, and display the annotation information of the program.
Optionally, the drawing module 302 includes:
a creating unit, configured to create a graph node corresponding to each step in the program according to the step description information of the program;
and the adding unit is used for adding a direction edge between the graph nodes corresponding to each step according to the step flow relation information of the program to obtain the flow chart of the program.
Optionally, the creating unit includes:
an acquisition subunit configured to acquire, from the step description information of the program, a type and description information of each step included in the program;
a creating subunit, configured to create, according to the types of the steps, graphs corresponding to the steps, respectively;
and the filling subunit is used for respectively filling the description information of each step into the graph corresponding to each step to obtain the graph node corresponding to each step.
Further, the obtaining module 301 is further configured to obtain a current position of a focus of a mouse, and if the current position is located in a screen area for displaying the program, execute the operation of obtaining step description information and step flow relationship information of the program from a program file of the program.
Optionally, the display module 303 includes:
the first display unit is used for displaying the flow chart of the program in a floating mode above the program; alternatively, the first and second electrodes may be,
and the second display unit is used for dividing the screen into two columns of areas, displaying the program in one column of area and displaying the flow chart of the program in the other column of area.
In the embodiment of the invention, the flow chart of the program is created and is used as the annotation information of the program to be displayed, and the flow chart is easier to understand than the character information, so that the user can be helped to understand the logic and the function executed by the program more quickly, and the information acquisition efficiency is improved.
Example 4
Referring to fig. 4, a schematic structural diagram of a terminal according to an embodiment of the present invention is shown, where the terminal may be the wearable device described above, and is configured to implement the method for displaying poster information of a video provided in the above embodiment. Specifically, the method comprises the following steps:
the terminal 900 may include RF (Radio Frequency) circuitry 110, memory 120 including one or more computer-readable storage media, an input unit 130, a display unit 140, a sensor 150, audio circuitry 160, a WiFi (wireless fidelity) module 170, a processor 180 including one or more processing cores, and a power supply 190. Those skilled in the art will appreciate that the terminal configuration shown in fig. 4 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the RF circuit 110 may be used for receiving and transmitting signals during information transmission and reception or during a call, and in particular, receives downlink information from a base station and then sends the received downlink information to the one or more processors 180 for processing; in addition, data relating to uplink is transmitted to the base station. In general, the RF circuitry 110 includes, but is not limited to, an antenna, at least one Amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, an LNA (low noise Amplifier), a duplexer, and the like. In addition, the RF circuitry 110 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), e-mail, SMS (short messaging Service), etc.
The memory 120 may be used to store software programs and modules, and the processor 180 executes various functional applications and data processing by operating the software programs and modules stored in the memory 120. The memory 120 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the terminal 900, and the like. Further, the memory 120 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 120 may further include a memory controller to provide the processor 180 and the input unit 130 with access to the memory 120.
The input unit 130 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, the input unit 130 may include a touch-sensitive surface 131 as well as other input devices 132. The touch-sensitive surface 131, also referred to as a touch display screen or a touch pad, may collect touch operations by a user on or near the touch-sensitive surface 131 (e.g., operations by a user on or near the touch-sensitive surface 131 using a finger, a stylus, or any other suitable object or attachment), and drive the corresponding connection device according to a predetermined program. Alternatively, the touch sensitive surface 131 may comprise two parts, a touch detection means and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 180, and can receive and execute commands sent by the processor 180. Additionally, the touch-sensitive surface 131 may be implemented using various types of resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch-sensitive surface 131, the input unit 130 may also include other input devices 132. In particular, other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 140 may be used to display information input by or provided to a user and various graphical user interfaces of the terminal 900, which may be made up of graphics, text, icons, video, and any combination thereof. The Display unit 140 may include a Display panel 141, and optionally, the Display panel 141 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. Further, the touch-sensitive surface 131 may cover the display panel 141, and when a touch operation is detected on or near the touch-sensitive surface 131, the touch operation is transmitted to the processor 180 to determine the type of the touch event, and then the processor 180 provides a corresponding visual output on the display panel 141 according to the type of the touch event. Although in FIG. 4, touch-sensitive surface 131 and display panel 141 are shown as two separate components to implement input and output functions, in some embodiments, touch-sensitive surface 131 may be integrated with display panel 141 to implement input and output functions.
The terminal 900 can also include at least one sensor 150, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 141 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 141 and/or the backlight when the terminal 900 is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when the mobile phone is stationary, and can be used for applications of recognizing the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured in the terminal 900, detailed descriptions thereof are omitted.
Audio circuitry 160, speaker 161, and microphone 162 may provide an audio interface between a user and terminal 900. The audio circuit 160 may transmit the electrical signal converted from the received audio data to the speaker 161, and convert the electrical signal into a sound signal for output by the speaker 161; on the other hand, the microphone 162 converts the collected sound signal into an electric signal, converts the electric signal into audio data after being received by the audio circuit 160, and then outputs the audio data to the processor 180 for processing, and then to the RF circuit 110 to be transmitted to, for example, another terminal, or outputs the audio data to the memory 120 for further processing. The audio circuitry 160 may also include an earbud jack to provide communication of peripheral headphones with the terminal 900.
WiFi belongs to a short-distance wireless transmission technology, and the terminal 900 can help a user send and receive e-mails, browse web pages, access streaming media, and the like through the WiFi module 170, and it provides wireless broadband internet access for the user. Although fig. 4 shows the WiFi module 170, it is understood that it does not belong to the essential constitution of the terminal 900 and can be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 180 is a control center of the terminal 900, connects various parts of the entire mobile phone using various interfaces and lines, and performs various functions of the terminal 900 and processes data by operating or executing software programs and/or modules stored in the memory 120 and calling data stored in the memory 120, thereby performing overall monitoring of the mobile phone. Optionally, processor 180 may include one or more processing cores; preferably, the processor 180 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 180.
Terminal 900 also includes a power supply 190 (e.g., a battery) for powering the various components, which may preferably be logically coupled to processor 180 via a power management system that may be used to manage charging, discharging, and power consumption. The power supply 190 may also include any component including one or more of a dc or ac power source, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown, the terminal 900 may further include a camera, a bluetooth module, etc., which will not be described herein. Specifically, in this embodiment, the display unit of the terminal 900 is a touch screen display, the terminal 900 further includes a memory, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for:
acquiring step description information and step flow relation information of a program from a program file of the program, wherein the step description information comprises operation types and description information of all steps in the program, and the step flow relation information comprises flow relations among all steps in the program;
drawing a flow chart of the program according to the step description information and the step flow relation information of the program;
and taking the flow chart as the annotation information of the program, and displaying the annotation information of the program.
Optionally, the drawing a flowchart of the program according to the step description information and the step flow relationship information of the program includes:
according to the step description information of the program, creating graph nodes corresponding to all steps in the program;
and adding directional edges between the graph nodes corresponding to the steps according to the step flow relation information of the program to obtain a flow chart of the program.
Optionally, the creating a graph node corresponding to each step in the program according to the step description information of the program includes:
acquiring the type and description information of each step included in the program from the step description information of the program;
respectively creating graphs corresponding to the steps according to the types of the steps;
and filling the description information of each step into the graph corresponding to each step respectively to obtain the graph nodes corresponding to each step.
Further, before the step description information and the step flow relation information of the program are acquired from the program file of the program, the method further includes:
and acquiring the current position of a mouse focus, and if the current position is located in a screen area for displaying the program, executing the operation of acquiring the step description information and the step flow relation information of the program from a program file of the program.
Optionally, the displaying the annotation information of the program includes:
displaying a flow chart of the program in a floating manner above the program; alternatively, the first and second electrodes may be,
the screen is divided into two columns of areas, the program is displayed in one of the columns of areas and the flow chart of the program is displayed in the other column of areas.
In the embodiment of the invention, the flow chart of the program is created and is used as the annotation information of the program to be displayed, and the flow chart is easier to understand than the character information, so that the user can be helped to understand the logic and the function executed by the program more quickly, and the information acquisition efficiency is improved.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (10)

1. A method of displaying annotation information, the method comprising:
acquiring a current position of a mouse focus, and acquiring step description information and step flow relation information, except for an implementation code of a program, from a program file of the program if the current position is located in a screen area for displaying the program, wherein the step description information comprises operation types and description information of each step in the program, the operation types comprise a start type, a processing type, a verification type and an end type, the step flow relation information comprises flow relations among the steps in the program, and the implementation code is used for implementing a function of the program during running;
respectively creating graphs corresponding to the steps according to the operation types of the steps;
filling the description information of each step into the graph corresponding to each step respectively to obtain the graph nodes corresponding to each step;
adding a direction edge between the graph nodes corresponding to each step according to the step flow relation information of the program to obtain a flow chart of the program;
taking the flow chart as the annotation information of the program, and displaying the annotation information of the program and an exit interface;
and when detecting that the user clicks an exit command triggered by the exit interface, exiting from displaying the flow chart.
2. The method according to claim 1, wherein the obtaining the flow chart of the program by adding the directional edges between the graph nodes corresponding to the steps according to the step flow relationship information of the program comprises:
for any two steps in the program, determining whether a direction edge exists between the two steps according to the step flow relation information;
and if so, acquiring the precedence relationship between the two steps according to the step flow relationship information, and adding a direction edge between the graph nodes corresponding to the two steps according to the precedence relationship.
3. The method according to claim 2, wherein adding a directional edge between the graph nodes corresponding to the two steps according to the precedence relationship comprises:
determining the operation type of the step executed in advance in the two steps according to the precedence relationship;
when the operation type of the first executed step is a verification type, obtaining verification conditions of the two steps from the step flow relation information;
and adding a direction edge between the graph nodes corresponding to the two steps, and adding the verification condition on the direction edge.
4. The method of claim 1, wherein said displaying annotation information for the program comprises:
displaying a flow chart of the program in a floating manner above the program; alternatively, the first and second electrodes may be,
the screen is divided into two columns of areas, the program is displayed in one of the columns of areas and the flow chart of the program is displayed in the other column of areas.
5. An apparatus for displaying annotation information, the apparatus comprising:
an obtaining module, configured to obtain a current position of a mouse focus, and if the current position is located in a screen area for displaying a program, obtain step description information and step flow relationship information, which are other than an implementation code of the program, from a program file of the program, where the step description information includes an operation type and description information of each step in the program, the operation type includes a start type, a processing type, a verification type, and an end type, the step flow relationship information includes a flow relationship between each step in the program, and the implementation code is used for implementing a function of the program at runtime;
the drawing module is used for respectively creating graphs corresponding to the steps according to the operation types of the steps; filling the description information of each step into the graph corresponding to each step respectively to obtain the graph nodes corresponding to each step; adding a direction edge between the graph nodes corresponding to each step according to the step flow relation information of the program to obtain a flow chart of the program;
the display module is used for taking the flow chart as the annotation information of the program, and displaying the annotation information of the program and an exit interface; and when detecting that the user clicks an exit command triggered by the exit interface, exiting from displaying the flow chart.
6. The apparatus of claim 5, wherein the drawing module is further configured to determine, for any two steps in the program, whether a directional edge exists between the two steps according to the step flow relationship information; and if so, acquiring the precedence relationship between the two steps according to the step flow relationship information, and adding a direction edge between the graph nodes corresponding to the two steps according to the precedence relationship.
7. The apparatus according to claim 6, wherein the drawing module is further configured to determine an operation type of a step that is executed first in the two steps according to the precedence relationship; when the operation type of the first executed step is a verification type, obtaining verification conditions of the two steps from the step flow relation information; and adding a direction edge between the graph nodes corresponding to the two steps, and adding the verification condition on the direction edge.
8. The apparatus of claim 5, wherein the display module comprises:
the first display unit is used for displaying the flow chart of the program in a floating mode above the program; alternatively, the first and second electrodes may be,
and the second display unit is used for dividing the screen into two columns of areas, displaying the program in one column of area and displaying the flow chart of the program in the other column of area.
9. A terminal, characterized in that the terminal comprises a processor and a memory for storing program code, which is loaded by the processor and which performs the method of displaying annotation information according to any of claims 1 to 4.
10. A computer-readable storage medium for storing program code for performing the method of displaying annotation information of any one of claims 1 to 4.
CN201510080488.8A 2015-02-13 2015-02-13 Method and device for displaying annotation information Active CN105988801B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510080488.8A CN105988801B (en) 2015-02-13 2015-02-13 Method and device for displaying annotation information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510080488.8A CN105988801B (en) 2015-02-13 2015-02-13 Method and device for displaying annotation information

Publications (2)

Publication Number Publication Date
CN105988801A CN105988801A (en) 2016-10-05
CN105988801B true CN105988801B (en) 2020-01-24

Family

ID=57041482

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510080488.8A Active CN105988801B (en) 2015-02-13 2015-02-13 Method and device for displaying annotation information

Country Status (1)

Country Link
CN (1) CN105988801B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111580803B (en) * 2019-02-15 2022-09-06 广汽埃安新能源汽车有限公司 Method and system for generating flow chart with suspension prompt, electronic device and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1945526A (en) * 2005-10-09 2007-04-11 光宝科技股份有限公司 Method and system for displaying graphic user interface of application program
CN102129365A (en) * 2010-01-20 2011-07-20 阿里巴巴集团控股有限公司 Method and device for generating code documentations
CN103324513A (en) * 2013-06-04 2013-09-25 北京大学 Program annotation method and device
CN103412783A (en) * 2013-08-27 2013-11-27 杭州友声科技有限公司 Method for converting script codes into user flow diagram based on business logic layer

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104298495B (en) * 2013-07-19 2018-07-20 桥弘数控科技(上海)有限公司 A kind of program developing method and system based on script

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1945526A (en) * 2005-10-09 2007-04-11 光宝科技股份有限公司 Method and system for displaying graphic user interface of application program
CN102129365A (en) * 2010-01-20 2011-07-20 阿里巴巴集团控股有限公司 Method and device for generating code documentations
CN103324513A (en) * 2013-06-04 2013-09-25 北京大学 Program annotation method and device
CN103412783A (en) * 2013-08-27 2013-11-27 杭州友声科技有限公司 Method for converting script codes into user flow diagram based on business logic layer

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于多样化对象所有权的软件可信性质研究;文家朝;《中国优秀硕士学位论文库》;20120715;全文 *
自动生成流程图flow;eexpress;《https://forum.ubuntu.org.cn/viewtopic.php?f=63&t=374855》;20120518;全文 *

Also Published As

Publication number Publication date
CN105988801A (en) 2016-10-05

Similar Documents

Publication Publication Date Title
WO2017206916A1 (en) Method for determining kernel running configuration in processor and related product
CN104852885B (en) Method, device and system for verifying verification code
WO2015154670A1 (en) Method and apparatus for invoking application programming interface
CN106293308B (en) Screen unlocking method and device
CN106126411B (en) The method and apparatus that a kind of pair of tested program code is tested
JP6068660B2 (en) Character selection method, character selection device, terminal device, program, and recording medium
US9977651B2 (en) Mobile terminal and image processing method thereof
WO2018006841A1 (en) Qr code information transmission method, device and apparatus
WO2015007232A1 (en) Method, device and mobile terminal for checking message
EP2876539A1 (en) Method, device and terminal apparatus for responding to a sliding operation
TW201541337A (en) Method, device and system for displaying messages in mobile terminal
WO2017128986A1 (en) Selection method, device and storage medium for multimedia menu item
EP2869604A1 (en) Method, apparatus and device for processing a mobile terminal resource
CN105653112B (en) Method and device for displaying floating layer
CN110069407B (en) Function test method and device for application program
CN106708555B (en) A kind of method and apparatus loading plug-in unit
CN111026457B (en) Hardware configuration method and device, storage medium and terminal equipment
CN107479799B (en) Method and device for displaying window
CN106709330B (en) Method and device for recording file execution behaviors
CN106230919B (en) File uploading method and device
US20150070360A1 (en) Method and mobile terminal for drawing sliding trace
CN105528220B (en) Method and device for loading dynamic shared object
CN105159655B (en) Behavior event playing method and device
CN105988801B (en) Method and device for displaying annotation information
CN106357513B (en) Message processing method, device, server and message processing system

Legal Events

Date Code Title Description
C06 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