CN116340115A - Method, system, equipment and medium for monitoring and early warning of error of front end of applet - Google Patents

Method, system, equipment and medium for monitoring and early warning of error of front end of applet Download PDF

Info

Publication number
CN116340115A
CN116340115A CN202310309534.1A CN202310309534A CN116340115A CN 116340115 A CN116340115 A CN 116340115A CN 202310309534 A CN202310309534 A CN 202310309534A CN 116340115 A CN116340115 A CN 116340115A
Authority
CN
China
Prior art keywords
information
error
code
page
developer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310309534.1A
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.)
Ctrip Travel Information Technology Shanghai Co Ltd
Original Assignee
Ctrip Travel Information Technology Shanghai 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 Ctrip Travel Information Technology Shanghai Co Ltd filed Critical Ctrip Travel Information Technology Shanghai Co Ltd
Priority to CN202310309534.1A priority Critical patent/CN116340115A/en
Publication of CN116340115A publication Critical patent/CN116340115A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/32Monitoring with visual or acoustical indication of the functioning of the machine
    • G06F11/324Display of status information
    • G06F11/327Alarm or error message display
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3089Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention provides a method, a system, equipment and a medium for monitoring and early warning errors at the front end of an applet, wherein the method comprises the following steps: acquiring a source code and a production code corresponding to the applet; establishing a first mapping relation between a source code and a production code, and establishing a preset database; a second mapping relation between the active codes and developer information is stored in a preset database; acquiring the runtime error information of the applet; determining an error code matched with the runtime error information in the source code according to the first mapping relation, and acquiring the position information of the error code; determining developer information matched with the runtime error information according to the second mapping relation, and taking the developer information as target developer information; generating alarm information according to the position information of the error code and the runtime error information, and sending the alarm information to developer equipment corresponding to the target developer information; the invention is beneficial to improving the repair efficiency of the front-end error of the applet.

Description

