[go: up one dir, main page]

CN108132850B - Code positioning method, device and electronic device - Google Patents

Code positioning method, device and electronic device Download PDF

Info

Publication number
CN108132850B
CN108132850B CN201711402595.3A CN201711402595A CN108132850B CN 108132850 B CN108132850 B CN 108132850B CN 201711402595 A CN201711402595 A CN 201711402595A CN 108132850 B CN108132850 B CN 108132850B
Authority
CN
China
Prior art keywords
code
abnormal
exception
data
information
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
CN201711402595.3A
Other languages
Chinese (zh)
Other versions
CN108132850A (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.)
Ant Mining Technology Co ltd
Original Assignee
Ant Mining 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 Ant Mining Technology Co ltd filed Critical Ant Mining Technology Co ltd
Priority to CN201711402595.3A priority Critical patent/CN108132850B/en
Publication of CN108132850A publication Critical patent/CN108132850A/en
Application granted granted Critical
Publication of CN108132850B publication Critical patent/CN108132850B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/079Root cause analysis, i.e. error or fault diagnosis
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0766Error or fault reporting or storing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0766Error or fault reporting or storing
    • G06F11/0775Content or structure details of the error report, e.g. specific table structure, specific error fields
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/805Real-time
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/865Monitoring of software

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本发明是关于一种代码定位方法、装置及电子设备,属于互联网技术领域。所述方法包括:当检测到系统发生异常时,采集异常信息和异常数据;基于异常代码行号,在源代码中定位异常代码;获取异常代码,生成并展示异常通知。本发明当检测到系统发生异常时,采集异常信息和异常数据,并基于异常信息携带的异常代码行号,在源代码中定位异常代码,获取异常代码,生成并展示携带异常代码、异常信息及异常数据的异常通知,由于当检测到系统发生异常时,即可采集异常信息和异常数据,进而对异常信息及异常数据进行分析,因此,无需在后续提取系统的运行日志,也无需对大量的运行日志进行分析,可以实时定位发生异常的代码,智能性较优。

Figure 201711402595

The present invention relates to a code positioning method, device and electronic equipment, and belongs to the field of Internet technology. The method includes: collecting abnormal information and abnormal data when detecting an abnormality in the system; locating the abnormal code in the source code based on the abnormal code line number; acquiring the abnormal code, and generating and displaying the abnormal notification. When an abnormality is detected in the system, the present invention collects abnormal information and abnormal data, locates the abnormal code in the source code based on the abnormal code line number carried by the abnormal information, obtains the abnormal code, generates and displays the abnormal code, abnormal information and Abnormal notification of abnormal data, because when an abnormality is detected in the system, abnormal information and abnormal data can be collected, and then the abnormal information and abnormal data can be analyzed. The running log is analyzed, and the abnormal code can be located in real time, and the intelligence is better.

Figure 201711402595

Description

Code positioning method and device and electronic equipment
Technical Field
The invention relates to the technical field of internet, in particular to a code positioning method and device and electronic equipment.
Background
With the rapid development of internet technology, terminals such as mobile phones, tablet computers, personal computers and the like are increasingly popularized, various systems which depend on the operation of the terminals are produced, people depend on various systems more and more in work and life, and higher requirements are provided for functions which can be provided by the systems. Along with the improvement and enhancement of the functions of the system, the complexity of codes of the system is increased, thereby reducing the stability and reliability of the system, and leading the system to possibly have various abnormal states in the operation process. In order to track and find the exact location of the system where the exception occurs, it is usually necessary to obtain exception information in the system, and locate the code where the exception occurs in the system according to the exception information, so as to implement the repair of the exception based on the code.
In the related art, when locating a code that has an exception according to exception information, an operation log of a system in operation needs to be acquired, the operation log is analyzed by using a log analysis tool, and the code that has an exception is located in the operation log.
In the process of implementing the invention, the inventor finds that the related art has at least the following problems:
when the operation logs of the system are obtained, all the operation logs generated in a time period in which abnormality is likely to occur need to be obtained, and because the data volume of the operation logs generated in the operation process of the system is large, a large amount of workload is generated when the operation logs are analyzed, codes in which the abnormality occurs cannot be located in real time, and the intelligence is low.
Disclosure of Invention
In order to solve the problems that a large amount of workload is generated when the operation log is analyzed, abnormal codes cannot be located in real time, and the intelligence is low in the related technology, the invention provides a code locating method and device and electronic equipment.
According to a first aspect of embodiments of the present invention, there is provided a code positioning method, the method including:
when detecting that a system is abnormal, acquiring abnormal information and abnormal data, wherein the abnormal information carries an abnormal code line number of an abnormal code in a source code of the system, and the abnormal data at least comprises an input parameter, an output parameter and an operation variable;
locating an exception code in the source code based on the exception code line number, the exception code being a code in a code line indicated by the exception code line number;
and acquiring the abnormal code, and generating and displaying an abnormal notification, wherein the abnormal notification carries the abnormal code, the abnormal information and the abnormal data.
In another embodiment, before collecting the abnormal information and the abnormal data when the system is detected to be abnormal, the method further comprises:
when receiving an access request of the system, establishing data connection with the system based on acquisition equipment;
and receiving the source code transmitted by the system based on acquisition equipment, and correspondingly storing the system identification of the system and the source code.
In another embodiment, said locating exception code in said source code based on said exception code line number comprises:
determining a code line number of at least one line of code in the source code;
and positioning the code line number of the at least one line of codes, and taking the code in the code line with the code line number consistent with the abnormal code line number as the abnormal code.
In another embodiment, after locating exception code in the source code based on the code line number, the method further comprises:
and marking the abnormal information and the abnormal data at the specified position of the abnormal code based on a preset marking mode.
In another embodiment, the obtaining the exception code and generating and presenting an exception notification includes:
acquiring the abnormal code, and determining a preset format, wherein the preset format is used for indicating the format of the abnormal notification;
combining the abnormal code, the abnormal information and the abnormal data according to the preset format to generate the abnormal notification;
and displaying the exception notification.
According to a second aspect of embodiments of the present invention, there is provided a code locating apparatus, the apparatus comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring abnormal information and abnormal data when detecting that the system is abnormal, the abnormal information carries an abnormal code line number of a code with the abnormality in a source code of the system, and the abnormal data at least comprises input parameters, output parameters and operation variables;
the positioning module is used for positioning an abnormal code in the source code based on the abnormal code line number, wherein the abnormal code is a code in a code line indicated by the abnormal code line number;
and the generating module is used for acquiring the abnormal code, generating and displaying an abnormal notification, wherein the abnormal notification carries the abnormal code, the abnormal information and the abnormal data.
In another embodiment, the apparatus further comprises:
the system comprises an establishing module, a data receiving module and a data transmitting module, wherein the establishing module is used for establishing data connection with the system based on acquisition equipment when receiving an access request of the system;
and the receiving module is used for receiving the source code transmitted by the system based on the acquisition equipment and correspondingly storing the system identifier of the system and the source code.
In another embodiment, the positioning module comprises:
the determining submodule is used for determining the code line number of at least one line of codes in the source codes;
and the positioning submodule is used for positioning in the code line number of the at least one line of codes and taking the code in the code line with the code line number consistent with the abnormal code line number as the abnormal code.
In another embodiment, the apparatus further comprises:
and the marking module is used for marking the abnormal information and the abnormal data at the specified position of the abnormal code based on a preset marking mode.
In another embodiment, the generating module comprises:
the determining submodule is used for acquiring the abnormal code and determining a preset format, and the preset format is used for indicating the format of the abnormal notification;
the combination submodule is used for combining the abnormal code, the abnormal information and the abnormal data according to the preset format to generate the abnormal notification;
and the display submodule is used for displaying the abnormal notification.
The technical scheme provided by the embodiment of the invention can have the following beneficial effects:
when the system is detected to be abnormal, acquiring abnormal information and abnormal data, positioning the abnormal code in the source code based on the abnormal code line number carried by the abnormal information, acquiring the abnormal code, and generating and displaying an abnormal notice carrying the abnormal code, the abnormal information and the abnormal data.
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 invention, as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a flow diagram illustrating a method of code location in accordance with an exemplary embodiment;
FIG. 2 is an architectural diagram illustrating an implementation of a code location method according to an exemplary embodiment;
FIG. 3 is a flow diagram illustrating a method of code location in accordance with an exemplary embodiment;
FIG. 4A is a block diagram illustrating a code location device in accordance with an exemplary embodiment;
FIG. 4B is a block diagram illustrating a code location device in accordance with an exemplary embodiment;
FIG. 4C is a block diagram illustrating a code location apparatus in accordance with an exemplary embodiment;
FIG. 4D is a block diagram illustrating a code location device in accordance with an exemplary embodiment;
FIG. 4E is a block diagram illustrating a code location apparatus in accordance with an exemplary embodiment;
FIG. 5 is a block diagram illustrating a code location apparatus 500 according to an exemplary 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 embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
FIG. 1 is a flow chart illustrating a method of code location, as shown in FIG. 1, according to an exemplary embodiment, including the following steps.
In step 101, when detecting that the system is abnormal, acquiring abnormal information and abnormal data, where the abnormal information carries an abnormal code line number of the abnormal code in a source code of the system, and the abnormal data at least includes an input parameter, an output parameter, and an operation variable.
In step 102, an exception code is located in the source code based on the exception code line number, the exception code being code in the code line indicated by the exception code line number.
In step 103, an exception code is obtained, and an exception notification is generated and displayed, where the exception notification carries the exception code, exception information, and exception data.
According to the method provided by the embodiment of the invention, when the system is detected to be abnormal, the abnormal information and the abnormal data are collected, the abnormal code is positioned in the source code based on the abnormal code line number carried by the abnormal information, the abnormal code is obtained, and the abnormal notice carrying the abnormal code, the abnormal information and the abnormal data is generated and displayed.
In another embodiment, when an abnormality of the system is detected, before collecting abnormality information and abnormality data, the method further includes:
when receiving an access request of a system, establishing data connection with the system based on acquisition equipment;
and receiving the source code transmitted by the system based on the acquisition equipment, and correspondingly storing the system identification of the system and the source code.
In another embodiment, locating the exception code in the source code based on the exception code line number includes:
determining a code line number of at least one line of code in the source code;
and positioning the code line number of at least one line of codes, and taking the code in the code line with the code line number consistent with the abnormal code line number as the abnormal code.
In another embodiment, after locating the exception code in the source code based on the code line number, the method further comprises:
and marking the abnormal information and the abnormal data at the specified position of the abnormal code based on a preset marking mode.
In another embodiment, obtaining exception code and generating and presenting an exception notification includes:
acquiring an abnormal code, and determining a preset format, wherein the preset format is used for indicating the format of the abnormal notification;
combining the abnormal code, the abnormal information and the abnormal data according to a preset format to generate an abnormal notification;
and displaying the exception notification.
All the above-mentioned optional technical solutions can be combined arbitrarily to form the optional embodiments of the present invention, and are not described herein again.
Before explaining the embodiments of the present invention in detail, a brief description will be given to an implementation architecture of code location according to the embodiments of the present invention.
Referring to fig. 2, the implementation architecture of code location according to the present invention includes a terminal and a location system. The terminal can be connected with the positioning system through a wireless or wired network, the terminal can be an electronic device which can access and transmit data to the positioning system, the electronic device can be a computer, a smart phone, a tablet computer or other electronic devices, and the terminal is provided with the system and provides various services for users based on the system.
The positioning system is used for monitoring the system of the terminal in real time, and when the system of the terminal is detected to be abnormal, the positioning system collects abnormal information and abnormal data in the system of the terminal, and then positions codes of the system of the terminal, which are abnormal, based on the abnormal information and the abnormal data. In the practical application process, referring to fig. 2, the positioning system may include a collecting device and an analyzing device, where the collecting device is configured to establish a data connection with the terminal, receive a source code uploaded by the terminal, transmit the source code to the analyzing device, and transmit the abnormal information and the abnormal data to the analyzing device when the abnormal information and the abnormal data are collected. The analysis equipment receives and stores the source codes of the system uploaded by the acquisition equipment, receives the abnormal information and the abnormal data uploaded by the acquisition equipment when the acquisition equipment detects that the system of the terminal is abnormal, analyzes the abnormal information and the abnormal data, and then positions the codes with the abnormality in the source codes of the system.
FIG. 3 is a flow chart illustrating a method of code location, as shown in FIG. 3, according to an exemplary embodiment, including the following steps.
In step 301, when an access request of the system is received, a data connection with the system is established based on the acquisition device, and the receiving system stores a system identifier of the system corresponding to a source code based on the source code transmitted by the acquisition device.
In the embodiment of the present invention, the operation of the system is substantially a process of operating a plurality of programs in the system, the system includes at least one program, and when the system needs to provide a service for a user, the at least one program in the system starts to operate. Each program in at least one program corresponds to different source codes, and the program is compiled to run through the source codes. In order to locate the code with abnormality when detecting the abnormality of the system in the following, the locating system needs to acquire the source code in the system mounted on the terminal when detecting the access of the terminal.
When receiving the system request access of the terminal, the positioning system can establish data connection with the system of the terminal, receive the source code transmitted by the system, and correspondingly store the system identification of the system and the source code. In the actual application process, because the positioning system may include the acquisition device and the analysis device, the positioning system may receive an access request sent by a system of the terminal based on the acquisition device, establish a data connection with the system based on the acquisition device, receive a source code transmitted by the system by the acquisition device, and then transmit the received source code to the analysis device for storage. The embodiment of the present invention does not specifically limit the manner of establishing data connection between the positioning system and the manner of receiving the source code. In order to avoid confusion between the received source codes of the systems of the plurality of terminals, the system identification needs to be stored in correspondence with the source codes, considering that the systems of the plurality of terminals access the positioning system at the same time. In order to facilitate the storage of the system identifier corresponding to the source code, when the positioning system receives the source code, the positioning system may number the source code, generate a code number corresponding to the currently received source code, and store the code number corresponding to the system identifier. Wherein, the analysis device may generate a source code list as shown in table 1 when storing the correspondence between the source code and the system identifier. The embodiment of the present invention does not specifically limit the manner of the correspondence between the storage system identifier and the source code.
TABLE 1
System identification Code numbering
System A Source code 1
System B Source code 2
In step 302, when detecting that the system is abnormal, acquiring abnormal information and abnormal data, where the abnormal information carries an abnormal code line number of the abnormal code in the source code of the system, and the abnormal data at least includes an input parameter, an output parameter, and an operation variable.
In the embodiment of the invention, when the system is detected to be abnormal, in order to locate the abnormal code in the subsequent process, the abnormal information and the abnormal data in the system need to be collected immediately after the abnormality is detected. The essence of the system operation is program operation, the code of the program comprises a plurality of functions, and when the program is operated, the functions in the program generate data comprising input parameters, output parameters and operation variables during the operation, and the abnormal data definitely records the operation process of the program in the system, so that when the system is detected to be abnormal, the positioning system collects the abnormal data comprising the input parameters, the output parameters and the operation variables in the system.
In the practical application process, if the positioning system comprises the acquisition device and the analysis device, the positioning system can monitor the system of the accessed terminal in real time based on the acquisition device, acquire abnormal information and abnormal data in the system of the terminal by the acquisition device when the system monitoring the terminal is abnormal, and transmit the acquired abnormal information and abnormal data to the analysis device in the positioning system by the acquisition device in the subsequent process.
In step 303, the code line number of at least one line of code in the source code is determined, positioning is performed in the code line number of at least one line of code, and the code in the code line with the code line number consistent with the code line number of the exception code is taken as the exception code.
In the embodiment of the invention, the exception code is a code in a code line indicated by an exception code line number carried in the exception information. After the abnormal information of the system is collected, the abnormal code line number can be extracted from the abnormal information so as to determine the code indicated by the abnormal code line number in the source code of the system, and the code indicated by the abnormal code line number in the source code is taken as the abnormal code. The code in the source code is arranged in lines, so the code line number of at least one line of code in the source code can be determined first, and then the exception code is determined in the code line number of at least one line of code in the source code based on the exception code line number carried in the exception information. For example, if the exception code line number carried in the exception information is 116 lines, all codes in the 116 th line of at least one line of codes in the source code are taken as exception codes.
In step 304, based on a preset labeling manner, the abnormal information and the abnormal data are labeled at the specified position of the abnormal code.
In the embodiment of the invention, after the abnormal code is determined, because a plurality of codes which are abnormal at the same time are possible, developers can clearly acquire related data of the abnormal code when viewing the abnormal code, and then classify the current abnormal problem based on the abnormal code, the abnormal information and the abnormal data, therefore, after the abnormal code is determined, the abnormal information and the abnormal data can be marked at the specified position of the abnormal code based on a preset marking mode. The preset labeling mode can be label labeling, character labeling, line labeling and the like, and the designated positions can be the upper left corner, the upper right corner, the lower left corner and the like of the code line where the abnormal code is located.
In the practical application process, the positioning system can provide a label setting inlet on a terminal which is in data connection with the positioning system, when the label setting inlet is detected to be triggered by a user, a label mode selection frame, a label position selection frame and a confirmation button are displayed, when the confirmation button is detected to be triggered by the user, a label mode selected by the user in the label mode selection frame is obtained as a preset label mode, a label position selected by the user in the label position selection frame is obtained as an appointed position, and therefore when the subsequent system is detected to be abnormal, abnormal information and abnormal data collected when the system is abnormal are displayed based on the preset label mode and the appointed position.
In step 305, an exception code is obtained, a preset format is determined, the exception code, exception information and exception data are combined according to the preset format to generate an exception notification, and the exception notification is displayed, wherein the preset format is used for indicating the format of the exception notification.
In the embodiment of the invention, after the abnormal code is determined, an abnormal notification can be generated based on the abnormal code, the abnormal information and the abnormal data, so that the developer can be notified based on the abnormal notification. When the abnormal notification is generated, the abnormal code, the abnormal information and the abnormal data can be combined according to a fixed format in the positioning system to generate the abnormal notification; or a developer can set a preset format and combine the abnormal code, the abnormal information and the abnormal data according to the preset number to generate an abnormal notification. The preset format can be an embedded format, a labeling format, a detailed format and the like, if the preset format is the embedded format, the abnormal information and the abnormal data can be embedded into the abnormal code when the abnormal notification is generated, and then the abnormal notification is generated; if the preset format is the labeling format, a labeling frame comprising abnormal information and abnormal data can be generated when the abnormal notification is generated, and the labeling frame points to a specified position in the abnormal code; if the preset format is a detailed format, the exception code, the exception information and the exception data can be arranged and displayed in sequence when the exception notification is generated. The method of generating the abnormality notification according to the embodiment of the present invention is not particularly limited.
According to the method provided by the embodiment of the invention, when the system is detected to be abnormal, the abnormal information and the abnormal data are collected, the abnormal code is positioned in the source code based on the abnormal code line number carried by the abnormal information, the abnormal code is obtained, and the abnormal notice carrying the abnormal code, the abnormal information and the abnormal data is generated and displayed.
FIG. 4A is a block diagram illustrating a code location device according to an exemplary embodiment. Referring to fig. 4A, the apparatus includes an acquisition module 401, a location module 402 and a generation module 403.
The acquisition module 401 is configured to acquire, when detecting that the system is abnormal, abnormal information and abnormal data, where the abnormal information carries an abnormal code line number of an abnormal code in a source code of the system, and the abnormal data at least includes an input parameter, an output parameter, and an operation variable;
the positioning module 402 is configured to position an exception code in a source code based on an exception code line number, where the exception code is a code in a code line indicated by the exception code line number;
the generating module 403 is configured to obtain an exception code, generate and display an exception notification, where the exception notification carries the exception code, exception information, and exception data.
According to the device provided by the embodiment of the invention, when the system is detected to be abnormal, the abnormal information and the abnormal data are collected, the abnormal code is positioned in the source code based on the abnormal code line number carried by the abnormal information, the abnormal code is obtained, and the abnormal notice carrying the abnormal code, the abnormal information and the abnormal data is generated and displayed.
In another embodiment, referring to fig. 4B, the apparatus further comprises a establishing module 404 and a receiving module 405.
The establishing module 404 is configured to, when receiving an access request of a system, establish a data connection with the system based on an acquisition device;
the receiving module 405 is configured to receive a source code transmitted by the system based on the acquisition device, and store a system identifier of the system in correspondence with the source code.
In another embodiment, referring to FIG. 4C, the locate module 402 includes a determine sub-module 4021 and a locate sub-module 4022.
The determining submodule 4021 is configured to determine a code line number of at least one line of code in the source code;
the positioning sub-module 4022 is configured to position a code line number of at least one line of codes, and use a code in a code line with a code line number that is consistent with a code line number of an exception code as an exception code.
In another embodiment, referring to fig. 4D, the apparatus further comprises a labeling module 406.
The labeling module 406 is configured to label the abnormal information and the abnormal data at a specified position of the abnormal code based on a preset labeling manner.
In another embodiment, referring to fig. 4E, the generating module 403 includes a determining sub-module 4031, a combining sub-module 4032 and a presenting sub-module 4033.
The determining submodule 4031 is configured to obtain an exception code and determine a preset format, where the preset format is used to indicate a format of an exception notification;
the combining submodule 4032 is configured to combine the exception code, the exception information, and the exception data according to a preset format, and generate an exception notification;
the display sub-module 4033 is used for displaying an exception notification.
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. 5 is a schematic structural diagram of an electronic device 500 according to an embodiment of the present invention. Referring to fig. 5, the electronic device 500 includes a communication bus, a processor, a memory, and a communication interface, and may further include an input/output interface and a display device, wherein the functional units may communicate with each other through the bus. The memory stores computer programs, and the processor is used for executing the programs stored in the memory and executing the video data processing method in the embodiment.
A bus is a circuit that connects the described elements and enables transmission between these elements. For example, the processor receives commands from other elements through the bus, decrypts the received commands, and performs calculations or data processing according to the decrypted commands. The memory may include program modules such as a kernel (kernel), middleware (middleware), an Application Programming Interface (API), and applications. The program modules may be comprised of software, firmware or hardware, or at least two of the same. The input-output interface forwards commands or data input by a user via an input-output device (e.g., sensor, keyboard, touch screen). The display device displays various information to a user. The communication interface connects the electronic device 500 with other network devices, user equipment, networks. For example, the communication interface may be connected to a network by wire or wirelessly to connect to external other network devices or user devices. The wireless communication may include at least one of: wireless Fidelity (WiFi), Bluetooth (BT), Near Field Communication (NFC), Global Positioning System (GPS) and cellular Communication (cellular Communication) (e.g., Long Term Evolution (LTE)), Long Term Evolution (Long Term Evolution) followed by Long Term Evolution (LTE-Advanced), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (CDMA, WCDMA), Universal Mobile telecommunications System (Universal Mobile telecommunications System, UMTS), Wireless Broadband Access (Wireless Broadband bro) and Global System for Mobile communications (GSM) may include at least one of the following Wireless Communication systems (WiFi), Wireless Multimedia Communication (Bluetooth, BT), Wireless Broadband Communication (GSM), Wireless Serial Communication (GSM), Wireless Multimedia Communication (HDMI, GSM), RS-232), and Plain Old Telephone Service (POTS). The network may be a telecommunications network and a communications network. The communication network may be a computer network, the internet of things, a telephone network. The electronic device 500 may be connected to a network through a communication Interface, and a protocol used for the electronic device 500 to communicate with other network devices may be supported by at least one of an Application, an Application Programming Interface (API), middleware, a kernel, and a communication Interface.
A1, a code positioning method, comprising:
when detecting that a system is abnormal, acquiring abnormal information and abnormal data, wherein the abnormal information carries an abnormal code line number of an abnormal code in a source code of the system, and the abnormal data at least comprises an input parameter, an output parameter and an operation variable;
locating an exception code in the source code based on the exception code line number, the exception code being a code in a code line indicated by the exception code line number;
and acquiring the abnormal code, and generating and displaying an abnormal notification, wherein the abnormal notification carries the abnormal code, the abnormal information and the abnormal data.
A2, the method according to claim 1, wherein before collecting abnormal information and abnormal data when detecting the system abnormality, the method further comprises:
when receiving an access request of the system, establishing data connection with the system based on acquisition equipment;
and receiving the source code transmitted by the system based on acquisition equipment, and correspondingly storing the system identification of the system and the source code.
A3 the method of claim 1, wherein locating exception code in the source code based on the exception code line number comprises:
determining a code line number of at least one line of code in the source code;
and positioning the code line number of the at least one line of codes, and taking the code in the code line with the code line number consistent with the abnormal code line number as the abnormal code.
A4, the method as recited in claim 1, wherein after locating exception code in the source code based on the code line number, the method further comprises:
and marking the abnormal information and the abnormal data at the specified position of the abnormal code based on a preset marking mode.
A5 the method according to claim 1, wherein the obtaining the exception code, generating and presenting an exception notification includes:
acquiring the abnormal code, and determining a preset format, wherein the preset format is used for indicating the format of the abnormal notification;
combining the abnormal code, the abnormal information and the abnormal data according to the preset format to generate the abnormal notification;
and displaying the exception notification.
A6, a code positioning device, comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring abnormal information and abnormal data when detecting that the system is abnormal, the abnormal information carries an abnormal code line number of a code with the abnormality in a source code of the system, and the abnormal data at least comprises input parameters, output parameters and operation variables;
the positioning module is used for positioning an abnormal code in the source code based on the abnormal code line number, wherein the abnormal code is a code in a code line indicated by the abnormal code line number;
and the generating module is used for acquiring the abnormal code, generating and displaying an abnormal notification, wherein the abnormal notification carries the abnormal code, the abnormal information and the abnormal data.
A7, the device of claim 6, wherein the device further comprises:
the system comprises an establishing module, a data receiving module and a data transmitting module, wherein the establishing module is used for establishing data connection with the system based on acquisition equipment when receiving an access request of the system;
and the receiving module is used for receiving the source code transmitted by the system based on the acquisition equipment and correspondingly storing the system identifier of the system and the source code.
A8, the device according to claim 6, wherein the positioning module comprises:
the determining submodule is used for determining the code line number of at least one line of codes in the source codes;
and the positioning submodule is used for positioning in the code line number of the at least one line of codes and taking the code in the code line with the code line number consistent with the abnormal code line number as the abnormal code.
A9, the device of claim 6, wherein the device further comprises:
and the marking module is used for marking the abnormal information and the abnormal data at the specified position of the abnormal code based on a preset marking mode.
A10, the apparatus of claim 6, wherein the generating module comprises:
the determining submodule is used for acquiring the abnormal code and determining a preset format, and the preset format is used for indicating the format of the abnormal notification;
the combination submodule is used for combining the abnormal code, the abnormal information and the abnormal data according to the preset format to generate the abnormal notification;
and the display submodule is used for displaying the abnormal notification.
A11, an electronic device, comprising the code positioning device of any one of claims 6 to 10.
A12, an electronic device, comprising: a memory for storing executable instructions;
and a processor in communication with the memory to execute the executable instructions to perform the operations of the code location method of any of claims 1 to 5.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention 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 invention is limited only by the appended claims.

Claims (7)

1. A method for code location, the method comprising:
when detecting that a system is abnormal, acquiring abnormal information and abnormal data, wherein the abnormal information carries an abnormal code line number of an abnormal code in a source code of the system, and the abnormal data at least comprises an input parameter, an output parameter and an operation variable;
locating an exception code in the source code based on the exception code line number, the exception code being a code in a code line indicated by the exception code line number;
acquiring the abnormal code, generating and displaying an abnormal notification, wherein the abnormal notification carries the abnormal code, the abnormal information and the abnormal data,
wherein the method further comprises: after an abnormal code is positioned in the source code, the abnormal information and the abnormal data are marked at the specified position of the abnormal code based on a preset marking mode,
wherein the method further comprises: after the exception code is determined, the currently occurring exception is classified based on the exception code, exception information, and exception data, an
Wherein the obtaining the exception code and the generating and displaying the exception notification comprise: acquiring the abnormal code, and determining a preset format, wherein the preset format is used for indicating the format of the abnormal notification; combining the abnormal code, the abnormal information and the abnormal data according to the preset format to generate the abnormal notification; and displaying the exception notification.
2. The method of claim 1, wherein before collecting anomaly information and anomaly data when an anomaly in the system is detected, the method further comprises:
when receiving an access request of the system, establishing data connection with the system based on acquisition equipment;
and receiving the source code transmitted by the system based on acquisition equipment, and correspondingly storing the system identification of the system and the source code.
3. The method of claim 1, wherein the locating exception code in the source code based on the exception code line number comprises:
determining a code line number of at least one line of code in the source code;
and positioning the code line number of the at least one line of codes, and taking the code in the code line with the code line number consistent with the abnormal code line number as the abnormal code.
4. A code locating apparatus, wherein the apparatus comprises:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring abnormal information and abnormal data when detecting that the system is abnormal, the abnormal information carries an abnormal code line number of a code with the abnormality in a source code of the system, and the abnormal data at least comprises input parameters, output parameters and operation variables;
the positioning module is used for positioning an abnormal code in the source code based on the abnormal code line number, wherein the abnormal code is a code in a code line indicated by the abnormal code line number;
a generating module, configured to acquire the exception code, generate and display an exception notification, where the exception notification carries the exception code, the exception information, and the exception data,
wherein the apparatus further comprises: the marking module is used for marking the abnormal information and the abnormal data at the specified position of the abnormal code based on a preset marking mode; and is
A classification module for classifying the abnormality based on the abnormal code, the abnormal information and the abnormal data after the abnormal code is determined,
wherein the generation module is further configured to: acquiring the abnormal code and determining a preset format, wherein the preset format is used for indicating the format of the abnormal notification; combining the abnormal code, the abnormal information and the abnormal data according to the preset format to generate the abnormal notification; and displaying the exception notification.
5. The apparatus of claim 4, wherein the apparatus further comprises:
the system comprises an establishing module, a data receiving module and a data transmitting module, wherein the establishing module is used for establishing data connection with the system based on acquisition equipment when receiving an access request of the system;
and the receiving module is used for receiving the source code transmitted by the system based on the acquisition equipment and correspondingly storing the system identifier of the system and the source code.
6. An electronic device characterized by comprising the code positioning apparatus of any one of claims 4 to 5.
7. An electronic device, comprising:
a memory for storing executable instructions; and
a processor in communication with the memory to execute the executable instructions to perform the operations of the code location method of any of claims 1 to 3.
CN201711402595.3A 2017-12-22 2017-12-22 Code positioning method, device and electronic device Active CN108132850B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711402595.3A CN108132850B (en) 2017-12-22 2017-12-22 Code positioning method, device and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711402595.3A CN108132850B (en) 2017-12-22 2017-12-22 Code positioning method, device and electronic device

Publications (2)

Publication Number Publication Date
CN108132850A CN108132850A (en) 2018-06-08
CN108132850B true CN108132850B (en) 2021-06-01

Family

ID=62391435

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711402595.3A Active CN108132850B (en) 2017-12-22 2017-12-22 Code positioning method, device and electronic device

Country Status (1)

Country Link
CN (1) CN108132850B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111597093B (en) * 2019-02-20 2024-04-16 阿里巴巴集团控股有限公司 Exception handling method, device and equipment thereof
CN112445706A (en) * 2020-11-27 2021-03-05 深圳前海微众银行股份有限公司 Program abnormal code acquisition method and device, electronic equipment and storage medium
CN112527546A (en) * 2020-12-14 2021-03-19 携程旅游网络技术(上海)有限公司 Application exception rapid positioning method, system, equipment and storage medium
CN113535579A (en) * 2021-07-28 2021-10-22 展讯半导体(成都)有限公司 Abnormity positioning method and related device
CN113672429B (en) * 2021-10-25 2022-03-01 深圳市工易付电子科技有限公司 Code exception pushing method, device, equipment and storage medium
CN114356506A (en) * 2022-01-12 2022-04-15 平安付科技服务有限公司 Abnormal information positioning method, system, computer equipment and readable storage medium
CN114217782B (en) * 2022-02-22 2022-05-27 深圳市明源云科技有限公司 Method, device, equipment and medium for automatically generating interactive page
CN115185833B (en) * 2022-06-25 2025-05-27 平安银行股份有限公司 Abnormal code processing method, device, computer equipment and storage medium
CN116662096B (en) * 2022-12-12 2024-04-23 荣耀终端有限公司 Fault debugging method and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104239219A (en) * 2014-10-21 2014-12-24 中国科学院软件研究所 Software defect positioning technology on-line evaluating and experimenting platform and method based on coverage
CN104731696A (en) * 2013-12-19 2015-06-24 腾讯科技(深圳)有限公司 Method of locating bug in procedure code and relevant device
CN106294134A (en) * 2016-07-29 2017-01-04 腾讯科技(深圳)有限公司 The collapse localization method of code and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10528431B2 (en) * 2016-02-04 2020-01-07 International Business Machines Corporation Providing integrity for data sets backed-up from client systems to objects in a network storage
US10523240B2 (en) * 2016-06-02 2019-12-31 Texas Instruments Incorporated Methods and apparatus to determine and apply polarity-based error correction code

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104731696A (en) * 2013-12-19 2015-06-24 腾讯科技(深圳)有限公司 Method of locating bug in procedure code and relevant device
CN104239219A (en) * 2014-10-21 2014-12-24 中国科学院软件研究所 Software defect positioning technology on-line evaluating and experimenting platform and method based on coverage
CN106294134A (en) * 2016-07-29 2017-01-04 腾讯科技(深圳)有限公司 The collapse localization method of code and device

Also Published As

Publication number Publication date
CN108132850A (en) 2018-06-08

Similar Documents

Publication Publication Date Title
CN108132850B (en) Code positioning method, device and electronic device
US8655336B1 (en) Remote issue logging and reporting of mobile station issues and diagnostic information to manufacturer
CN111026645B (en) User interface automatic test method and device, storage medium and electronic equipment
US11363066B2 (en) Method and device for information processing, test terminal, test platform and storage medium
CN112596848B (en) Screen recording method, device, electronic equipment, storage medium and program product
CN111274131A (en) Interface testing method and device, electronic equipment and storage medium
CN115017340B (en) Multimedia resource generation method and device, electronic equipment and storage medium
CN108446211B (en) Browser exception collection method, device, mobile terminal and storage medium
CN112148579B (en) User interface testing method and device
CN109344051B (en) Data processing method and device, electronic equipment and storage medium
US20220012165A1 (en) Method and apparatus for debugging device
CN105868549B (en) Medical equipment based on Internet internet of things and communication device and method thereof
CN109753425A (en) Pop-up processing method and processing device
CN105094830B (en) A kind of method and apparatus of performance objective function
CN105306677A (en) Method, apparatus and system for controlling intelligent device
CN109614278A (en) The method, apparatus and terminal of positioning problems in automatic test course
CN103473170B (en) Test macro and method of testing
CN105577472A (en) A data collection test method and device
CN112069079B (en) Performance test method, related device and storage medium
CN115018574B (en) Information display method, device, electronic device and storage medium
CN112764838A (en) Target content display method and device and electronic equipment
CN104899059A (en) Method and apparatus for upgrading operating system
CN114896165B (en) Testing method, device, electronic device and storage medium for conversational robot system
CN108984417B (en) Software testing method, device, terminal and storage medium
CN114780334A (en) Power consumption monitoring method, power consumption monitoring device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20180920

Address after: 26 Ying Yun street, Singapore

Applicant after: Bit continent Technology Co., Ltd.

Address before: 100029 Beijing Haidian District Austria north industrial base project 6 Building 2 level.

Applicant before: BEIJING BITMAIN TECHNOLOGY CO., LTD.

TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20210115

Address after: Room A1, 11 / F, punctuality building, 245-251 Hennessy Road, Hong Kong, China

Applicant after: BITMAIN TECHNOLOGY Co.,Ltd.

Address before: 26 Ying Yun street, Singapore

Applicant before: BITMAIN TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20210511

Address after: 2701, 27th floor, Central Plaza, 18 Harbour Road, Wanchai, Hong Kong, China

Applicant after: Ant Mining Technology Co.,Ltd.

Address before: Room A1, 11 / F, punctuality building, 245-251 Hennessy Road, Hong Kong, China

Applicant before: BITMAIN TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant