Disclosure of Invention
The invention provides an exception handling method, an exception handling device, computer equipment and a storage medium, which realize that an exception reason is quickly positioned through an exception reporting management center and reported to an application program monitoring server, the exception solving data is received and alarmed through the application program monitoring server, and the exception solving data is obtained to repair the exception, so that the exception reason is quickly positioned when a network request is abnormal, the exception response time is shortened, the exception can be timely repaired, and the experience satisfaction degree of a user is improved.
An exception handling method comprising:
sending a network request to an application program server through a Native interface; the network request comprises page cache data;
when the application program server processes the network request to be abnormal, receiving abnormal return data from the application program server through the Native interface, and sending the abnormal return data to an abnormal reporting management center; the abnormal return data comprises page data received by the application program server, an abnormal return code and an abnormal grade;
determining an abnormal risk through the abnormal reporting management center according to the abnormal return code and the abnormal grade;
when the abnormal risk is the emergency uploading, acquiring a page operation log corresponding to the network request through the abnormal reporting management center;
packaging and encrypting the page operation log, the page cache data, the page data received by the application program server, the abnormal return code and the abnormal grade by using an MD5 encryption technology to obtain emergency abnormal data;
uploading the emergency abnormal data to an application program monitoring server, so that the application program monitoring server gives an alarm according to the emergency abnormal data, associates the abnormal solution data with the abnormal return code after receiving abnormal solution data input aiming at the alarm, and refreshes a first abnormal solution data set in the application program monitoring server according to the abnormal solution data;
monitoring that a first abnormity solving data set in the application program monitoring server is updated, acquiring the updated first abnormity solving data set, and refreshing the first abnormity solving data set to a second abnormity solving data set in a Native-based cache pool according to the updated first abnormity solving data set;
and acquiring the exception resolution data associated with the exception return code from the second exception resolution data set, and repairing the exception according to the acquired exception resolution data.
An exception handling apparatus comprising:
the request module is used for sending a network request to the application program server through a Native interface; the network request comprises page cache data;
the return module is used for receiving the abnormal return data from the application program server through the Native interface when the application program server processes the network request and the abnormal return data are sent to an abnormal reporting management center; the abnormal return data comprises page data received by the application program server, an abnormal return code and an abnormal grade;
the determining module is used for determining an abnormal risk according to the abnormal return code and the abnormal grade through the abnormal reporting management center;
an obtaining module, configured to obtain, by the exception reporting management center, a page operation log corresponding to the network request when the exception risk is an emergency upload;
the encryption module is used for packaging and encrypting the page operation log, the page cache data, the page data received by the application program server, the abnormal return code and the abnormal grade through an MD5 encryption technology to obtain emergency abnormal data;
the refreshing module is used for uploading the emergency abnormal data to an application program monitoring server so that the application program monitoring server can give an alarm according to the emergency abnormal data, associating the abnormal solution data with the abnormal return code after receiving abnormal solution data which is input aiming at the alarm, and refreshing a first abnormal solution data set in the application program monitoring server according to the abnormal solution data;
the monitoring module is used for monitoring that when a first abnormity solving data set in the application program monitoring server is updated, the updated first abnormity solving data set is obtained, and the first abnormity solving data set is refreshed to a second abnormity solving data set in a Native-based cache pool according to the updated first abnormity solving data set;
and the repairing module is used for acquiring the abnormal solution data associated with the abnormal return code from the second abnormal solution data set and repairing the abnormality according to the acquired abnormal solution data.
A computer device comprising a memory, a processor and a computer program stored in said memory and executable on said processor, said processor implementing the steps of the above-mentioned exception handling method when executing said computer program.
A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned exception handling method.
The exception handling method, the exception handling device, the computer equipment and the storage medium provided by the invention send a network request containing page cache data to an application program server through a Native interface; when the application program server processes the network request to be abnormal, receiving abnormal return data from the application program server through the Native interface, and sending the abnormal return data to an abnormal reporting management center; the abnormal return data comprises page data received by the application program server, an abnormal return code and an abnormal grade; determining an abnormal risk through the abnormal reporting management center according to the abnormal return code and the abnormal grade; when the abnormal risk is the emergency uploading, acquiring a page operation log corresponding to the network request through the abnormal reporting management center; packaging and encrypting the page operation log, the page cache data, the page data received by the application program server, the abnormal return code and the abnormal grade to obtain emergency abnormal data; uploading the emergency abnormal data to an application program monitoring server through an MD5 encryption technology; monitoring that a first abnormity solving data set in the application program monitoring server is updated, acquiring the updated first abnormity solving data set, and refreshing the first abnormity solving data set to a second abnormity solving data set in a Native-based cache pool according to the updated first abnormity solving data set; and acquiring the exception resolution data associated with the exception return code from the second exception resolution data set, and repairing the exception according to the acquired exception resolution data. Thus, when the application program server processes the network request to be abnormal, the abnormal return data is received through the Native interface and reported to the abnormal reporting management center to determine the abnormal risk, when the abnormal risk is reported emergently, the page operation log is obtained, the page operation log is packaged and encrypted through the MD5 encryption technology to obtain the emergency abnormal data, the emergency abnormal data is uploaded to the application program monitoring server, when the first abnormal solution data set is monitored to be updated, the second abnormal solution data set in the cache pool is updated, the abnormal is repaired according to the abnormal solution data in the second abnormal solution data set, therefore, the page operation log is provided through the abnormal reporting management center, the emergency abnormal data which is convenient for rapidly positioning the abnormal reason is generated through the MD5 encryption technology by packaging and encryption, the emergency abnormal data is reported to the application program monitoring server, the application program monitoring server alarms and receives the abnormal solution data, when monitoring the first abnormal solution data set and sending update, acquiring the abnormal solution data to repair the abnormality, so that when the network request is abnormal, the abnormal reason is quickly positioned, the abnormal response time is shortened, the abnormality can be timely repaired, and the experience satisfaction of a user is improved.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present 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.
The exception handling method provided by the invention can be applied to the application environment shown in fig. 1, wherein a client (computer device) communicates with a server through a network. The client (computer device) includes, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, cameras, and portable wearable devices. The server may be implemented as a stand-alone server or as a server cluster consisting of a plurality of servers.
In an embodiment, as shown in fig. 2, an exception handling method is provided, which mainly includes the following steps S10-S80:
s10, sending a network request to the application program server through a Native interface; the network request includes page cache data.
Understandably, after Application software (App, Application) is started, when a user needs to send the network request to the Application server after a homepage or a current page is displayed, the network request is triggered, the network request can be selected according to the user needs, for example, the network request is a page refreshing request, a next-level page loading request, a homepage returning request, and the like, the network request includes the page cache data, the page cache data is data of a current H5 page cached in a cache pool, the Native interface is a Native-based interface, the Native interface provides an interface for the Application software to send any request to the Application server, and the Application server is a server for processing data related to the Application software.
In an embodiment, before the step S10, namely before the network request is issued to the application server through the Native interface, the method includes:
s101, receiving a page request instruction from a current page.
Understandably, the current page is a current page displayed before the network request is sent out, the current page may be an H5 page or a Native page, and the page request instruction is an instruction for requesting to load the current page.
In an embodiment, before the step S101, that is, before the page request instruction from the current page is received, the method includes:
and S1011, constructing the exception reporting management center in a singleton mode.
It should be understood that the implementation mode of the single-case mode may be set according to a requirement, for example, the implementation mode of the single-case mode may be a idle-chinese mode, an starved-chinese mode, an idle-chinese variant mode, a starved-chinese variant mode, a double check mode, a synchronous mode or an enumeration mode, and preferably, the implementation mode of the single-case mode is a double check mode, the exception reporting management center is constructed by the single-case mode, and the exception reporting management center is a center for managing exceptions in application software.
And S1012, creating the cache pool through the exception reporting management center.
Understandably, a Native-based cache pool is created through the exception reporting management center, the cache pool is used for caching data processed by application software in the running process of the mobile terminal, and the cache pool comprises a second exception resolution data set, the page cache data and the like.
In an embodiment, after the step S1012, that is, after the creating the cache pool by the exception reporting management center, the method includes:
s10121, receiving a page loading request of the current page; the page loading request includes the page website.
Understandably, the page loading request is a request triggered when the current page needs to be loaded, the page loading request includes the page website, and the page website is a unique associated website of the current page.
S10122, encapsulating the page loading request into a plurality of configuration parameter requests.
Understandably, each configuration parameter in the page loading request is split and packaged into the configuration parameter request corresponding to each configuration parameter one to one, and the configuration parameters are parameters related to the configuration required in the current page.
S10123, sending each configuration parameter request in a multithreading asynchronous mode, and preloading the configuration parameter loading information into the cache pool after receiving the configuration parameter loading information corresponding to the configuration parameter request.
Understandably, the multithreading asynchronous mode is that one piece of configuration parameter request information corresponds to one thread, a plurality of threads are simultaneously sent out, each piece of configuration parameter request information is independently processed, each piece of configuration parameter request information is asynchronously processed, a preloading process of all pieces of configuration parameter loading information is monitored in real time through the exception reporting management center, and each piece of configuration parameter loading information is stored in the cache pool after each piece of configuration parameter loading information is received.
S10124, determining all the configuration parameter loading information as the page cache data, associating the page cache data with the page website, rendering according to the page cache data, and displaying the current page.
Understandably, determining all the configuration parameter loading information as the page cache data corresponding to the current page, associating the page cache data with the page website corresponding to the current page, rendering and displaying the current page according to the page cache data, namely, constructing an operation process of a DOM (Document Object Model) tree and a CSSOM (Cascading Style Sheets Object Model) tree according to the acquired page cache data, wherein the rendering is an operation process of combining the constructed DOM tree and the CSSOM tree to generate a rendering tree, laying out and rendering the rendering tree to a display screen, and finally displaying the rendered page cache data to obtain the current page.
The invention realizes the receiving of the page loading request of the current page; the page loading request comprises the page website; packaging the page loading request into a plurality of configuration parameter requests; sending each configuration parameter request in a multithreading asynchronous mode, and preloading configuration parameter loading information into the cache pool after the received configuration parameter loading information corresponding to the configuration parameter request; and determining all the configuration parameter loading information as the page cache data, associating the page cache data with the page website, and loading, rendering and displaying the current page according to the page cache data, so that the page cache data is preloaded by the exception report management center in a multithreading asynchronous mode, the loaded page cache data is rendered and displayed, page loading timeliness is accelerated, and page cache data is provided for subsequent exceptions.
And S1013, acquiring a first exception resolution data set in the application program monitoring server, storing the first exception resolution data set into the cache pool, and determining the first exception resolution data set as a second exception resolution data set.
Understandably, the first exception resolution data set is a set of all exception resolution data stored in the application program monitoring server, the first exception resolution data set includes all exception codes and a repair code template corresponding to the exception codes, the exception codes are unique identification codes assigned to an exception when the exception codes occur, the repair code template is a code template for resolving the exception codes corresponding to the exception codes, the first exception resolution data set is downloaded and stored in the cache pool, and the first exception resolution data set is determined as a second exception resolution data set after the downloading is completed.
S1014, when monitoring that the first abnormal solution data set is updated, updating the updated first abnormal solution data set to the second abnormal solution data set.
Understandably, when it is monitored that the first abnormal solution data set is updated, it is indicated that the second abnormal solution data set is inconsistent with the first abnormal solution data set, that is, the second abnormal solution data set is not the latest version, and the updated first abnormal solution data set is downloaded and covers the original second abnormal solution data set, so as to complete the updating operation.
If an exception solving data, namely an exception code and a repairing code template corresponding to the exception code, needs to be newly added, only the first exception solving data set needs to be updated on the application program server, each mobile terminal detects that the first exception solving data set on the application program server is updated, obtains the updated first exception solving data set to the cache pool, covers the second exception solving data set in the original cache pool, updates the second exception solving data set of each mobile terminal, and automatically repairs the mobile terminal with the exception code, so that the expandability, maintainability and transportability of the first exception solving data set are improved.
The invention realizes that the exception reporting management center is constructed in a single-case mode, the cache pool is established, the second exception solution data set is obtained from the application program monitoring server, and the second exception solution data set is updated when the first exception solution data set is monitored to be updated, so that the first exception solution data set is downloaded to the cache pool when the App is started to obtain the second exception solution data set, the second exception solution data set is refreshed in real time, an exception solution is provided in time, the same kind of exceptions are solved quickly, the exception repairing time is shortened, and the experience satisfaction degree of a user is improved.
S102, obtaining the page cache data associated with the page website in the current page.
Understandably, a page is associated with one page website and page cache data, the obtaining mode can be set according to requirements, in one embodiment, the page cache data associated with the page website in the current page is obtained from the application server, and the application server comprises all the page cache data associated with the page website and is directly downloaded and obtained from the application server; in an embodiment, the page cache data associated with the page website in the current page is acquired from the cache pool, and the page cache data associated with the page website is preloaded into the cache pool from the application server through the exception report management center, wherein the exception report management center further includes a center for managing a preloading process of all pages, so that the page loading speed is increased, the page loading time is shortened, the page offline loading is realized, and the user experience satisfaction is improved.
S103, encapsulating the page request instruction and the page cache data into the network request.
Understandably, the page request instruction and the page cache data are encapsulated through the exception reporting management center to obtain the network request.
According to the method and the device, when the page request instruction is received, the page cache data of the current page are obtained and encapsulated into the network request to be sent out, so that when the application program server is abnormal, the abnormal return data is determined according to the page request instruction and the page cache data in the network request, effective data are provided for subsequent positioning of the abnormal reason and repairing of the abnormal, and the abnormal response time length is shortened.
S20, when the application program server processes the network request to be abnormal, receiving abnormal return data from the application program server through the Native interface, and sending the abnormal return data to an abnormal reporting management center; the exception return data comprises application program server received page data, an exception return code and an exception grade.
Understandably, when the application server processes the network request and an abnormality occurs, for example, the application server finds that the content of the network request is missing after receiving the network request or the application server receives a messy code in the network request, the abnormal return data is sent after the application server performs an abnormality judgment on the network request, the abnormality judgment is that the abnormal return data matched with the abnormality is analyzed according to the occurrence of the abnormality, the abnormal return data is received through the Native interface and is sent to the abnormality reporting management center.
The abnormal return data comprises application program server received page data, an abnormal return code and an abnormal grade, and the application program server received page data is data which is associated with the network request and is related to a page and received by the application program server; the exception return code is a classified code for dividing exceptions, for example: the return code corresponding to the network communication request error exception 001 is 404; the return code corresponding to the error abnormity 002 of the network communication server is 500; the corresponding return code of the service end exception 003 of the service request interface is 601 and the like; the abnormal grade is a grade value with a grade relation determined according to the return code and the worst result brought to the user by the abnormal condition, the abnormal grade comprises a high grade value, a middle grade value and a low grade value, and the worst result is a grade value of the experience satisfaction degree of the user predicted according to the page request instruction and the abnormal return code in the network request.
And S30, determining the abnormal risk through the abnormal reporting management center according to the abnormal return code and the abnormal grade.
Understandably, the exception reporting management center may determine the exception risk according to a combination relationship between the exception return code and the exception level, where the exception risk includes an emergency upload and a repair solution.
In an embodiment, in step S30, that is, the determining, by the exception reporting management center, an exception risk according to the exception return code and the exception level includes:
s301, judging whether the abnormal grade is high.
Understandably, it is determined whether the abnormality level is a high level value.
S302, when the abnormity grade is high, the abnormity risk is determined to be urgent uploading.
Understandably, when the anomaly level is high, the anomaly risk is determined to be an urgent upload.
S303, when the exception level is medium or low, inquiring whether an exception code matched with the exception return code exists in the second exception resolution data set in the cache pool.
Understandably, when the exception level is medium or low, it is queried from the second exception resolution dataset in the cache pool whether the exception code matching the exception return code exists, where the matching manner may be set according to a requirement, such as the exception code same as the exception return code or a code corresponding to the exception return code, for example: if the exception return code is 404, it is queried whether an exception code of 404 exists, or if the exception return code is 404, it is queried whether an exception code of 001 exists (the return code corresponding to the network communication request error 001 is 404).
S304, if the abnormal code matched with the abnormal return code does not exist, determining that the abnormal risk is urgent uploading.
Understandably, if there is no exception code matching the exception return code, the exception risk is determined to be an urgent upload.
In an embodiment, after the step S303, that is, after the querying whether there is an exception code matching with the exception return code from the exception second resolution dataset in the cache pool when the exception level is medium or low, the method includes:
s305, if an abnormal code matched with the abnormal return code exists, determining that the abnormal risk is a repair solution.
Understandably, if the anomaly coding matching the anomaly return code exists, determining the anomaly risk as a repair solution.
The invention realizes that whether the abnormal grade is high or not is judged; when the anomaly level is high, determining that the anomaly risk is urgent uploading; when the exception level is medium or low, inquiring whether an exception code matched with the exception return code exists in the second exception resolution data set in the cache pool; if the abnormal code matched with the abnormal return code does not exist, determining that the abnormal risk is urgent uploading; and if the abnormal code matched with the abnormal return code exists, determining that the abnormal risk is a repair solution, and thus scientifically identifying the abnormal risk through the abnormal reporting management center, facilitating the fastest response and improving the experience satisfaction of the user.
In an embodiment, after the step S30, that is, after the abnormality reporting management center determines the abnormality risk according to the abnormality return code and the abnormality level, the method includes:
s90, when the abnormal risk is repair solution, inquiring a repair code template corresponding to the abnormal return code from the second abnormal solution data set in the cache pool.
Understandably, when the abnormal risk is repair solution, a repair code template corresponding to the abnormal code matched with the abnormal return code is inquired from the second abnormal solution data set in the cache pool, the repair code template is a code template for solving the abnormal code corresponding to the abnormal code, and the abnormal code corresponds to the repair code template one by one, so that offline repair is realized without accessing the first abnormal solution data set in the application server.
And S100, packaging the searched repair code template and the page cache data to obtain a repair execution code.
Understandably, the encapsulating is to extract the data filled in the blank area from the page cache data according to the blank area in the searched repair code template, automatically fill the data in the blank area corresponding to the data, perform an operation of packaging the filled repair code template, and determine the encapsulated repair code template as the repair execution code.
S110, executing the repair execution code to obtain a repair result, and verifying whether the exception corresponding to the exception return code is solved or not according to the repair result.
Understandably, executing the repair execution code outputs the repair result, resends the network request through the repair result, and determines that the exception is resolved if the exception return code does not appear.
When the abnormal risk is the repair solution, the repair code template corresponding to the abnormal return code is inquired from the second abnormal solution data set in the cache pool; packaging the searched repair code template and the page cache data to obtain a repair execution code; and executing the repair execution code to obtain a repair result, and verifying whether the abnormity corresponding to the abnormity return code is solved or not through the repair result, so that the repair code template is inquired from the cache pool, the repair execution code is generated by encapsulation, and whether the abnormity is solved or not is verified through the repair result obtained by executing the repair execution code, so that the abnormity repair time is shortened, the offline repair is also met, and the experience satisfaction of a user is improved.
And S40, when the abnormal risk is the emergency uploading, acquiring a page operation log corresponding to the network request through the abnormal reporting management center.
Understandably, when the abnormal risk is the emergency upload, the page operation log corresponding to the network request is obtained from the abnormal reporting management center, the abnormal reporting management center also records each step of operation on the current display page before the user executes any request on the application software, and generates the page operation log corresponding to the network request one by one, wherein the page operation log is the record of each step of operation on the current page before the network request is executed.
And S50, packaging and encrypting the page operation log, the page cache data, the page data received by the application program server, the abnormal return code and the abnormal level by using an MD5 encryption technology to obtain emergency abnormal data.
Understandably, the MD5 encryption technology is used for compressing large-capacity data into a secret format (i.e. converting a byte string with any length into a large integer with a fixed length) before signing a private key with a digital signature through an MD5(Message-Digest Algorithm) encryption technology, the MD5 technology comprises an MD5 Algorithm, the MD5 Algorithm is an Algorithm for generating an information Digest on a piece of information (Message) to prevent tampering, and the page operation log, the page cache data, the application server receiving page data, the exception return code and the exception level are packaged and encrypted into the urgent exception data, and the packaging and encryption process is a process executed by using an MD5 Algorithm in the MD5 encryption technology.
And S60, uploading the emergency abnormal data to an application program monitoring server, so that the application program monitoring server gives an alarm according to the emergency abnormal data, associates the abnormal solution data with the abnormal return code after receiving the abnormal solution data recorded aiming at the alarm, and refreshes a first abnormal solution data set in the application program monitoring server according to the abnormal solution data.
Understandably, the emergency abnormal data is sent to the application program monitoring server, the application program server enters an alarm stage after receiving the emergency abnormal data, the alarm mode can be to give an emergency identifier, an alarm notification is sent to an emergency response worker through various notification modes according to the emergency identifier, such as a mail notification, a telephone notification or a short message notification, and the like, the worker performs reason analysis and compiles a solution code according to the emergency abnormal data of the current alarm, the abnormal solution data is finally generated, after the worker enters the abnormal solution data, the abnormal solution data is associated with the abnormal return code, and a first abnormal solution data set in the application program monitoring server is refreshed according to the abnormal solution data.
S70, when monitoring that a first abnormity solving data set in the application program monitoring server is updated, acquiring the updated first abnormity solving data set, and refreshing the first abnormity solving data set to a second abnormity solving data set in a Native-based cache pool according to the updated first abnormity solving data set.
Understandably, when it is monitored that the first abnormal solution data set is updated, it is indicated that the second abnormal solution data set is inconsistent with the first abnormal solution data set, that is, the second abnormal solution data set is not the latest version, new abnormal solution data is input into the first abnormal solution data set, the updated first abnormal solution data set is downloaded and covers the original second abnormal solution data set, and the updating operation is completed.
If an exception solving data, namely an exception code and a repairing code template corresponding to the exception code, needs to be newly added, only the first exception solving data set needs to be updated on the application program server, each mobile terminal detects that the first exception solving data set on the application program server is updated, obtains the updated first exception solving data set to the cache pool, and covers the second exception solving data set in the original cache pool, and therefore the expandability, maintainability and transportability of the first exception solving data set are improved.
S80, obtaining the exception resolution data associated with the exception return code from the second exception resolution data set, and repairing the exception according to the obtained exception resolution data.
Understandably, a repair code template in the abnormal solution data corresponding to the abnormal return code is inquired from the second abnormal solution data set in the cache pool, and is packaged with the page cache data according to the inquired repair code template to obtain a current repair execution code, that is, data filled to a blank area is extracted from the page cache data according to the blank area in the inquired repair code template, and is automatically filled to the blank area corresponding to the data, the filled repair code template is packaged, and the packaged repair code template is determined as the current repair execution code; and the repairing is to execute the current repairing execution code to obtain a current repairing result, resend the network request according to the current repairing result, determine the operation of the exception which is already solved if the exception return code does not appear, namely repair the exception, which relates to the condition of the exception of the application program server, and the application program server can normally process the network request after being repaired by a worker, namely the application program server can not return the exception return code, which indicates that the exception is repaired.
The invention realizes that the network request containing the page cache data is sent to the application program server through the Native interface; when the application program server processes the network request to be abnormal, receiving abnormal return data from the application program server through the Native interface, and sending the abnormal return data to an abnormal reporting management center; the abnormal return data comprises page data received by the application program server, an abnormal return code and an abnormal grade; determining an abnormal risk through the abnormal reporting management center according to the abnormal return code and the abnormal grade; when the abnormal risk is the emergency uploading, acquiring a page operation log corresponding to the network request through the abnormal reporting management center; packaging and encrypting the page operation log, the page cache data, the page data received by the application program server, the abnormal return code and the abnormal grade to obtain emergency abnormal data; uploading the emergency abnormal data to an application program monitoring server through an MD5 encryption technology; monitoring that a first abnormity solving data set in the application program monitoring server is updated, acquiring the updated first abnormity solving data set, and refreshing the first abnormity solving data set to a second abnormity solving data set in a Native-based cache pool according to the updated first abnormity solving data set; and acquiring the exception resolution data associated with the exception return code from the second exception resolution data set, and repairing the exception according to the acquired exception resolution data.
Thus, when the application program server processes the network request to be abnormal, the abnormal return data is received through the Native interface and reported to the abnormal reporting management center to determine the abnormal risk, when the abnormal risk is reported emergently, the page operation log is obtained, the page operation log is packaged and encrypted through the MD5 encryption technology to obtain the emergency abnormal data, the emergency abnormal data is uploaded to the application program monitoring server, when the first abnormal solution data set is monitored to be updated, the second abnormal solution data set in the cache pool is updated, the abnormal is repaired according to the abnormal solution data in the second abnormal solution data set, therefore, the page operation log is provided through the abnormal reporting management center, the emergency abnormal data which is convenient for rapidly positioning the abnormal reason is generated through the MD5 encryption technology by packaging and encryption, the emergency abnormal data is reported to the application program monitoring server, the application program monitoring server alarms and receives the abnormal solution data, when monitoring the first abnormal solution data set and sending update, acquiring the abnormal solution data to repair the abnormality, so that when the network request is abnormal, the abnormal reason is quickly positioned, the abnormal response time is shortened, the abnormality can be timely repaired, and the experience satisfaction of a user is improved.
In one embodiment, an exception handling apparatus is provided, and the exception handling apparatus corresponds to the exception handling method in the foregoing embodiment one to one. As shown in fig. 6, the exception handling apparatus includes a request module 11, a return module 12, a determination module 13, an acquisition module 14, an encryption module 15, a refresh module 16, a snoop module 17, and a repair module 18. The functional modules are explained in detail as follows:
a request module 11, configured to send a network request to an application server through a Native interface; the network request comprises page cache data;
a return module 12, configured to receive, through the Native interface, abnormal return data from the application server when the application server processes that the network request is abnormal, and send the abnormal return data to an abnormal reporting management center; the abnormal return data comprises page data received by the application program server, an abnormal return code and an abnormal grade;
a determining module 13, configured to determine, by the exception reporting management center, an exception risk according to the exception return code and the exception level;
an obtaining module 14, configured to obtain, by the exception reporting management center, a page operation log corresponding to the network request when the exception risk is an emergency upload;
the encryption module 15 is configured to package and encrypt the page operation log, the page cache data, the page data received by the application server, the abnormal return code, and the abnormal level by using an MD5 encryption technology, so as to obtain emergency abnormal data;
a refreshing module 16, configured to upload the emergency abnormal data to an application program monitoring server, so that the application program monitoring server performs an alarm according to the emergency abnormal data, associates the abnormal solution data with the abnormal return code after receiving abnormal solution data entered for the alarm, and refreshes a first abnormal solution data set in the application program monitoring server according to the abnormal solution data;
a monitoring module 17, configured to monitor that a first exception resolution data set in the application program monitoring server is updated, obtain the updated first exception resolution data set, and refresh the first exception resolution data set to a second exception resolution data set in a Native-based cache pool according to the updated first exception resolution data set;
a repairing module 18, configured to obtain the exception resolution data associated with the exception return code from the second exception resolution data set, and repair the exception according to the obtained exception resolution data.
For the specific definition of the exception handling device, the above definition of the exception handling method may be referred to, and is not described herein again. The modules in the exception handling apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement an exception handling method.
In one embodiment, a computer device is provided, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the exception handling method in the above embodiments is implemented.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the exception handling method in the above-described embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, databases, or other media used in embodiments provided herein may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.