CN110837429A - Intelligent repairing method and device for online codes of web terminal - Google Patents

Intelligent repairing method and device for online codes of web terminal Download PDF

Info

Publication number
CN110837429A
CN110837429A CN201910969179.4A CN201910969179A CN110837429A CN 110837429 A CN110837429 A CN 110837429A CN 201910969179 A CN201910969179 A CN 201910969179A CN 110837429 A CN110837429 A CN 110837429A
Authority
CN
China
Prior art keywords
error
code
line
online
codes
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.)
Withdrawn
Application number
CN201910969179.4A
Other languages
Chinese (zh)
Inventor
胡诗沂
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910969179.4A priority Critical patent/CN110837429A/en
Publication of CN110837429A publication Critical patent/CN110837429A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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; CALCULATING OR 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/0793Remedial or corrective actions

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)
  • Stored Programmes (AREA)

Abstract

The embodiment of the invention provides an intelligent repair method for online codes of a web terminal, which comprises the following steps: acquiring an on-line code error reporting message; positioning the error code error position according to the error report message; performing script analysis on the error code to determine the error type; and automatically repairing the error code according to the determined error type. The embodiment of the invention also provides an intelligent web end online code repairing device, computer equipment and a computer storage medium. The embodiment of the invention can enhance the monitoring of the online code, can timely know the online abnormity, can solve the problem of blank screen of the online page or abnormal loading of the page, and enhances the user experience.

Description

Intelligent repairing method and device for online codes of web terminal
Technical Field
The embodiment of the invention relates to the technical field of internet, in particular to a method and a device for intelligently repairing codes on a web end line, computer equipment and a computer readable storage medium.
Background
Code is the source file written by a programmer in a language supported by the development tool, and is a set of explicit rules for representing information in discrete form by characters, symbols, or signal symbols. The principles of code design include uniqueness, standardization and versatility, extensibility and stability, ease of recognition and memory, strive for shortness and format unification, and ease of modification. The source code is a branch of code, in the sense that the source code corresponds to code. In modern programming languages, the source code may be in the form of a book or tape, but the most common format is a text file, which is typically used for the purpose of compiling a computer program. The ultimate purpose of computer source code is to translate human-readable text into computer-executable binary instructions called compilation, which is done by a compiler.
Currently running web pages on various terminals may cause unknown errors due to code errors, which are generally caused by insufficient personal experience of programmers in writing codes in the development stage or because web pages are not compatible with the corresponding terminals. A blank page appears when the whole page is loaded abnormally, and the user experience is seriously influenced.
Disclosure of Invention
In view of this, an object of the embodiments of the present invention is to provide a method and an apparatus for intelligently repairing an online code of a web endpoint, a computer device, and a computer-readable storage medium, which can enhance monitoring of the online code, timely know an online exception, solve a situation of a blank screen or an abnormal page loading of an online page, and enhance user experience.
In order to achieve the above object, an embodiment of the present invention provides an intelligent repairing method for a code on a web end line, including the following steps:
acquiring an on-line code error reporting message;
positioning the error code error position according to the error report message;
performing script analysis on the error code to determine the error type;
and automatically repairing the error code according to the determined error type.
Further, the step of obtaining the on-line code error reporting message further comprises:
and scanning whether the codes on the line have errors or not in real time, and if so, sending a message that the codes on the line report errors.
Further, the step of obtaining the on-line code error reporting message further comprises:
and scanning whether the codes on the line have errors in a preset time period, and if so, sending a message that the codes on the line report errors.
Further, the step of locating the error code error position according to the error message includes:
scanning the codes on the lines line by line;
and matching the codes on each line with a preset error code library or a standard code library so as to locate the code line where the error code is located.
Further, the step of performing script analysis on the error code to determine the type of error comprises:
acquiring a corresponding error code based on a code line where the error code is located;
and matching the error codes with preset error operation codes, error code grammars, error code logics or standard operation codes, standard code grammars and standard code logics of a standard code library to determine that the error type of the error codes is a code operation error or a code grammar error or a code logic error.
Further, the step of automatically repairing the error code according to the determined error type includes:
according to the determined error type, automatically repairing an error code in a corresponding newly increased or modified or deleted mode for a code operation error, a code syntax error or a code logic error;
and after the repair is completed, refreshing the online code and running.
Further, the step of automatically repairing the error code according to the determined error type is followed by:
and recording the position of the error of the online code, the error type and the repair mode, and uploading the position to a server for storage.
In order to achieve the above object, an embodiment of the present invention further provides an intelligent repair device for a code on a web end line, including:
the acquisition module is used for acquiring an on-line code error reporting message;
the positioning module is used for positioning the error position of the error code according to the error report message;
the analysis module is used for carrying out script analysis on the error codes to determine the error type;
and the repairing module is used for automatically repairing the error code according to the determined error type.
In order to achieve the above object, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the intelligent repair method for codes on the web endpoint as described above when executing the computer program.
To achieve the above object, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, where the computer program is executable by at least one processor, so as to cause the at least one processor to execute the steps of the intelligent repairing method for codes on a web endpoint as described above.
According to the web end online code intelligent repairing method, the web end online code intelligent repairing device, the web end online code intelligent repairing computer equipment and the computer readable storage medium, the online code error reporting message is obtained, the error code error position is located according to the error reporting message, the error code is subjected to script analysis to determine the error type, the error code is automatically repaired according to the determined error type, monitoring of the online code can be enhanced, online abnormity can be known timely, the condition that online pages are blank or loaded abnormally can be solved, and user experience is enhanced.
Drawings
Fig. 1 is a flowchart of an intelligent repair method for web-end online codes according to an embodiment of the present invention.
Fig. 2 is a flowchart of a web end online code intelligent repair method according to a second embodiment of the present invention.
Fig. 3 is a flowchart of a third method for intelligently repairing a code on a web end line according to an embodiment of the present invention.
Fig. 4 is a flowchart of a fourth method for intelligently repairing a code on a web end line according to an embodiment of the present invention.
Fig. 5 is a schematic diagram of program modules of an intelligent web-end code repairing apparatus according to a fifth embodiment of the present invention.
Fig. 6 is a structural diagram of an intelligent web-end code repairing apparatus according to a sixth embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the description relating to "first", "second", etc. in the present invention is for descriptive purposes only and is not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
Example one
Referring to fig. 1, a flowchart of a method for intelligently repairing a code on a web endpoint according to a first embodiment of the present invention is shown. It is to be understood that the flow charts in the embodiments of the present method are not intended to limit the order in which the steps are performed. The following description takes an intelligent repair device for web end-line codes as an execution subject, and the intelligent repair device for web end-line codes can be applied to a server. The method comprises the following specific steps:
in step S100, an on-line code error message is acquired.
In an embodiment of the present invention, the web-side online code intelligent repair device may obtain an online code error reporting message.
For example, the system automatically obtains an on-line code error message. It can be understood that the system automatically acquires the on-line code error reporting message by embedding the on-line code error reporting message in the web interface, and then the web end on-line code intelligent repair device scans and monitors the on-line code of a certain web page in real time on line, so that when a user enters a certain web page and cannot open the web page, the on-line code error reporting message can be automatically reported by scanning the error code of the web page.
Specifically, the on-line code error message may be embedded into the web interface in a default syntax, a short tag syntax, a script, or the like.
In step S101, the error code error position is located according to the error message.
And after the on-line code error reporting message is acquired, positioning the error position of the error code according to the error reporting message.
In an embodiment of the invention, the system automatically positions the error position of the error code according to the error report message so as to facilitate quick repair, because when a certain web page is scanned and monitored in real time on line, the intelligent repair device for the code on the web end line can simulate the code of the web page once to find the error of the code, or can be a pre-established standard code library or an error code library, when the real-time scanning and monitoring are carried out, the intelligent repair device is matched with the standard code library or the error code library to determine whether the error exists, and positions the error code position in time.
For example, when the web page code is simulated and run, if the code cannot continue to run due to running to a certain error line, the code is represented as the error line, and the error code and the corresponding code line are recorded.
The standard code library can be understood as a set of conventional standard codes preset according to experience; the error code library may be understood as a set of error codes that are empirically preset.
When a web page is scanned and codes are monitored in real time on line, each code is matched with the conventional standard codes in the standard code library to determine whether an error exists, namely whether an error code exists. If the matching is consistent, the code is normally operated; if the match is inconsistent, it indicates that an error code exists and the error code is located to obtain the error location of the error code.
In step S102, the error code is subjected to script analysis to determine the error type.
After the error code error position is located according to the error report message, script analysis needs to be carried out on the error code to determine the error type.
In a specific embodiment of the invention, script analysis is carried out on the error codes to determine the error type, so that the codes can be repaired more quickly, abnormal codes which cause the page not to be loaded normally are solved, and normal display of the page is achieved.
In step S103, the error code is automatically repaired according to the determined error type.
And after the script analysis is carried out on the error code to determine the error type, automatically repairing the error code according to the determined error type.
In a specific embodiment, the manner of automatically repairing the error code according to the determined error type may include: code modification, addition, or deletion. For example, the new target code is a character string, the new target code is actually equivalent to insertion, and the insertion position only needs to be found by using a function similar to strpos; modifying, namely replacing the target character string by utilizing a str _ place function or modifying the target character string by utilizing a js grammar; deleting, intercepting the character string by using functions like substr and the like.
According to the web end online code intelligent repairing method, the web end online code intelligent repairing device, the web end online code intelligent repairing computer equipment and the computer readable storage medium, the online code error reporting message is obtained, the error code error position is located according to the error reporting message, the error code is subjected to script analysis to determine the error type, the error code is automatically repaired according to the determined error type, monitoring of the online code can be enhanced, online abnormity can be known timely, the condition that online pages are blank or loaded abnormally can be solved, and user experience is enhanced.
Example two
Referring to fig. 2, a flowchart of a method for intelligently repairing codes on a web endpoint according to a second embodiment of the present invention is shown. It is to be understood that the flow charts in the embodiments of the present method are not intended to limit the order in which the steps are performed. The following description takes an intelligent repair device for web end-line codes as an execution subject, and the intelligent repair device for web end-line codes can be applied to a server. The method comprises the following specific steps:
in step S200, an on-line code error message is acquired.
In an embodiment of the present invention, the web-side online code intelligent repair device may obtain an online code error reporting message. For example, the system automatically obtains an on-line code error message.
In a specific embodiment of the invention, when a user enters a certain web page and cannot open the web page, a code error report message is automatically reported. It can be understood that the system automatically acquires the on-line code error reporting message by embedding the on-line code error reporting message in the web interface, and then the web end on-line code intelligent repair device scans and monitors the on-line code of a certain web page in real time on line, so that when a user enters a certain web page and cannot open the web page, the on-line code error reporting message can be automatically reported by scanning the error code of the web page.
In step S201, code scanning is performed on the line code line by line; and matching the codes on each line with a preset error code library or a standard code library so as to locate the code line where the error code is located.
And after the on-line code error reporting message is acquired, positioning the error position of the error code according to the error reporting message. When a certain web page is scanned and monitored in real time on line, the intelligent repair device for the codes on the web end line can perform simulation execution on the web page codes once to find out that the codes are wrong, and can also be a pre-established standard code library or an error code library.
In an embodiment of the invention, the online code is scanned, and the code line where the error code is located is accurately positioned, so as to facilitate quick repair.
In step S202, acquiring a corresponding error code based on a code line where the error code is located; and matching the error codes with preset error operation codes, error code grammars, error code logics or standard operation codes, standard code grammars and standard code logics of a standard code library to determine that the error type of the error codes is a code operation error or a code grammar error or a code logic error.
Specifically, the error types of the code include a code operation error, a code syntax error and a code logic error.
After the error code error position is positioned according to the error report message, script analysis is carried out on the error code to determine that the error type is a code operation error; and/or performing script analysis on the error codes to determine that the error type is a code syntax error and/or performing script analysis on the error codes to determine that the error type is a code logic error.
Specifically, the error code is script-analyzed to be understood as matching with a standard run code, a standard code syntax, a standard code logic of a preset standard code library or an error run code, an error code syntax, an error code logic of a preset error code library. And when the error code is not consistent with one of the standard operation code, the standard code grammar and the standard code logic in matching, determining the error type corresponding to the item according to the matching result. And when the error code is matched with one of the error operation code, the error code grammar and the error code logic to be consistent, determining the error type corresponding to the item according to the matching result.
In one embodiment of the present invention, the code operation error is, for example: the divisor is 0 during division operation, the subscript of the array is out of bounds, the file cannot be opened, the database is connected wrongly, and the like.
In one embodiment of the present invention, the code syntax error is, for example: incomplete expression, lack of necessary punctuation, keyword entry errors, data type mismatch, keyword mismatch of a loop statement or selection statement, and the like.
In one embodiment of the present invention, the code logic error is, for example: incorrect variables are used, the order of the instructions is incorrect, the conditions of the loop are incorrect, programmed algorithms are not well considered, etc. Usually, a logic error also accompanies a running error.
And performing script analysis on the error code to determine the error type, so that the code can be repaired more quickly, abnormal codes which cause the page to be incapable of being loaded normally are solved, and normal display of the page is achieved.
In step S203, the error code is automatically repaired in a corresponding adding or modifying or deleting mode according to the determined error type, such as a code operation error, a code syntax error or a code logic error.
And after the script analysis is carried out on the error code to determine the error type, automatically repairing the error code in a corresponding newly added or modified or deleted mode according to the determined error type, namely the code operation error, the code syntax error or the code logic error.
As an example, when the error code is detected to indicate "when the divisor is divided by 0", the correction can be made by adding a new condition to the divisor to determine. When an error code is detected to indicate "array index out-of-bounds," the repair can be performed by modifying the maximum length of the array. When a code operation error occurs, the code line of the error code can be obtained according to the condition of the error code, and the error code can be repaired by combining the error reason.
Illustratively, when an error code is detected that indicates that the expression is incomplete, the table definition may be modified for repair. When an error code is detected, denoted as "errorC 2143: syntax errors: absent'; ' when the "is used, the" usingnamespace std "can be newly added for repair.
Illustratively, when an error code is detected that indicates that the loop condition for the if is incorrect, the repair may be performed by modifying the if condition. When detecting that the error code indicates "instruction sequence error", the expression or variable can be added or deleted in the corresponding monitoring window, and the monitoring range and type of the expression or variable in the monitoring window can be modified or deleted to repair.
In step S204, after the repair is completed, the online code is refreshed and run.
And after the error code is automatically and correspondingly repaired in a newly added or modified or deleted mode according to the determined error type, namely a code operation error, a code syntax error or a code logic error, the online code is refreshed and operated after the repair is finished.
In step S205, the on-line code error position, error type, and repair method are recorded and uploaded to the server for storage.
After the steps S200 to S204 are executed, the error position, the error type, and the repair method of the online code are recorded and uploaded to the server for storage.
In a specific embodiment of the invention, when the abnormal condition is monitored, a mechanism for reporting errors in time is added, details of background errors are reported, and an abnormal alarm is pushed to the development, so that the development can check the abnormality in time.
According to the web end online code intelligent repairing method, the web end online code intelligent repairing device, the web end online code intelligent repairing computer equipment and the computer readable storage medium, the online code error reporting message is obtained, the error code error position is located according to the error reporting message, the error code is subjected to script analysis to determine the error type, the error code is automatically repaired according to the determined error type, monitoring of the online code can be enhanced, online abnormity can be known timely, the condition that online pages are blank or loaded abnormally can be solved, and user experience is enhanced.
EXAMPLE III
Referring to fig. 3, a flowchart of an intelligent repair method for a code on a web endpoint according to a third embodiment of the present invention is shown. It is to be understood that the flow charts in the embodiments of the present method are not intended to limit the order in which the steps are performed. The following description takes an intelligent repair device for web end-line codes as an execution subject, and the intelligent repair device for web end-line codes can be applied to a server. The method comprises the following specific steps:
in step S300, whether the on-line code has an error is scanned in real time, and if so, an on-line code error report message is sent.
In an embodiment of the present invention, the intelligent web end on-line code repairing device can scan whether the on-line code has an error in real time, and if so, send an on-line code error reporting message.
In a specific embodiment of the present invention, when a user enters a certain web page, the next web page to be entered by the user is scanned in advance in real time, and if the online code has an error, an online code error report message is sent. It can be understood that the system automatically acquires the on-line code error reporting message by embedding the on-line code error reporting message in the web interface, and then the web end on-line code intelligent repair device scans and monitors the on-line code of a certain web page in real time on line, so that when a user enters a certain web page and cannot open the web page, the on-line code error reporting message can be automatically reported by scanning the error code of the web page.
In step S301, an online code error reporting message is acquired.
In an embodiment of the present invention, an error reporting message of an online code is obtained.
In step S302, code scanning is performed on the line codes line by line; and matching the codes on each line with a preset error code library or a standard code library so as to locate the code line where the error code is located.
When a certain web page is scanned and monitored in real time on line, the intelligent repair device for the codes on the web end line can perform simulation execution on the web page codes once to find out that the codes are wrong, and can also be a pre-established standard code library or an error code library.
When the online code error reporting message is acquired, scanning the online code according to the error reporting message, and accurately positioning a code line where the error code is located.
In an embodiment of the present invention, whether the code on the real-time scanning line has an error may be that a certain section on the scanning line has an error, the code on the line is scanned, and the code line where the error code is located is accurately located, so as to facilitate quick repair.
In step S303, a corresponding error code is obtained based on the code line where the error code is located;
and matching the error codes with preset error operation codes, error code grammars, error code logics or standard operation codes, standard code grammars and standard code logics of a standard code library to determine that the error type of the error codes is a code operation error or a code grammar error or a code logic error.
Specifically, the code error analysis is matched with the standard operation code, the standard code grammar, the standard code logic or the error operation code, the error code grammar and the error code logic of a preset standard code library.
After the error code error position is positioned according to the error report message, script analysis is carried out on the error code to determine that the error type is a code operation error; and/or performing script analysis on the error codes to determine that the error type is a code syntax error and/or performing script analysis on the error codes to determine that the error type is a code logic error.
In one embodiment of the present invention, the code operation error is, for example: the divisor is 0 during division operation, the subscript of the array is out of bounds, the file cannot be opened, the disk space is insufficient, the database is connected wrongly, and the like.
In one embodiment of the present invention, the code syntax error is, for example: incomplete expression, lack of necessary punctuation, keyword entry errors, data type mismatch, keyword mismatch of a loop statement or selection statement, and the like.
In one embodiment of the present invention, the code logic error is, for example: incorrect variables are used, the order of the instructions is incorrect, the conditions of the loop are incorrect, programmed algorithms are not well considered, etc. Usually, a logic error also accompanies a running error.
And performing script analysis on the error code to determine the error type, so that the code can be repaired more quickly, abnormal codes which cause the page to be incapable of being loaded normally are solved, and normal display of the page is achieved.
In step S304, the error code is automatically repaired in a corresponding addition or modification or deletion mode according to the determined error type, such as a code operation error, a code syntax error or a code logic error.
And after the script analysis is carried out on the error code to determine the error type, automatically repairing the error code in a corresponding newly added or modified or deleted mode according to the determined error type, namely the code operation error, the code syntax error or the code logic error.
In step S305, after the repair is completed, the online code is refreshed and run.
And after the error code is automatically and correspondingly repaired in a newly added or modified or deleted mode according to the determined error type, namely a code operation error, a code syntax error or a code logic error, the online code is refreshed and operated after the repair is finished.
In step S306, the error position, error type, and repair method of the online code are recorded and uploaded to the server for storage.
After steps S300 to S305 are executed, the error position, the error type, and the repair method of the online code are recorded and uploaded to the server for storage.
In a specific embodiment of the invention, when the abnormal condition is monitored, a mechanism for reporting errors in time is added, details of background errors are reported, and an abnormal alarm is pushed to the development, so that the development can check the abnormality in time.
According to the web end online code intelligent repairing method, the web end online code intelligent repairing device, the web end online code intelligent repairing computer equipment and the computer readable storage medium, the online code error reporting message is obtained, the error code error position is located according to the error reporting message, the error code is subjected to script analysis to determine the error type, the error code is automatically repaired according to the determined error type, monitoring of the online code can be enhanced, online abnormity can be known timely, the condition that online pages are blank or loaded abnormally can be solved, and user experience is enhanced.
Example four
Referring to fig. 4, a flowchart of an intelligent repair method for a web endpoint code according to a fourth embodiment of the present invention is shown. It is to be understood that the flow charts in the embodiments of the present method are not intended to limit the order in which the steps are performed. The following description takes an intelligent repair device for web end-line codes as an execution subject, and the intelligent repair device for web end-line codes can be applied to a server. The method comprises the following specific steps:
in step S400, whether the online code has an error is scanned in a preset time period, and if so, an online code error report message is sent.
In an embodiment of the present invention, the intelligent web end online code repair device may scan whether the online code has an error in a preset time period, and if so, send an online code error report message.
In a specific embodiment of the present invention, when the web page is scanned in advance in a non-busy time, if the online code has an error, an online code error report message is sent, for example, the web page is scanned in advance at 2 o 'clock to 6 o' clock in the morning at night, and if the online code has an error, the online code error report message is sent.
In step S401, an online code error reporting message is acquired.
In an embodiment of the present invention, an error reporting message of an online code is obtained.
In step S402, code scanning is performed on the line code line by line; and matching the codes on each line with a preset error code library or a standard code library so as to locate the code line where the error code is located.
And after the error reporting message of the online code is acquired, scanning the online code according to the error reporting message, and accurately positioning a code line where the error code is located.
In an embodiment of the present invention, whether the code on the scanning line has an error in the preset time period may be that a certain section on the scanning line has an error, the code on the scanning line is scanned, and the code line where the error code is located is accurately located, so as to facilitate quick repair.
In step S403, acquiring a corresponding error code based on the code line where the error code is located; and matching the error codes with preset error operation codes, error code grammars, error code logics or standard operation codes, standard code grammars and standard code logics of a standard code library to determine that the error type of the error codes is a code operation error or a code grammar error or a code logic error.
After the error code error position is positioned according to the error report message, script analysis is carried out on the error code to determine that the error type is a code operation error; and/or performing script analysis on the error codes to determine that the error type is a code syntax error and/or performing script analysis on the error codes to determine that the error type is a code logic error.
In one embodiment of the present invention, the code operation error is, for example: the divisor is 0 during division operation, the subscript of the array is out of bounds, the file cannot be opened, the disk space is insufficient, the database is connected wrongly, and the like.
In one embodiment of the present invention, the code syntax error is, for example: incomplete expression, lack of necessary punctuation, keyword entry errors, data type mismatch, keyword mismatch of a loop statement or selection statement, and the like.
In one embodiment of the present invention, the code logic error is, for example: incorrect variables are used, the order of the instructions is incorrect, the conditions of the loop are incorrect, programmed algorithms are not well considered, etc. Usually, a logic error also accompanies a running error.
And performing script analysis on the error code to determine the error type, so that the code can be repaired more quickly, abnormal codes which cause the page to be incapable of being loaded normally are solved, and normal display of the page is achieved.
In step S404, the error code is automatically repaired in a corresponding addition or modification or deletion mode according to the determined error type, such as a code operation error, a code syntax error or a code logic error.
And after the script analysis is carried out on the error code to determine the error type, automatically repairing the error code in a corresponding newly added or modified or deleted mode according to the determined error type, namely the code operation error, the code syntax error or the code logic error.
In step S405, after the repair is completed, the online code is refreshed and run.
And after the error code is automatically and correspondingly repaired in a newly added or modified or deleted mode according to the determined error type, namely a code operation error, a code syntax error or a code logic error, the online code is refreshed and operated after the repair is finished.
In step S406, the error position, error type, and repair method of the online code are recorded and uploaded to the server for storage.
After steps S400 to S405 are executed, the error position, the error type, and the repair method of the online code are recorded and uploaded to the server for storage.
In a specific embodiment of the invention, when the abnormal condition is monitored, a mechanism for reporting errors in time is added, details of background errors are reported, and an abnormal alarm is pushed to the development, so that the development can check the abnormality in time.
According to the web end online code intelligent repairing method, the web end online code intelligent repairing device, the web end online code intelligent repairing computer equipment and the computer readable storage medium, the online code error reporting message is obtained, the error code error position is located according to the error reporting message, the error code is subjected to script analysis to determine the error type, the error code is automatically repaired according to the determined error type, monitoring of the online code can be enhanced, online abnormity can be known timely, the condition that online pages are blank or loaded abnormally can be solved, and user experience is enhanced.
EXAMPLE five
Referring to fig. 5, a schematic diagram of program modules of an intelligent web-end code repairing apparatus 500 according to a fourth embodiment of the present invention is shown. In this embodiment, the intelligent repair apparatus 500 for web end online code may include or be divided into one or more program modules, and the one or more program modules are stored in a storage medium and executed by one or more processors to implement the present invention and implement the intelligent repair method for web end online code described above. The program module referred to in the embodiment of the present invention refers to a series of computer program instruction segments capable of performing specific functions, and is more suitable for describing the execution process of the intelligent code repairing method on the web end in the storage medium than the program itself. The following description will specifically describe the functions of the program modules of the present embodiment:
an obtaining module 501, configured to obtain an error reporting message of an online code.
In an embodiment of the present invention, the web-side online code intelligent repair device 500 may obtain an online code error reporting message. For example, the system automatically obtains an on-line code error message.
In a specific embodiment of the invention, when a user enters a certain web page and cannot open the web page, a code error report message is automatically reported.
In an embodiment of the present invention, the intelligent repair device 500 for online codes at a web end can scan whether an online code has an error in real time, and if so, send an online code error report message.
In a specific embodiment of the present invention, when a user enters a certain web page, the next web page to be entered by the user is scanned in advance in real time, and if the online code has an error, an online code error report message is sent.
In an embodiment of the present invention, the intelligent repair device 500 for online codes at the web end can scan whether the online codes have errors in real time, and if yes, send an online code error report message.
In a specific embodiment of the present invention, when the web page is scanned in advance in a non-busy time, if the online code has an error, an online code error report message is sent, for example, the web page is scanned in advance at 2 o 'clock to 6 o' clock in the morning at night, and if the online code has an error, the online code error report message is sent.
The positioning module 502 is configured to position the error code error position according to the error report message.
And after the error reporting message of the online code is acquired, scanning the online code according to the error reporting message, and accurately positioning a code line where the error code is located.
In an embodiment of the present invention, whether the code on the real-time scanning line has an error may be that a certain section on the scanning line has an error, the code on the line is scanned, and the code line where the error code is located is accurately located, so as to facilitate quick repair.
The analysis module 503 is configured to perform script analysis on the error code to determine an error type;
performing script analysis on the error code to determine that the error type is a code operation error; and/or performing script analysis on the error codes to determine that the error type is a code syntax error and/or performing script analysis on the error codes to determine that the error type is a code logic error.
In one embodiment of the present invention, the code operation error is, for example: the divisor is 0 during division operation, the subscript of the array is out of bounds, the file cannot be opened, the disk space is insufficient, the database is connected wrongly, and the like.
In one embodiment of the present invention, the code syntax error is, for example: incomplete expression, lack of necessary punctuation, keyword entry errors, data type mismatch, keyword mismatch of a loop statement or selection statement, and the like.
In one embodiment of the present invention, the code logic error is, for example: incorrect variables are used, the order of the instructions is incorrect, the conditions of the loop are incorrect, programmed algorithms are not well considered, etc. Usually, a logic error also accompanies a running error.
And performing script analysis on the error code to determine the error type, so that the code can be repaired more quickly, abnormal codes which cause the page to be incapable of being loaded normally are solved, and normal display of the page is achieved.
And a repair module 504, configured to automatically repair the error code according to the determined error type.
And automatically repairing the error code in a corresponding adding or modifying or deleting mode according to the determined error type, namely the code operation error, the code syntax error or the code logic error.
And after the script analysis is carried out on the error code to determine the error type, automatically repairing the error code in a corresponding newly added or modified or deleted mode according to the determined error type, namely the code operation error, the code syntax error or the code logic error.
And after the repair is completed, refreshing the online code and running.
And after the error code is automatically and correspondingly repaired in a newly added or modified or deleted mode according to the determined error type, namely a code operation error, a code syntax error or a code logic error, the on-line code is refreshed and operated after the repair is finished, and the error position, the error type and the repair mode of the on-line code are recorded and uploaded to a server for storage.
In a specific embodiment of the invention, when the abnormal condition is monitored, a mechanism for reporting errors in time is added, details of background errors are reported, and an abnormal alarm is pushed to the development, so that the development can check the abnormality in time.
According to the web end online code intelligent repairing method, the web end online code intelligent repairing device, the web end online code intelligent repairing computer equipment and the computer readable storage medium, the online code error reporting message is obtained, the error code error position is located according to the error reporting message, the error code is subjected to script analysis to determine the error type, the error code is automatically repaired according to the determined error type, monitoring of the online code can be enhanced, online abnormity can be known timely, the condition that online pages are blank or loaded abnormally can be solved, and user experience is enhanced.
EXAMPLE six
The present embodiment also provides a computer apparatus, and in the present embodiment, as shown in fig. 6, the memory 601 includes at least one type of computer-readable storage medium, and the readable storage medium includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the storage 601 may be an internal storage unit of the computer device 600, such as a hard disk or a memory of the computer device 600. In other embodiments, the memory 601 may also be an external storage device of the computer device 600, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), etc. provided on the computer device 600. Of course, the memory 601 may also include both internal and external storage devices for the computer device 600. In this embodiment, the memory 601 is generally used for storing an operating system installed in the computer device 600 and various application software, such as program codes of the intelligent repair device 500 for web-end online codes. In addition, the memory 601 can also be used to temporarily store various types of data that have been output or are to be output.
Processor 602 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 602 is typically used to control the overall operation of the computer device 600. In this embodiment, the processor 602 is configured to run the program code stored in the memory 601 or process data, for example, run the intelligent repair apparatus 500 for web end-line code, so as to implement the intelligent repair method for web end-line code in the first embodiment.
The network interface 603 may comprise a wireless network interface or a wired network interface, and the network interface 603 is generally used for establishing a communication connection between the computer apparatus 600 and other electronic devices. For example, the network interface 603 is used to connect the computer device 600 to an external terminal through a network, establish a data transmission channel and a communication connection between the computer device 600 and the external terminal, and the like. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), a 4G network, a 5G network, Bluetooth (Bluetooth), Wi-Fi, and the like.
It is noted that fig. 2 only shows the computer device 600 with components 601, 603 and 500, but it is to be understood that not all of the shown components are required and that more or less components may be implemented instead.
In this embodiment, the intelligent repair apparatus 500 for web end-line code stored in the memory 601 may be further divided into one or more program modules, and the one or more program modules are stored in the memory 601 and executed by one or more processors (in this embodiment, the processor 602) to complete the intelligent repair method for web end-line code of the present invention.
EXAMPLE seven
The present embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application mall, etc., on which a computer program is stored, which when executed by a processor implements corresponding functions. The computer-readable storage medium of this embodiment is used for storing the intelligent repairing apparatus 500 for web-end online code, and when being executed by a processor, the apparatus implements the intelligent repairing method for web-end online code of the present invention.
According to the intelligent web on-line code repairing method, device, computer equipment and computer readable storage medium provided by the embodiment of the invention, consumption preference analysis can be carried out according to transaction detail information of a credit card of a user, and credit card preference information really interested by the user is intelligently recommended, so that the embarrassment that the user sees that a certain merchant has a preference but does not have the card is avoided, and the recommendation of mother-infant type credit card preference information to the user without the mother-infant requirement is also avoided.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. An intelligent web end online code repairing method is characterized by comprising the following steps:
acquiring an on-line code error reporting message;
positioning the error code error position according to the error report message;
performing script analysis on the error code to determine the error type;
and automatically repairing the error code according to the determined error type.
2. The intelligent web client code recovery method according to claim 1, wherein the step of obtaining the online code error message further comprises:
and scanning whether the codes on the line have errors or not in real time, and if so, sending a message that the codes on the line report errors.
3. The intelligent web client code recovery method according to claim 1, wherein the step of obtaining the online code error message further comprises:
and scanning whether the codes on the line have errors in a preset time period, and if so, sending a message that the codes on the line report errors.
4. The intelligent web-end online code recovery method according to any one of claims 1 to 3, wherein the step of locating the error code error position according to the error message comprises:
scanning the codes on the lines line by line;
and matching the codes on each line with a preset error code library or a standard code library so as to locate the code line where the error code is located.
5. The intelligent web-end online code recovery method of claim 4, wherein the step of performing script analysis on the error code to determine the type of error comprises:
acquiring a corresponding error code based on a code line where the error code is located;
and matching the error codes with preset error operation codes, error code grammars, error code logics or standard operation codes, standard code grammars and standard code logics of a standard code library to determine that the error type of the error codes is a code operation error or a code grammar error or a code logic error.
6. The intelligent web-end online code recovery method of claim 5, wherein the step of automatically recovering the error code based on the determined error type comprises:
according to the determined error type, automatically repairing an error code in a corresponding newly increased or modified or deleted mode for a code operation error, a code syntax error or a code logic error;
and after the repair is completed, refreshing the online code and running.
7. The intelligent web-end online code recovery method of claim 1, wherein the step of automatically recovering the error code based on the determined error type is followed by:
and recording the position of the error of the online code, the error type and the repair mode, and uploading the position to a server for storage.
8. An intelligent web end-line code repair device, comprising:
the acquisition module is used for acquiring an on-line code error reporting message;
the positioning module is used for positioning the error position of the error code according to the error report message;
the analysis module is used for carrying out script analysis on the error codes to determine the error type;
and the repairing module is used for automatically repairing the error code according to the determined error type.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the computer program implements the steps of the intelligent repair method for code on the web endpoint of any one of claims 1 to 7.
10. A computer-readable storage medium, having stored therein a computer program, the computer program being executable by at least one processor to cause the at least one processor to perform the steps of the intelligent repair method for code on a web-end line as claimed in any one of claims 1 to 7.
CN201910969179.4A 2019-10-12 2019-10-12 Intelligent repairing method and device for online codes of web terminal Withdrawn CN110837429A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910969179.4A CN110837429A (en) 2019-10-12 2019-10-12 Intelligent repairing method and device for online codes of web terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910969179.4A CN110837429A (en) 2019-10-12 2019-10-12 Intelligent repairing method and device for online codes of web terminal

Publications (1)

Publication Number Publication Date
CN110837429A true CN110837429A (en) 2020-02-25

Family

ID=69575291

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910969179.4A Withdrawn CN110837429A (en) 2019-10-12 2019-10-12 Intelligent repairing method and device for online codes of web terminal

Country Status (1)

Country Link
CN (1) CN110837429A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111737040A (en) * 2020-06-22 2020-10-02 北京字节跳动网络技术有限公司 Program code repairing method and device
CN111858113A (en) * 2019-04-30 2020-10-30 北京达佳互联信息技术有限公司 Application program repairing method, device, service system and storage medium
CN113672838A (en) * 2021-08-30 2021-11-19 挂号网(杭州)科技有限公司 Code repairing method and device, electronic equipment and storage medium
CN113791818A (en) * 2021-09-15 2021-12-14 上海浦东发展银行股份有限公司 Code improvement method, device, medium and equipment based on measurement platform
CN114090450A (en) * 2021-11-24 2022-02-25 深圳市第三方检测技术有限公司 Third-party detection credible data implementation method and system for software program testing
CN114328259A (en) * 2021-12-31 2022-04-12 北京金堤科技有限公司 Error log analysis method and device, electronic equipment and computer storage medium

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111858113A (en) * 2019-04-30 2020-10-30 北京达佳互联信息技术有限公司 Application program repairing method, device, service system and storage medium
CN111737040A (en) * 2020-06-22 2020-10-02 北京字节跳动网络技术有限公司 Program code repairing method and device
CN111737040B (en) * 2020-06-22 2024-05-28 北京字节跳动网络技术有限公司 Program code repairing method and device
CN113672838A (en) * 2021-08-30 2021-11-19 挂号网(杭州)科技有限公司 Code repairing method and device, electronic equipment and storage medium
CN113791818A (en) * 2021-09-15 2021-12-14 上海浦东发展银行股份有限公司 Code improvement method, device, medium and equipment based on measurement platform
CN113791818B (en) * 2021-09-15 2024-04-30 上海浦东发展银行股份有限公司 Code improvement method, device, medium and equipment based on measurement platform
CN114090450A (en) * 2021-11-24 2022-02-25 深圳市第三方检测技术有限公司 Third-party detection credible data implementation method and system for software program testing
CN114328259A (en) * 2021-12-31 2022-04-12 北京金堤科技有限公司 Error log analysis method and device, electronic equipment and computer storage medium

Similar Documents

Publication Publication Date Title
CN110837429A (en) Intelligent repairing method and device for online codes of web terminal
CN110704304A (en) Application program testing method and device, storage medium and server
CN110442378B (en) Method and system for modifying interface document
CN111984228B (en) Interface document processing method and device, computer equipment and storage medium
CN110851351A (en) Deployment environment testing method and device, computer equipment and storage medium
CN113448862B (en) Software version testing method and device and computer equipment
CN111078568A (en) Code specification method and device, computer equipment and storage medium
CN110659210A (en) Information acquisition method and device, electronic equipment and storage medium
CN112561370A (en) Software version management method and device, computer equipment and storage medium
CN112540725A (en) Nonvolatile data storage method, embedded system and storage medium
CN110147354B (en) Batch data editing method, device, computer equipment and storage medium
CN111324375A (en) Code management method and device, computer equipment and storage medium
EP3514680A1 (en) Identification of changes in functional behavior and runtime behavior of a system during maintenance cycles
CN112286532A (en) Method and system for realizing front-end code formatting based on ESLint and Prettier
CN117171030A (en) Method, device, equipment and storage medium for detecting software running environment
CN111078529A (en) Client write-in module testing method and device and electronic equipment
CN112148581A (en) Code specification checking method, device, system and storage medium
CN110825795A (en) Method, device and equipment for accessing database and computer readable storage medium
CN111858532A (en) Solid state disk log export method, system and device and readable storage medium
CN114756440B (en) Data writing method, device and equipment of smart card and storage medium
CN115269402B (en) Test data matching method, device, computer equipment and storage medium
CN112559370A (en) Front-end-based React project unit testing method and related equipment
CN113568632A (en) Server power firmware updating method and device, computer equipment and storage medium
CN118227438A (en) Information prompting method, device, equipment and medium for abnormal stack
CN113760690A (en) Method and device for analyzing program interface and computer equipment

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
WW01 Invention patent application withdrawn after publication

Application publication date: 20200225

WW01 Invention patent application withdrawn after publication