Method, system, equipment and medium for monitoring and early warning of error of front end of applet
Technical Field
The invention relates to the technical field of computers, in particular to a method, a system, equipment and a medium for monitoring and early warning of errors at the front end of an applet.
Background
For small program merchants, the access amount of users is large, and the used machine types and scenes are complex and various, so that when users encounter problems, the users cannot be guaranteed to feed back in time, and clear and detailed related information is provided. Many small program products provided by merchants are large in volume and are developed by multiple departments in a team-to-team cooperation mode, and the involved developers reach hundreds of people, so that when front-end errors occur, corresponding development responsible persons need to be found timely and accurately. And the product users are wide, and once the front-end error occurs, the use of a large number of users can be influenced, so that a developer needs to respond as soon as possible and solve the online problem.
However, the functionality of the related products of front-end error analysis provided by various types of applet official platforms is limited: for example, many applet platforms only provide front-end error collection and presentation functionality. The method can provide less reference information, which is unfavorable for developers of merchants to quickly solve the front-end errors of the small programs.
Therefore, how to actively collect the front-end error of the applet, and to quickly locate the error code position in the applet source code and notify the corresponding accurate responsible developer, so as to quickly solve the front-end error and provide more abundant reference information is a main problem facing the present.
It should be noted that the information disclosed in the above background section is only for enhancing understanding of the background of the invention and thus may include information that does not form the prior art that is already known to those of ordinary skill in the art.
Disclosure of Invention
Aiming at the problems in the prior art, the invention aims to provide a method, a system, equipment and a medium for monitoring and early warning the front end errors of an applet, and provides a general and complete automatic error monitoring and early warning scheme during the operation of the applet.
In order to achieve the above purpose, the invention provides an applet front-end error monitoring and early warning method, which comprises the following steps:
s110, acquiring a source code and a production code corresponding to the applet;
s120, establishing a first mapping relation between the source code and the production code, and establishing a preset database; the second mapping relation between the source codes and developer information is stored in the preset database;
s130, acquiring the runtime error information of the applet;
s140, determining an error code matched with the runtime error information in the source code according to the first mapping relation, and acquiring the position information of the error code;
S150, determining developer information matched with the runtime error information according to the second mapping relation, and taking the developer information as target developer information; and
and S160, generating alarm information according to the position information of the error code and the runtime error information, and sending the alarm information to developer equipment corresponding to the target developer information.
Optionally, step S120 includes:
acquiring a code mapping information file corresponding to the applet;
establishing a third mapping relation between the production codes and the code mapping information file, and establishing a fourth mapping relation between the code mapping information file and the source codes; and
and establishing a first mapping relation between the source code and the production code according to the third mapping relation and the fourth mapping relation.
Optionally, step S110 further includes:
injecting a construction version number into the source code to generate a production code corresponding to the source code;
the production codes are issued and stored in a storage partition corresponding to a preset storage partition number;
step S120 includes:
establishing a third mapping relation between the production codes and the code mapping information file based on the construction version number;
And establishing a fourth mapping relation between the code mapping information file and the source code based on the preset storage partition number.
Optionally, the second mapping relation records a mapping relation between each page path in the source code and corresponding developer information; the runtime error information comprises an error reporting page and a first page path corresponding to the error reporting page; step S150 includes:
and determining the developer information matched with the first page path according to the second mapping relation, and taking the developer information as target developer information.
Optionally, step S150 includes:
performing offset correction on the first page path corresponding to the error reporting page to obtain a corrected first page path;
and determining developer information matched with the corrected first page path according to the second mapping relation, and taking the developer information as target developer information.
Optionally, the runtime error information includes error stack information, where the error stack information records a plurality of pieces of error thread information; each error thread information record a corresponding second page path;
step S110 includes:
acquiring a global configuration file associated with the source code;
Acquiring all registered third page paths in the applet based on the global configuration file;
the offset correction is performed on the first page path corresponding to the error reporting page, so as to obtain a corrected first page path, which comprises the following steps:
analyzing the error stack information in the runtime error information to obtain a second page path;
according to all registered third page paths, matching the second page paths to obtain target page paths;
and when the first page path is different from the target page path, taking the target page path as a corrected first page path.
Optionally, step S160 includes:
under the test environment of the applet, acquiring fourth page paths corresponding to all the runtime error information every first preset time length, and acquiring unrepaired error reporting information every second preset time length;
generating a first page path list according to a fourth page path in the runtime error information and a fifth page path in the unrepaired error information;
and generating alarm information according to the position information of the error code and the first page path list.
Optionally, step S160 includes:
under the production environment of the applet, acquiring sixth page paths corresponding to all the runtime error information every third preset time length;
generating a second page path list according to the sixth page path;
and generating alarm information according to the second page path list and the position information of the error code.
Optionally, step S160 further includes:
acquiring error reporting amounts corresponding to all error types respectively based on the runtime error information in a fourth preset time length of each interval;
screening to obtain an error type with the error reporting quantity larger than a first preset threshold value as a target error type;
acquiring a seventh page path corresponding to the runtime error information containing the target error type, and generating a third page path list according to the seventh page path;
and generating alarm information according to the second page path list and the position information of the error code, wherein the alarm information comprises:
and generating alarm information according to the position information of the error code, the second page path list and the third page path list.
The invention also provides an applet front-end error monitoring and early warning system for realizing the applet front-end error monitoring and early warning method, which comprises the following steps:
The source code acquisition module acquires a source code and a production code corresponding to the applet;
the mapping relation establishing module establishes a first mapping relation between the source code and the production code and establishes a preset database; the second mapping relation between the source codes and developer information is stored in the preset database;
the front-end error acquisition module acquires the runtime error information of the applet;
the source code mapping module is used for determining an error code matched with the runtime error information in the source code according to the first mapping relation and acquiring the position information of the error code;
the target developer determining module is used for determining developer information matched with the runtime error information according to the second mapping relation, and taking the developer information as target developer information; and
and the alarm notification module is used for generating alarm information according to the position information of the error code and the runtime error information and sending the alarm information to developer equipment corresponding to the target developer information.
The invention also provides a small program front end error monitoring and early warning device, which comprises:
a processor;
a memory in which an executable program of the processor is stored;
Wherein the processor is configured to execute the steps of any one of the applet front end error monitoring and early warning methods described above via execution of the executable program.
The invention also provides a computer readable storage medium for storing a program, which when being executed by a processor, realizes the steps of the method for monitoring and early warning the front end error of any small program.
Compared with the prior art, the invention has the following advantages and outstanding effects:
the method, the system, the equipment and the medium for monitoring and early warning the errors at the front end of the applet provide the automatic acquisition capability of the errors of the applet, establish source code mapping between source codes and production codes, and can position the corresponding source code position when the page reports errors; thereby assisting a developer to quickly and accurately locate the error cause and improving the repairing efficiency; and according to the positioned source codes, the developer in charge of development can be rapidly determined and notification alarm information is sent, and the repair efficiency of the front-end error of the applet is improved.
Drawings
Other features, objects and advantages of the present invention will become more apparent upon reading of the detailed description of non-limiting embodiments, made with reference to the following drawings.
FIG. 1 is a schematic diagram of an error monitoring and early warning method for a front end of an applet according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an error monitoring and early warning method for a front end of an applet according to another embodiment of the present invention;
FIG. 3 is a schematic diagram of an error monitoring and early warning method for a front end of an applet according to another embodiment of the present invention;
FIG. 4 is a schematic diagram of an error monitoring and early warning method for a front end of an applet according to another embodiment of the present invention;
FIG. 5 is a schematic diagram of an error monitoring and early warning method for a front end of an applet according to another embodiment of the present invention;
FIG. 6 is a schematic diagram of an error monitoring and early warning method for a front end of an applet according to another embodiment of the present invention;
FIG. 7 is a schematic diagram of an error monitoring and early warning system at the front end of an applet according to an embodiment of the invention;
FIG. 8 is a schematic diagram of a device for monitoring and early warning of errors at the front end of an applet according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a computer readable storage medium according to an embodiment of the present invention.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments may be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The same reference numerals in the drawings denote the same or similar structures, and thus a repetitive description thereof will be omitted.
As shown in fig. 1, an embodiment of the invention discloses a method for monitoring and early warning of front end errors of a small program, which comprises the following steps:
s110, acquiring source codes and production codes corresponding to the applets. Specifically, the source code developed is generally combined, compressed, compiled, and the like to obtain the production code. The production code is the code corresponding to the on-line environment of the applet.
S120, establishing a first mapping relation between the source code and the production code, and establishing a preset database. The second mapping relation between the source code and the developer information is stored in the preset database. Specifically, for example, the source code includes a plurality of first code blocks, and the production code includes a plurality of second code blocks. A first mapping relationship is established between a first code block of the source code and a second code block of the production code. That is, each second code block in the production code can be successfully mapped with a first code block in the source code.
The source code contains a plurality of pieces of page path information, and each page path corresponds to developer information, namely a developer responsible for developing the page, which can be a development responsible person. The mapping relation between the applet page paths and the developers is collected in advance and stored in a preset database, after the error of the front end of the applet occurs subsequently, the corresponding page paths can be obtained after the error-reported page is obtained, and then the corresponding developer or development responsible person can be positioned, so that the corresponding development responsible person is accurately notified, and the page error repairing efficiency is improved.
As shown in fig. 2, in the present embodiment, step S120 includes:
s121, acquiring a code mapping information file corresponding to the applet.
S122, establishing a third mapping relation between the production codes and the code mapping information file, and establishing a fourth mapping relation between the code mapping information file and the source codes. and
S123, according to the third mapping relation and the fourth mapping relation, a first mapping relation is established between the source code and the production code, and a preset database is established.
The code mapping information file is a SourceMap file. The mapping between source codes and SourceMap files can only be realized in the prior related art, so that the source code mapping cannot be realized after the front-end page fault occurs. According to the embodiment, the mapping relation is established between the source code, the SourceMap file and the production code through the third mapping relation and the fourth mapping relation, and the corresponding source code is found after the error occurs in the running applet code package. Therefore, when an alarm occurs, the error reason can be rapidly positioned through the source code mapping system, and the error repairing efficiency is improved.
S130, acquiring the runtime error information of the applet. The runtime error information is the js error object when the applet reports the error. It should be noted that, the operation of the applet in this step mainly occurs in the test link of the applet, that is, the runtime error information of the applet in the test environment is obtained. Therefore, the possible business report errors during the operation are captured in the development and test stage, and the errors are prevented from being released to the production environment, so that the online error quantity is reduced, and the user experience can be effectively improved.
After capturing the error, the applet client reports the embedded point data to the applet merchant server, wherein the embedded point data can comprise an error reporting page, error reporting information, error stack information, a path where the error reporting page is located (i.e. a first page path), a construction version number and an app id, so that the applet merchant server can conveniently perform source code positioning and alarm to a developer according to the reported embedded point data.
In particular, when the applet client runs, all error information can be captured in API interfaces (such as onError and onendledreject callback functions) provided by the applet platform, and then filtering, processing and extracting the error information can be performed.
And S140, determining an error code matched with the runtime error information in the source code according to the first mapping relation, and acquiring the position information of the error code. Specifically, the runtime error information includes error stack information, where the error stack information records position information corresponding to the error-reported production code, and includes page path, row information, and column information. The error stack information also records the error type corresponding to the error reporting information. The error type may be, for example, a parameter variable that is not defined. And then positioning the corresponding error code in the source code according to the first mapping relation and the position information corresponding to the error-reported production code, and obtaining the position information of the error code.
And S150, determining developer information matched with the runtime error information as target developer information according to the second mapping relation.
Specifically, the second mapping relation records a mapping relation between each page path in the source code and corresponding developer information. The runtime error information includes an error reporting page and a first page path corresponding to the error reporting page. In this step, developer information matching the first page path is determined as target developer information according to the second mapping relation.
Alternatively, the page path where the error is located may be mapped to the corresponding minimum business line unit, and then the corresponding developer or administrator may be queried as the target developer information. Therefore, the method is favorable for realizing further fine granularity division of positioning developers, ensures that the determination of the developers is more accurate, and is favorable for further improving the error repair efficiency.
And S160, generating alarm information according to the position information of the error code and the runtime error information, and sending the alarm information to developer equipment corresponding to the target developer information. The alarm information comprises the position information of the error code, the position information of the error code in the source code, the page path where the error page is located and the error type, and the alarm information is sent to the developer in charge correspondingly, so that the repair efficiency of the front-end page error is improved.
The embodiment of the invention provides a complete small program front-end error monitoring and early warning solution, realizes the acquisition of possible business reporting errors in the operation in the development and test stages, and avoids the release of the errors to the production environment, thereby reducing the on-line error quantity; and when an alarm occurs, the error cause can be rapidly positioned through the source code mapping system, and a developer responsible for development is found, so that the page error repairing efficiency is improved.
In other embodiments of the present invention, step S160 further includes: acquiring the current environment in which the applet is located when the applet is in error; the current environment is a test environment or a production environment. The production environment is an online environment, i.e., an environment used by a user. And the repair time limit corresponding to the production environment is smaller than the repair time limit corresponding to the test environment.
And then in the step, generating alarm information according to the position information of the error code, the current environment where the error occurs and the error information when the error occurs. That is, the alert information includes the current environment in which the applet is located when an error occurs. The repair time limit corresponding to the current environment can be sent to the developer, especially in the production environment, so that the developer is reminded of the need of repairing the error as soon as possible; the method is beneficial to ensuring the use experience of the applet of the user.
In another embodiment of the present application, another applet front end error monitoring and early warning method is disclosed. As shown in fig. 3, the method is based on the corresponding embodiment of fig. 2, where step S110 is replaced by step S111: acquiring source codes corresponding to the applets; injecting a build version number into the source code to generate a production code corresponding to the source code; and publishing and storing the production codes in a storage partition corresponding to a preset storage partition number.
Step S122 is replaced with step S1221:
based on the construction version number, a third mapping relation is established between the production codes and the code mapping information file; and establishing a fourth mapping relation between the code mapping information file and the source code based on the preset storage partition number.
Specifically, a build version number (i.e., buildrid) can be injected into the merging link of the source code, and when the production code is uploaded and issued to the applet platform server, a storage partition corresponding to a preset storage partition number (i.e., robotId) is fixed and used as an issuing link; and using other storage partition numbers distributed by the applet platform in a development test link.
In some alternative embodiments, the applet corresponds to an app id that is also uploaded in the process of uploading the production code to the applet platform server. The sourcemap file corresponding to the applet can be uniquely determined from the appId and buildrid. Then in the error collection reporting step of step S130, the current app id and the buildld injected during release may be reported together for reference by the developer, so as to facilitate improvement of the repair efficiency of the developer.
In another embodiment of the present application, another applet front end error monitoring and early warning method is disclosed. As shown in fig. 4, the method includes, based on the corresponding embodiment of fig. 1, step S150:
s151, performing offset correction on the first page path corresponding to the error reporting page to obtain a corrected first page path.
And S152, determining developer information matched with the corrected first page path according to the second mapping relation as target developer information.
The embodiment of the invention can also carry out offset correction on the page path where the error reporting page is located, can accurately inform corresponding developers, and avoids the occurrence of the situation that the determined corresponding responsible developer is an error person, thereby being beneficial to improving the front-end error repairing efficiency.
Further, as shown in fig. 5, in some alternative embodiments, the runtime error information includes error stack information based on the corresponding embodiment of fig. 4. The error stack information is recorded with a plurality of pieces of error thread information. Each error thread information records a corresponding second page path.
Step S110 is replaced with step S112: acquiring a source code and a production code corresponding to an applet, and acquiring a global configuration file associated with the source code; and acquiring all registered third page paths in the applet based on the global configuration file.
The step S151 includes:
s1511, analyzing the error stack information in the runtime error information to obtain a second page path.
S1512, according to all registered third page paths, matching the second page paths to obtain a target page path.
And S1513, when the first page path is different from the target page path, taking the target page path as the corrected first page path.
In this embodiment, the step S152 is replaced with a step S1521: and determining developer information matched with the target page path according to the second mapping relation, and taking the developer information as target developer information.
When the matching of the third page path and the second page path fails, the first page path is not changed, and the developer information matched with the first page path is determined as target developer information according to the second mapping relation. The character string corresponding to the target page path is a part of the character string corresponding to the second page path, that is, the character string corresponding to the second page path includes the character string corresponding to the target page path.
In this embodiment, when the second page path and all the third page paths are matched, a greedy matching algorithm is adopted, which is not limited to this embodiment.
The global configuration file is an app.json file corresponding to the applet. app.json is the global configuration of the current applet, and all page paths, window appearances, interface appearances, bottom tab, etc. can be set for applet items through app.json.
Illustratively, if the error stack information includes "https:// usr/pages/flight/aaa/index:11:22", then the resolved second page path is: pages/flight/aaa/index. All registered third page paths include: "pages/flight/aaa/index, pages/flight/aaa/booking, pages/flight/bbb/index", matching the path to the most strings by greedy algorithm matching algorithm, as the target page path: pages/flight/aaa/index. In addition, when a plurality of character strings meet the condition, the first page path is taken as a target page path.
Although the page path on which this error information is captured (i.e., the page that the user is browsing) is pages/hotel/ccc, the page path generates an offset phenomenon. If the corresponding developer is determined according to the wrong page path, the developer is caused to determine the error, and the error repairing efficiency is adversely affected. For instance, in this example, it is the developer of the flight page that is notified, rather than the developer of the hotel (hotel) page, that is correct.
Therefore, the offset correction is performed on the page path where the error reporting page is located, so that corresponding developers can be accurately notified, and the situation that the determined corresponding responsible developer is an error person is avoided, thereby being beneficial to improving the front-end error repairing efficiency.
In another embodiment of the present application, another applet front end error monitoring and early warning method is disclosed. Based on the above corresponding embodiment of fig. 1, step S160 includes:
s161, under the test environment of the small program, acquiring fourth page paths corresponding to all the runtime error information every first preset time length, and acquiring unrepaired error reporting information every second preset time length.
S162, generating a first page path list according to a fourth page path in the runtime error information and a fifth page path in the unrepaired error information.
S163, generating alarm information according to the position information of the error code and the first page path list, and sending the alarm information to developer equipment corresponding to target developer information.
The first page path list includes the fourth page path and the fifth page path. For example, the first preset time period may be 1 minute, and the second preset time period may be 10 minutes. The invention is not limited thereto.
In this embodiment, in the test environment, the server side obtains the error reporting amount of each page path every 1 minute, and as long as the page has errors, the error information card is pushed to the developer responsible for the corresponding page. On the other hand, the unrepaired errors in the second preset time period are reminded by sending the message again, so that the possible business error reporting during the capturing operation in the test stage is realized, the errors are prevented from being released to the production environment, the online error amount is reduced, and the user experience can be effectively improved.
In other embodiments, the error can be captured in time under the development environment of the applet, which is helpful for the developer to modify the first time, for example, the server side can obtain the error reporting amount of each page path every 1 minute, and the error information card can be pushed to the developer responsible for the error if the page has errors. Therefore, the possible business report errors during the operation are captured in the development stage, and the errors are prevented from being released to the production environment, so that the online error quantity is reduced, and the user experience can be effectively improved.
In another embodiment of the present application, another applet front end error monitoring and early warning method is disclosed. Based on the foregoing corresponding embodiment of fig. 1 or fig. 6, step S160 includes:
S164, under the production environment of the small program, acquiring sixth page paths corresponding to all the runtime error information every third preset time length.
And S165, generating a second page path list according to the sixth page path.
S166, when the error reporting amount corresponding to all the runtime error information is larger than a second preset threshold, generating alarm information according to the second page path list and the position information of the error codes.
Wherein the second page path list includes all sixth page paths. For example, the third preset duration may be 1 hour, and the second preset threshold may be 300. The invention is not limited thereto.
Further, in some alternative embodiments, as shown in fig. 6, on the basis of the foregoing embodiment corresponding to fig. 1, step S160 includes:
s167, acquiring error reporting amounts corresponding to all error types respectively based on the runtime error information in each interval fourth preset time period; and acquiring sixth page paths corresponding to all the runtime error information in every third preset time length.
S168, screening and obtaining error types with error reporting quantity larger than a first preset threshold value as target error types.
S169, obtaining a seventh page path corresponding to the runtime error information containing the target error type, and generating a third page path list according to the seventh page path; and generating a second page path list according to the sixth page path.
S170, generating alarm information according to the position information of the error code, the second page path list and the third page path list, and sending the alarm information to developer equipment corresponding to target developer information.
Wherein the third page path list includes all seventh page paths. The error type may be, for example, a parameter variable that is not defined. Because the type of errors can occur in different pages, when the production environment has errors, in order to sense the production errors more quickly and comprehensively, the invention monitors the production errors in two dimensions: the type of error and the amount of errors reported under each page path. Therefore, errors can be positioned more timely and quickly in the production environment, the errors can be solved timely, and the use experience of users is guaranteed.
The invention screens the error reporting quantity of different error types, sorts and alarms, and informs corresponding developers and administrators according to the page paths of the errors, so that the developers can be prevented from missing important error reporting information, and the experience of using the applet by the user is ensured.
For example, the fourth preset time period may be 5 minutes, and the first preset threshold may be 100. The invention is not limited thereto.
It should be noted that, all the embodiments disclosed in the present application may be freely combined, and the technical solution obtained after combination is also within the protection scope of the present application.
As shown in fig. 7, an embodiment of the present invention further discloses an applet front-end error monitoring and early warning system 7, which includes:
the source code obtaining module 71 obtains source codes and production codes corresponding to the applet.
The mapping relation establishing module 72 establishes a first mapping relation between the source code and the production code, and establishes a preset database. The second mapping relation between the source code and the developer information is stored in the preset database.
The front-end error acquisition module 73 acquires the runtime error information of the applet.
The source code mapping module 74 determines an error code matching the runtime error information in the source code according to the first mapping relation, and obtains the position information of the error code.
The target developer determination module 75 determines developer information matching the runtime error information as target developer information, based on the second mapping relation. and
The alarm notification module 76 generates alarm information based on the position information of the error code and the runtime error information, and transmits the alarm information to the developer device corresponding to the target developer information.
It can be understood that the applet front end error monitoring and early warning system of the invention also comprises other existing functional modules supporting the operation of the applet front end error monitoring and early warning system. The applet front end error monitoring and early warning system shown in fig. 7 is only an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
The applet front end error monitoring and early warning system in this embodiment is used to implement the method for performing the above-mentioned applet front end error monitoring and early warning, so the description of the method for performing the applet front end error monitoring and early warning may be referred to for the specific implementation steps of the applet front end error monitoring and early warning system, and will not be repeated herein.
The embodiment of the invention also discloses an applet front-end error monitoring and early warning device, which comprises a processor and a memory, wherein the memory stores an executable program of the processor; the processor is configured to perform the steps in the applet front end error monitoring and early warning method described above via execution of an executable program. FIG. 8 is a schematic diagram of the structure of the small program front end error monitoring and early warning device disclosed by the invention. An electronic device 600 according to this embodiment of the invention is described below with reference to fig. 8. The electronic device 600 shown in fig. 8 is merely an example, and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 8, the electronic device 600 is in the form of a general purpose computing device. Components of electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one memory unit 620, a bus 630 connecting the different platform components (including memory unit 620 and processing unit 610), a display unit 640, etc.
Wherein the storage unit stores program code that is executable by the processing unit 610 such that the processing unit 610 performs the steps according to various exemplary embodiments of the present invention described in the applet front end error monitoring and early warning method section described above in the present specification. For example, the processing unit 610 may perform the steps as shown in fig. 1.
The storage unit 620 may include readable media in the form of volatile storage units, such as Random Access Memory (RAM) 6201 and/or cache memory unit 6202, and may further include Read Only Memory (ROM) 6203.
The storage unit 620 may also include a program/utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
Bus 630 may be a local bus representing one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or using any of a variety of bus architectures.
The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboard, pointing device, bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 600, and/or any device (e.g., router, modem, etc.) that enables the electronic device 600 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 650. Also, electronic device 600 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 over the bus 630. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 600, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage platforms, and the like.
The invention also discloses a computer readable storage medium for storing a program, which is executed to realize the steps in the small program front end error monitoring and early warning method. In some possible embodiments, the aspects of the present invention may also be implemented in the form of a program product comprising program code for causing a terminal device to carry out the steps according to the various exemplary embodiments of the invention as described in the applet front end error monitoring and warning method described in the present specification, when the program product is run on the terminal device.
As described above, the program of the computer-readable storage medium of this embodiment provides an automatic small program error collection capability when executed, establishes source code mapping between source code and production code, and can locate a corresponding source code position when a page is misplaced; thereby assisting a developer to quickly and accurately locate the error cause and improving the repairing efficiency; and according to the positioned source codes, the developer in charge of development can be rapidly determined and notification alarm information is sent, and the front-end error repairing efficiency is improved.
Fig. 9 is a schematic structural view of a computer-readable storage medium of the present invention. Referring to fig. 9, a program product 800 for implementing the above-described method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable storage medium may also be any readable medium that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
The method, the system, the equipment and the medium for monitoring and early warning the errors at the front end of the applet provide the automatic acquisition capability of the errors of the applet, establish source code mapping between source codes and production codes, and can position the corresponding source code position when the page reports errors; thereby assisting a developer to quickly and accurately locate the error cause and improving the repairing efficiency; and according to the positioned source codes, the developer in charge of development can be rapidly determined and notification alarm information is sent, and the front-end error repairing efficiency is improved.
The embodiment of the invention can also carry out offset correction on the page path where the error reporting page is located, can accurately inform corresponding developers, avoids the occurrence of the situation that the determined corresponding responsible developer is an error person, and is also beneficial to improving the front-end error repairing efficiency.
The foregoing is a further detailed description of the invention in connection with the preferred embodiments, and it is not intended that the invention be limited to the specific embodiments described. It will be apparent to those skilled in the art that several simple deductions or substitutions may be made without departing from the spirit of the invention, and these should be considered to be within the scope of the invention.

Claims (12)

1. The method for monitoring and early warning the front end errors of the small program is characterized by comprising the following steps of:
s110, acquiring a source code and a production code corresponding to the applet;
s120, establishing a first mapping relation between the source code and the production code, and establishing a preset database; the second mapping relation between the source codes and developer information is stored in the preset database;
s130, acquiring the runtime error information of the applet;
s140, determining an error code matched with the runtime error information in the source code according to the first mapping relation, and acquiring the position information of the error code;
S150, determining developer information matched with the runtime error information according to the second mapping relation, and taking the developer information as target developer information; and
and S160, generating alarm information according to the position information of the error code and the runtime error information, and sending the alarm information to developer equipment corresponding to the target developer information.
2. The monitoring and early warning method according to claim 1, wherein step S120 includes:
acquiring a code mapping information file corresponding to the applet;
establishing a third mapping relation between the production codes and the code mapping information file, and establishing a fourth mapping relation between the code mapping information file and the source codes; and
and establishing a first mapping relation between the source code and the production code according to the third mapping relation and the fourth mapping relation.
3. The monitoring and early warning method according to claim 2, wherein step S110 further includes:
injecting a construction version number into the source code to generate a production code corresponding to the source code;
the production codes are issued and stored in a storage partition corresponding to a preset storage partition number;
step S120 includes:
Establishing a third mapping relation between the production codes and the code mapping information file based on the construction version number;
and establishing a fourth mapping relation between the code mapping information file and the source code based on the preset storage partition number.
4. The monitoring and early warning method according to claim 1, wherein the second mapping relation records a mapping relation between each page path in the source code and corresponding developer information; the runtime error information comprises an error reporting page and a first page path corresponding to the error reporting page; step S150 includes:
and determining the developer information matched with the first page path according to the second mapping relation, and taking the developer information as target developer information.
5. The monitoring and early warning method according to claim 4, wherein step S150 includes:
performing offset correction on the first page path corresponding to the error reporting page to obtain a corrected first page path;
and determining developer information matched with the corrected first page path according to the second mapping relation, and taking the developer information as target developer information.
6. The monitoring and early warning method according to claim 5, wherein the runtime error information includes error stack information, the error stack information having a plurality of pieces of error thread information recorded therein; each error thread information record a corresponding second page path;
Step S110 includes:
acquiring a global configuration file associated with the source code;
acquiring all registered third page paths in the applet based on the global configuration file;
the offset correction is performed on the first page path corresponding to the error reporting page, so as to obtain a corrected first page path, which comprises the following steps:
analyzing the error stack information in the runtime error information to obtain a second page path;
according to all registered third page paths, matching the second page paths to obtain target page paths;
and when the first page path is different from the target page path, taking the target page path as a corrected first page path.
7. The monitoring and early warning method according to claim 1, wherein step S160 includes:
under the test environment of the applet, acquiring fourth page paths corresponding to all the runtime error information every first preset time length, and acquiring unrepaired error reporting information every second preset time length;
generating a first page path list according to a fourth page path in the runtime error information and a fifth page path in the unrepaired error information;
And generating alarm information according to the position information of the error code and the first page path list.
8. The monitoring and early warning method according to claim 1, wherein step S160 includes:
under the production environment of the applet, acquiring sixth page paths corresponding to all the runtime error information every third preset time length;
generating a second page path list according to the sixth page path;
and generating alarm information according to the second page path list and the position information of the error code.
9. The monitoring and early warning method according to claim 8, wherein step S160 further comprises:
acquiring error reporting amounts corresponding to all error types respectively based on the runtime error information in a fourth preset time length of each interval;
screening to obtain an error type with the error reporting quantity larger than a first preset threshold value as a target error type;
acquiring a seventh page path corresponding to the runtime error information containing the target error type, and generating a third page path list according to the seventh page path;
and generating alarm information according to the second page path list and the position information of the error code, wherein the alarm information comprises:
And generating alarm information according to the position information of the error code, the second page path list and the third page path list.
10. An applet front end error monitoring and early warning system for implementing the applet front end error monitoring and early warning method according to claim 1, the system comprising:
the source code acquisition module acquires a source code and a production code corresponding to the applet;
the mapping relation establishing module establishes a first mapping relation between the source code and the production code and establishes a preset database; the second mapping relation between the source codes and developer information is stored in the preset database;
the front-end error acquisition module acquires the runtime error information of the applet;
the source code mapping module is used for determining an error code matched with the runtime error information in the source code according to the first mapping relation and acquiring the position information of the error code;
the target developer determining module is used for determining developer information matched with the runtime error information according to the second mapping relation, and taking the developer information as target developer information; and
and the alarm notification module is used for generating alarm information according to the position information of the error code and the runtime error information and sending the alarm information to developer equipment corresponding to the target developer information.
11. An applet front end error monitoring and early warning device, comprising:
a processor;
a memory in which an executable program of the processor is stored;
wherein the processor is configured to perform the steps of the applet front end error monitoring and early warning method according to any one of claims 1 to 9 via execution of the executable program.
12. A computer-readable storage medium storing a program, wherein the program when executed by a processor implements the steps of the applet front end error monitoring and early warning method according to any one of claims 1 to 9.
CN202310309534.1A 2023-03-27 2023-03-27 Method, system, equipment and medium for monitoring and early warning of error of front end of applet Pending CN116340115A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310309534.1A CN116340115A (en) 2023-03-27 2023-03-27 Method, system, equipment and medium for monitoring and early warning of error of front end of applet

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310309534.1A CN116340115A (en) 2023-03-27 2023-03-27 Method, system, equipment and medium for monitoring and early warning of error of front end of applet

Publications (1)

Publication Number Publication Date
CN116340115A true CN116340115A (en) 2023-06-27

Family

ID=86890963

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310309534.1A Pending CN116340115A (en) 2023-03-27 2023-03-27 Method, system, equipment and medium for monitoring and early warning of error of front end of applet

Country Status (1)

Country Link
CN (1) CN116340115A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116991748A (en) * 2023-09-27 2023-11-03 腾讯科技(深圳)有限公司 Early warning method and device for abnormal application, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116991748A (en) * 2023-09-27 2023-11-03 腾讯科技(深圳)有限公司 Early warning method and device for abnormal application, electronic equipment and storage medium
CN116991748B (en) * 2023-09-27 2024-01-12 腾讯科技(深圳)有限公司 Early warning method and device for abnormal application, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US8392385B2 (en) Flexible event data content management for relevant event and alert analysis within a distributed processing system
US7856575B2 (en) Collaborative troubleshooting computer systems using fault tree analysis
US9286143B2 (en) Flexible event data content management for relevant event and alert analysis within a distributed processing system
US8713581B2 (en) Selected alert delivery in a distributed processing system
US8943366B2 (en) Administering checkpoints for incident analysis
US8954811B2 (en) Administering incident pools for incident analysis
US9256482B2 (en) Determining whether to send an alert in a distributed processing system
US9602337B2 (en) Event and alert analysis in a distributed processing system
US20120331347A1 (en) Restarting Event And Alert Analysis After A Shutdown In A Distributed Processing System
US9086968B2 (en) Checkpointing for delayed alert creation
US10353760B2 (en) System verification of interactive screenshots and log files between client systems and server systems within a network computing environment
CN112000806A (en) Abnormal log monitoring and analyzing method, system, equipment and storage medium
US9361184B2 (en) Selecting during a system shutdown procedure, a restart incident checkpoint of an incident analyzer in a distributed processing system
CN116340115A (en) Method, system, equipment and medium for monitoring and early warning of error of front end of applet
CN110765090B (en) Log data management method and device, storage medium and electronic equipment
US20170139803A1 (en) Obtaining and analyzing a reduced metric data set
CN111581518A (en) Information pushing method and device
CN109146096B (en) Processing method and device for repair event, storage medium and electronic equipment
CN111784176A (en) Data processing method, device, server and medium
CN113138974B (en) Method and device for detecting database compliance
CN111741046B (en) Data reporting method, data acquisition method, device, equipment and medium
CN113760856A (en) Database management method and device, computer readable storage medium and electronic device
CN111949549A (en) Test request screening method, system, electronic device and storage medium
CN112799957A (en) User behavior based fault handling method, system, device and medium
CN113128943B (en) Data quality monitoring method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination