CN113791809A - Application exception handling method and device and computer readable storage medium - Google Patents

Application exception handling method and device and computer readable storage medium Download PDF

Info

Publication number
CN113791809A
CN113791809A CN202111332266.2A CN202111332266A CN113791809A CN 113791809 A CN113791809 A CN 113791809A CN 202111332266 A CN202111332266 A CN 202111332266A CN 113791809 A CN113791809 A CN 113791809A
Authority
CN
China
Prior art keywords
function
target
program
compiled
application
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.)
Granted
Application number
CN202111332266.2A
Other languages
Chinese (zh)
Other versions
CN113791809B (en
Inventor
苟亚明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202111332266.2A priority Critical patent/CN113791809B/en
Publication of CN113791809A publication Critical patent/CN113791809A/en
Application granted granted Critical
Publication of CN113791809B publication Critical patent/CN113791809B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0751Error or fault detection not based on redundancy
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application discloses an application exception handling method, an application exception handling device and a computer readable storage medium, which are applied to scenes such as cloud technology, AI, intelligent traffic, vehicle-mounted and the like; when a program update package corresponding to a target program in the target application is detected, acquiring a target function corresponding to the program update package; acquiring a to-be-compiled tool packet matched with a target program in a target application, and compiling the to-be-compiled tool packet according to a target function to obtain a compiled target tool packet; when the target tool package is detected to contain an abnormal program function with an operation error, requesting a server to acquire a repair file corresponding to the abnormal program function; reading a target program function and a corresponding repair code text in a repair file; and processing the abnormal program function in the target application according to the target program function and the corresponding repair code text to obtain a processed program running result. Therefore, the updated application program can be ensured to normally run, and the failure rate after update iteration is reduced.

Description

Application exception handling method and device and computer readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for processing application exceptions, and a computer-readable storage medium.
Background
With the development of information technology, in order to meet business requirements of users, function update iteration can be performed on applications published in an application store, so that applications installed on a terminal can be updated later. In the related art, when the function of the application program on the terminal is updated, a new Software Development Kit (SDK) corresponding to the application program is obtained, and the function of the application program on the terminal is updated by using the new SDK, so as to update and iterate the application program.
In the research and practice process of the prior art, the inventor of the present application finds that, in the prior art, when an application program on a terminal is updated, the updated application program fails to operate due to some uncontrollable factors, for example, part of terminal systems or device models do not support a new version of the application program, so that part of functions of the application program abnormally operate, the failure rate of the application program after update iteration is improved, and the reliability is not high.
Disclosure of Invention
The embodiment of the application provides an application exception handling method and device and a computer readable storage medium. The failure rate of the application program after update iteration can be reduced, and the method has reliability.
The embodiment of the application provides an application exception handling method, which comprises the following steps:
when a program update package corresponding to a target program in a target application is detected, acquiring a target function corresponding to the program update package;
acquiring a to-be-compiled tool package matched with the target program in the target application, and compiling the to-be-compiled tool package according to the target function to obtain a compiled target tool package;
when the target tool package is detected to contain an abnormal program function with an operation error, requesting a server to acquire a repair file corresponding to the abnormal program function;
reading a target program function and a corresponding repair code text in the repair file;
and processing the abnormal program function in the target application according to the target program function and the corresponding repair code text to obtain a processed program running result.
Correspondingly, an application exception handling apparatus provided in an embodiment of the present application includes:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a target function corresponding to a program update package when the program update package corresponding to a target program in a target application is detected;
the compiling unit is used for acquiring a to-be-compiled tool package matched with the target program in the target application, and compiling the to-be-compiled tool package according to the target function to obtain a compiled target tool package;
the request unit is used for requesting a server to acquire a repair file corresponding to an abnormal program function when the target tool package is detected to contain the abnormal program function with the wrong operation;
the reading unit is used for reading the target program function and the corresponding repair code text in the repair file;
and the processing unit is used for processing the abnormal program function in the target application according to the target program function and the corresponding repair code text to obtain a processed program running result.
In some embodiments, the processing unit is further configured to:
adding the target program function into a queue to be processed;
determining a target program function corresponding to the abnormal program function in the queue to be processed as a program function to be executed, and establishing a mapping relation between the program function to be executed and the corresponding repair code text to obtain a program logic to be executed;
and when the target application is detected to request to execute the abnormal program function, operating the program logic to be executed to obtain a processed program operation result.
In some embodiments, the processing unit is further configured to:
injecting the repair code text into the program function to be executed to obtain a target program logic with an incidence relation;
and determining the target program logic as the program logic to be executed corresponding to the abnormal program function.
In some embodiments, the compiling unit is further configured to:
initializing the compiling configuration in the toolkit to be compiled to obtain an initialized sub-toolkit to be compiled;
and compiling the initialized sub-toolkit to be compiled according to the target function to obtain a compiled target toolkit.
In some embodiments, the compiling unit is further configured to:
identifying a compilation configuration in the toolkit to be compiled;
updating the compiling configuration according to a preset compiling initialization function to obtain an updated compiling configuration;
and determining the tool pack to be compiled containing the updated compiling configuration as an initialized sub tool pack to be compiled.
In some embodiments, the compiling unit is further configured to:
acquiring compiling cache information corresponding to the initialized sub-toolkit to be compiled;
reading function information to be compiled matched with the target function from the compiling cache information;
and compiling the function information to be compiled to obtain a compiled target toolkit.
In some embodiments, the compiling unit is further configured to:
acquiring target function information corresponding to the target function;
acquiring a preset function marking character, and establishing an incidence relation between the preset function marking character and target function information to obtain a function marking symbol with the incidence relation;
and marking the function information to be compiled by using the function marker with the incidence relation to obtain a compiled target toolkit.
In some embodiments, the application exception handling apparatus further comprises a fusion unit, further configured to:
acquiring function starting logic associated with the target function, and acquiring a function code text corresponding to the target function;
fusing the function starting logic and the function code text to obtain a fused second target function;
the compiling unit is further configured to obtain the target function information corresponding to the second target function.
In addition, a computer device is further provided in an embodiment of the present application, and includes a processor and a memory, where the memory stores a computer program, and the processor is configured to run the computer program in the memory to implement the steps in the application exception handling method provided in the embodiment of the present application.
In addition, a computer-readable storage medium is provided, where a plurality of instructions are stored, and the instructions are suitable for being loaded by a processor to perform any of the steps in the application exception handling method provided in the embodiments of the present application.
In addition, the embodiment of the present application further provides a computer program product, which includes computer instructions, and when executed, the computer instructions implement the steps in any one of the application exception handling methods provided in the embodiment of the present application.
According to the method and the device, when the program update package corresponding to the target program in the target application is detected, the target function corresponding to the program update package can be obtained; acquiring a to-be-compiled tool packet matched with a target program in a target application, and compiling the to-be-compiled tool packet according to a target function to obtain a compiled target tool packet; when the target tool package is detected to contain an abnormal program function with an operation error, requesting a server to acquire a repair file corresponding to the abnormal program function; reading a target program function and a corresponding repair code text in a repair file; and processing the abnormal program function in the target application according to the target program function and the corresponding repair code text to obtain a processed program running result. Therefore, the program update package corresponding to the target program in the target application can be obtained in real time, the tool package corresponding to the target program in the target application on the terminal is compiled, the application program is updated, and the update rate of the application program is improved; furthermore, for the abnormal program function which runs the error in the compiled tool kit, the abnormal program function is subjected to abnormal repair processing according to the target program function and the repair code text in the repair file by requesting the repair file corresponding to the abnormal program function, so that the program running result after the abnormal processing is obtained, thereby ensuring the normal running of the updated application program, reducing the failure rate of the application program after update iteration and having reliability.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of a scenario of an application exception handling system according to an embodiment of the present application;
FIG. 2 is a schematic flowchart illustrating steps of a method for processing application exceptions according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating another step of an application exception handling method according to an embodiment of the present application;
fig. 4 is a scene schematic diagram of an application exception handling method provided in an embodiment of the present application;
FIG. 5 is a flowchart illustrating a scenario of an application exception handling method according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an application exception handling apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a computer device provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. 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 application.
The embodiment of the application provides an application exception handling method and device and a computer readable storage medium. Specifically, the embodiment of the present application will be described from the perspective of an application exception handling apparatus, where the application exception handling apparatus may be specifically integrated in a computer device, and the computer device may be a server, or may be a device such as a terminal. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, big data and an artificial intelligence platform. The terminal may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a vehicle-mounted terminal, a smart voice interaction device, an aircraft, and the like, but is not limited thereto. The terminal and the server may be directly or indirectly connected through wired or wireless communication, and the application is not limited herein.
The scheme provided by the embodiment of the application relates to technologies such as application exception handling of scenes such as Intelligent Transportation, internet of vehicles backstage and the like, an Intelligent Transportation System (ITS) is also called an Intelligent Transportation System (Intelligent Transportation System), advanced scientific technologies (information technology, computer technology, data communication technology, sensor technology, electronic control technology, automatic control theory, operational research, artificial intelligence and the like) are effectively and comprehensively applied to Transportation, service control and vehicle manufacturing, and the relation among vehicles, roads and users is strengthened, so that the comprehensive Transportation System capable of guaranteeing safety, improving efficiency, improving environment and saving energy is formed. The following examples are intended to illustrate in particular:
for example, referring to fig. 1, a schematic view of a scenario of an application exception handling system provided in an embodiment of the present application is shown. The scenario includes a terminal 10 and a server 20.
The terminal 10 may obtain an objective function corresponding to a program update package when detecting the program update package corresponding to the target program in the target application; acquiring a to-be-compiled tool packet matched with a target program in a target application, and compiling the to-be-compiled tool packet according to a target function to obtain a compiled target tool packet; when the target tool package is detected to contain an abnormal program function with an operation error, requesting a server to acquire a repair file corresponding to the abnormal program function; reading a target program function and a corresponding repair code text in a repair file; and processing the abnormal program function in the target application according to the target program function and the corresponding repair code text to obtain a processed program running result.
The server 20 may receive a program update package corresponding to a target program in the target application, and store the program update package; when a program update package acquisition request sent by the terminal 10 is received, sending the program update package to the terminal 10, so that the terminal 10 compiles a to-be-compiled tool package corresponding to an object program in an object application according to the program update package to obtain a compiled object tool package; after receiving a repair file acquisition request sent by the terminal 10, extracting previous version information and current version information of a target toolkit carried by the repair file acquisition request to search for a repair file corresponding to the previous version information and the current version information, and returning to the terminal 10.
The application exception handling may include processing modes such as acquiring an object function corresponding to the program update package, compiling, requesting to acquire a repair file, reading an object program function and a repair code text, and handling an exception program function.
The following are detailed below. The order of the following examples is not intended to limit the preferred order of the examples.
In the embodiment of the present application, the description will be made from the perspective of a user interface test application exception handling apparatus, and the user interface test application exception handling apparatus may be specifically integrated in a computer device such as a terminal or a server. Referring to fig. 2, fig. 2 is a schematic flowchart of a step flow of a method for processing an application exception in a user interface test provided in an embodiment of the present application, where an application exception handling apparatus is specifically integrated on a terminal, and when a processor on the terminal executes a program corresponding to an information processing method, the specific flow is as follows:
101. and when detecting a program update package corresponding to the target program in the target application, acquiring a target function corresponding to the program update package.
The target Application may be an Application program (app) installed on a computer device (such as a terminal), and the target Application may implement various functions.
The target program may be a functional program included in a corresponding application, and is used to implement a corresponding function. For example, some application programs include a "scan" function program, which can scan external two-dimensional codes, bar codes, texts, etc.
The program update package may be a new development kit corresponding to the target program, and may include a logic function or a function code of the target program when the target program implements a corresponding function, so as to update the target program subsequently. It should be noted that the program update package may be a Software Development Kit (SDK) of a new version corresponding to the corresponding functional program, and each program update package corresponds to the corresponding functional program. For example, a "scan" function in an application corresponds to one software development kit and a payment function corresponds to another software development kit.
The target function may be a function code of the target program when implementing the corresponding function, and is used to control the operation logic of the target program when executing the corresponding function. It should be noted that, in the embodiment of the present application, the target function is a new version of a logic function corresponding to a target program in a target application, and the original function of the target program may be replaced, changed, or juxtaposed, so that the operation logic or the operation result of the target program is improved when the target program implements the corresponding function. For example, some applications include a scan function program, but the scan function program is only used for scanning and identifying two-dimensional code information, that is, "scan" is only used for obtaining an identification result corresponding to the two-dimensional code information, and in order to improve the scan function program, an old version of function may be replaced, or juxtaposed by a new version of target function, so as to change or expand the operation logic of the scan function program, thereby increasing the usage of the scan function program and satisfying the business requirements.
In order to update the functional program in the application subsequently, a program update package corresponding to the functional program needs to be acquired first, and a logic function carried by the program update package needs to be acquired. In the embodiment of the application, whether a program update package corresponding to a functional program in an application exists can be detected in real time, specifically, an application identifier of a target application is obtained, a corresponding update package obtaining request is generated according to the application identifier, and the update package obtaining request is sent to a server so as to detect whether a server side includes the program update package corresponding to the target program in the target application; when the terminal detects that the server side includes a program update package corresponding to a target program in the target application, the terminal may request the server to acquire the program update package corresponding to the target program, and extract a target function corresponding to the target program from the program update package. Or, when the terminal detects that the server side contains a program update package corresponding to the target program in the target application, the terminal directly requests the server to acquire the target function corresponding to the program update package. Further, it may be: when the terminal is detected to download a program update package corresponding to a target program in the target application, a target function corresponding to the target program is acquired from the program update package.
Through the method, when a new version program toolkit corresponding to the target program in the target application is detected, the target function corresponding to the toolkit can be obtained, so that the target application can be updated according to the target function subsequently, and the performance and the service requirements of the target program in the target application are expanded.
102. And acquiring a to-be-compiled tool package matched with the target program in the target application, and compiling the to-be-compiled tool package according to the target function to obtain a compiled target tool package.
The toolkit to be compiled may be a Software toolkit corresponding to an object program to be updated, which is installed in an object application on a computer device (e.g., a terminal), and essentially belongs to a Software Development Kit (SDK). It should be noted that, in the embodiment of the present application, after a new version program update package corresponding to the target program is detected, the to-be-compiled toolkit may be compiled and updated by using the program update package.
The compiled object kit may be a compiled updated kit, which may include a new logic function (i.e., an object function), or the compiled object kit may include the new logic function and an original logic function. For example, in order to expand the functional service of the target program in the target application, the target function included in the program update package may be expanded to the tool package to be compiled based on the original logic function of the target program, so that the expanded target function and the original logic function are juxtaposed to expand the original operating logic of the target program, thereby facilitating the subsequent selection of the corresponding function based on the service requirement.
In order to update an object program in an object application, in the embodiment of the present application, after an object function corresponding to the program update package is obtained, a to-be-compiled tool package of the object program included in the object application on a terminal is first determined, and the to-be-compiled tool package is compiled according to the object function, so that a compiled object tool package is obtained.
In some embodiments, the step of "compiling the to-be-compiled toolkit according to the object function to obtain a compiled object toolkit" may include:
(1) initializing the compiling configuration in the to-be-compiled toolkit to obtain an initialized to-be-compiled sub toolkit;
(2) and compiling the initialized sub-toolkit to be compiled according to the target function to obtain a compiled target toolkit.
It should be noted that, in the embodiment of the present application, after the to-be-compiled toolkit is obtained, the toolkit corresponding to the object program can be updated by compiling the to-be-compiled toolkit. The compiling process may include two parts, specifically including: a compiling environment initialization process and a compiling process.
Specifically, the compiling environment initialization process may include: identifying a compilation configuration in a toolkit to be compiled; updating the compiling configuration according to a preset compiling initialization function to obtain an updated compiling configuration; and determining the tool pack to be compiled containing the updated compiling configuration as an initialized sub tool pack to be compiled.
The compiling configuration may be a compiling environment configuration in a setting configuration corresponding to the to-be-compiled toolkit, and the compiling environment initialization processing of the to-be-compiled toolkit may be implemented by adding a corresponding initialization function in the compiling configuration of the to-be-compiled toolkit.
The sub-toolkit to be compiled is an initialized toolkit, and may also belong to a software development toolkit (SDK).
For example, after a to-be-compiled toolkit of an object program is obtained, a compiler may be used to compile the to-be-compiled toolkit, specifically, a compilation configuration (Other C Flags) in a Setting configuration (Build Setting) corresponding to the to-be-compiled toolkit is identified, and a preset initialization function is added to the compilation configuration (Other C Flags), for example, "-fsanitize-coverage = trace-pc-guard" is added, so that the compilation configuration of the to-be-compiled toolkit is updated, and thus, initialization processing of a compilation environment of the to-be-compiled toolkit is realized, so as to facilitate subsequent compilation processing of the to-be-compiled toolkit based on the compilation environment.
In some embodiments, the step of "compiling the initialized sub-toolkit to be compiled according to the object function to obtain a compiled object toolkit" may include:
(2.1) acquiring compiling cache information corresponding to the initialized sub-toolkit to be compiled;
(2.2) reading function information to be compiled matched with the target function from the compiling cache information;
and (2.3) compiling the function information to be compiled to obtain a compiled target toolkit.
The compiling cache information may refer to a context of a function to be compiled in the compiling process of the sub-toolkit to be compiled.
The function information to be compiled may be identification information indicating a function to be compiled, and the function information to be compiled may include a binary function address corresponding to the function to be compiled and a corresponding function symbol (function identification).
In order to implement the compiling process of the to-be-compiled toolkit, the to-be-compiled toolkit can be compiled after the initialized to-be-compiled toolkit is obtained. Specifically, the compiling process may be: acquiring compiling cache information corresponding to the sub-tool package to be compiled based on the sub-tool package to be compiled after the environment is initialized so as to determine the primitive function context in the sub-tool package to be compiled; further, a function to be compiled corresponding to the target function is determined from the compiling cache information (i.e., the original function context), for example, a function to be compiled matching the identification information of the target function in the sub-toolkit to be compiled (or the compiling cache) is determined according to the identification information of the target function (e.g., the target function symbol), and function information of the function to be compiled, i.e., function information to be compiled (e.g., the original binary function address and the function symbol) is obtained; and finally, compiling the function information to be compiled according to the target function to obtain a compiled target toolkit.
In some embodiments, the step of "compiling the to-be-compiled function information to obtain a compiled object toolkit" may include:
(2.3.1) acquiring target function information corresponding to the target function;
(2.3.2) acquiring a preset function mark character, and establishing an incidence relation between the preset function mark character and the target function information to obtain a function mark symbol with the incidence relation;
and (2.3.3) marking the function information to be compiled by using the function marker with the incidence relation to obtain the compiled target toolkit.
The target function information may be identification information representing a target function, and the target function information may include a binary function address corresponding to the target function and a corresponding function symbol.
The preset function marker character may be a function loading instruction, which is used to trigger loading of the obtained target function, or used to load the target function and corresponding target operation data, so that the target program realizes a corresponding function with the target function and/or the corresponding target operation data when running. It should be noted that, in order to enable the preset function mark character to load the corresponding target function and the target operation data, an association relationship or a mapping relationship between the target function information and the preset function mark character may be established, so as to load and operate the target function (and the target operation data) based on the association relationship or the mapping relationship subsequently.
In order to implement compiling of the initialized sub-toolkit to be compiled, the function information to be compiled can be compiled after the function information to be compiled is acquired from the compiling cache information in the embodiment of the application. Specifically, first, obtaining target function information corresponding to the target function, such as obtaining a binary function address and a target function symbol corresponding to the target function; then, acquiring a preset function marker, and establishing an incidence relation or a mapping relation between target function information and the preset function marker character to obtain a function marker with the incidence relation or the mapping relation; and finally, marking the function information to be compiled (such as binary function addresses and function symbols) by using the function marker with the incidence relation or the mapping relation to obtain a compiled target toolkit. Therefore, the tool kit to be compiled corresponding to the target program in the target application is compiled, the implementation logic corresponding to the target function is injected into the original function, and the operation logic of the target program is expanded and updated, so that the target program in the target application operates according to the operation logic of the target function when the target program operates to the original function (the function to be compiled).
It should be noted that, in the embodiment of the present application, in order to enable the compiled target toolkit to be run with the original function (to-be-compiled function) or the target function selectively during running, when the implementation logic corresponding to the target function is injected in the compiling process, a start switch of the implementation logic of the target function is added, so that when the step of running the original function (to-be-compiled function) is performed subsequently, according to the indication of the start switch, the target function (and corresponding target operation data) is run according to the selected function logic, for example, according to the function marker having the association relationship, the function after the target program is expanded/updated is implemented with the new function running logic, so as to achieve the expected effect.
In some embodiments, the process of adding the start switch of the implementation logic of the objective function during the compiling process further includes:
acquiring function starting logic associated with the target function and acquiring a function code text corresponding to the target function;
fusing the function starting logic and the function code text to obtain a fused second target function;
acquiring target function information corresponding to the target function, including:
and acquiring target function information corresponding to the second target function.
The function starting logic may be a logic for controlling or instructing the target function to start and operate, and in this embodiment, is used for starting or controlling the operation logic of the extended target function.
The function code text may be a function code corresponding to the objective function, for example, the function code text may be a function code included when the objective function is constructed.
In order to increase the running logic of the objective function for control, in the compiling process, the logic start switch of the realization logic of the scalar function may be added while the running logic injection of the objective function is completed (or before the realization logic is injected). Specifically, firstly, function starting logic associated with a target function is obtained, and a function code text corresponding to the target function which completes injection realization logic is obtained; then, the function start logic is fused with the function code text, for example, the function start logic is added to the function code text corresponding to the objective function, so as to obtain a fused second objective function, where the second objective function includes the objective function and the corresponding function start logic. Therefore, whether the implementation logic of the target function is started or not is determined according to the function starting logic when the target program in the target application is operated.
By the above mode, the tool pack to be compiled corresponding to the target program in the target application can be compiled, the implementation logic corresponding to the target function is injected into the original function, and the operation logic of the target program is expanded and updated so as to meet the service requirement of the target program in the target application.
103. And when the target tool package is detected to contain the abnormal program function with the operation error, requesting the server to acquire a repair file corresponding to the abnormal program function.
It should be noted that the abnormal program function may be a program logic function in which the target program fails to operate or the operation result is inconsistent with the expectation. For example, in the embodiment of the present application, an original function (to-be-compiled function) of an object program is compiled and then has an exception, that is, after the to-be-compiled function is compiled according to the object function, a compiled program logic function is obtained, and the update of the running logic of the object program is completed; however, the effect of the updated program logic function during running is not consistent with the expected result, and if the running logic of the target logic function cannot run or the running result is not accurate, the compiled program logic function is regarded as an "abnormal program function".
The repair file may be a file for repairing the abnormal program function, or may be an operation logic file for replacing the operation logic of the abnormal program function when the target program is operated.
Specifically, after the compiling process of the tool pack to be compiled of the target program is completed, the updated target program can be run by the compiled target tool pack. When the target program operation failure is detected in the operation process of the updated target program, that is, when the target toolkit is detected to include an abnormal program function with operation failure or abnormal operation result, a repair file related to the abnormal program function may be requested from the server of the target application (or the target program), so as to repair the abnormal program function corresponding to the target program in the target application according to the repair file.
Through the above manner, when it is detected that the target toolkit contains the abnormal program function with the operation error, the embodiment of the application can generate the corresponding repair file acquisition request according to the function information such as the function identifier of the abnormal program function in a targeted manner, where the repair file acquisition request carries the function identifier of the abnormal program function or other function information, so that the abnormal program function can be positioned and repaired in a targeted manner, all programs (and all functions) in the target application do not need to be detected, and meanwhile, the server can subsequently return the repair file corresponding to the function identifier, thereby improving the efficiency of acquiring the repair file.
104. And reading the target program function and the corresponding repair code text in the repair file.
The repair file may include an object program function and a corresponding repair code text.
The target program function may be a repaired program function, which corresponds to the abnormal program function and is used to replace the running logic of the abnormal program function.
The repair code text may be target operation data related to the target program function during the operation, and is used for supporting the operation of the target program function.
Specifically, in order to repair an abnormal program function which fails to operate, in the embodiment of the present application, after a request is made to a server to obtain a repair file corresponding to the abnormal program function, a target program function and a corresponding repair code text need to be read from the repair file, so as to be used for repairing an operation logic of the abnormal program function in the following.
105. And processing the abnormal program function in the target application according to the target program function and the corresponding repair code text to obtain a processed program running result.
Wherein, the program running result may be a running result of the updated target program in normal running.
In order to obtain an operation result of an updated target program in normal operation, in the embodiment of the present application, when an abnormal program function that fails to operate the target program is detected in an updated (compiled) target toolkit, the operation logic of the abnormal program function needs to be repaired, specifically, after the target program function and a repair code text in a repair file are read, the abnormal program function in a target application is subjected to exception processing according to the target program function and a corresponding repair code text, so as to obtain an operation result of the program after exception processing.
In some embodiments, the step of "processing an abnormal program function in the target application according to the target program function and the corresponding repair code text to obtain a processed program running result" may include:
(1) adding the target program function into a queue to be processed;
(2) determining a target program function corresponding to the abnormal program function in the queue to be processed as a program function to be executed, and establishing a mapping relation between the program function to be executed and a corresponding repair code text to obtain a program logic to be executed;
(3) and when the target application is detected to request to execute the abnormal program function, running the logic of the program to be executed to obtain a processed program running result.
The queue to be processed may be a function processing queue of the target program in the target application when running on the terminal, and is used to add and carry one or more logic functions involved in the running of the target program.
The to-be-executed program logic may be program logic to be executed when the target program runs, and the to-be-executed program logic includes a target program function involved when the target program runs and target running data (i.e., a repair code text) on which the target program function depends when the target program runs.
In order to obtain that the updated target program can normally run, in the embodiment of the present application, when it is found that the target toolkit of the updated target program has an abnormal program function that fails to run, the execution logic of the abnormal program function needs to be replaced when the target program runs. Specifically, after the target program function and the repair code text corresponding to the abnormal program function are obtained, the target program function and the repair code text may be directly stored, or stored when the corresponding target program is detected to be running, and the storage process may specifically be: adding the functions involved in the running of the target program to a queue to be processed, and adding the functions of the target program to the queue to be processed in the running of the target program so as to replace the abnormal program functions in the queue to be processed. And then, establishing a mapping relation between the program function to be executed in the queue to be processed and the repair code text, and determining the program logic to be executed when the target program runs according to the program function to be executed and the repair code text with the mapping relation. And when the target application is detected to request to execute the abnormal program function, running the logic of the program to be executed to obtain a processed program running result.
In some embodiments, the step of "establishing a mapping relationship between a function of the program to be executed and a corresponding text of the repair code to obtain the logic of the program to be executed" may include:
(2.1) injecting the repair code text into a program function to be executed to obtain a target program logic with an incidence relation;
and (2.2) determining the target program logic as the program logic to be executed corresponding to the abnormal program function.
In order to determine a target program logic for replacing an abnormal operation logic corresponding to an abnormal program function, in the embodiment of the present application, when determining a program logic to be executed, specifically, the target program logic may be: and injecting the repair code text into a program function to be executed to obtain a target program logic with an incidence relation so as to determine the program logic to be executed when the target program is in normal operation, so that the program operation result after exception processing can be conveniently obtained subsequently.
It should be noted that, before the step "injecting the repair code text into the program function to be executed", the method may further include:
when the format of the repair code text is detected to be not in accordance with the preset code format, converting the repair code text into a code to be executed which is in accordance with the preset code format;
the step "inject the repair code text into the program function to be executed" includes: and injecting the code to be executed into the program function to be executed to obtain the target program logic with the incidence relation.
As can be seen from the above, in the embodiment of the present application, when a program update package corresponding to a target program in a target application is detected, an objective function corresponding to the program update package may be obtained; acquiring a to-be-compiled tool packet matched with a target program in a target application, and compiling the to-be-compiled tool packet according to a target function to obtain a compiled target tool packet; when the target tool package is detected to contain an abnormal program function with an operation error, requesting a server to acquire a repair file corresponding to the abnormal program function; reading a target program function and a corresponding repair code text in a repair file; and processing the abnormal program function in the target application according to the target program function and the corresponding repair code text to obtain a processed program running result. Therefore, the program update package corresponding to the target program in the target application can be obtained in real time, the tool package corresponding to the target program in the target application on the terminal is compiled, the application program is updated, and the update rate of the application program is improved; furthermore, for the abnormal program function which runs the error in the compiled tool kit, the abnormal program function is subjected to abnormal repair processing according to the target program function and the repair code text in the repair file by requesting the repair file corresponding to the abnormal program function, so that the program running result after the abnormal processing is obtained, thereby ensuring the normal running of the updated application program, reducing the failure rate of the application program after update iteration and having reliability.
The method described in the above examples is further illustrated in detail below by way of example.
The embodiment of the present application takes application exception handling as an example, and further describes an application exception handling method provided in the embodiment of the present application.
Fig. 3 is a schematic flowchart of another step of the application exception handling method provided in the embodiment of the present application, and fig. 4 is a schematic scene diagram of the application exception handling method provided in the embodiment of the present application; fig. 5 is a scene flowchart of an application exception handling method according to an embodiment of the present application. For ease of understanding, please refer to fig. 3, 4 and 5 together to describe the embodiment of the present application.
In the embodiments of the present application, description will be made from the perspective of an application exception handling apparatus, which may be specifically integrated in a computer device such as a terminal and/or a server. For example, taking the example of integration in a terminal and a server, when a processor on the terminal and the server executes a program corresponding to an application exception handling method, a specific flow of the application exception handling method is as follows:
201. and the server receives a program update package corresponding to the target program, extracts the target function from the program update package and stores the target function.
For example, in order to meet the business iteration requirement of a target program in a target application, a developer can develop a program update package, such as update code, newly added functions, interfaces, class names and the like, about the target program according to a request or an autonomous intention, and upload the program update package to a server. The server scans a plurality of functions such as a newly added function, an interface, a class name and the like, obtains the function, namely a target function, and related function information, and stores the function.
202. And when the terminal detects a program update package corresponding to the target program in the target application, acquiring a target function corresponding to the program update package.
The target Application may be an Application program (app) installed on a computer device (such as a terminal), and the target Application may implement various functions.
The target program may be a functional program included in a corresponding application, and is used to implement a corresponding function. For example, some application programs include a "scan" function program, which can scan external two-dimensional codes, bar codes, texts, etc.
The program update package may be a new development kit corresponding to the target program, and may include a logic function or a function code of the target program when the target program implements a corresponding function, so as to update the target program subsequently. It should be noted that the program update package may be a Software Development Kit (SDK) of a new version corresponding to the corresponding functional program, and each program update package corresponds to the corresponding functional program. For example, a "scan" function in an application corresponds to one software development kit and a payment function corresponds to another software development kit.
The target function may be a function code of the target program when implementing the corresponding function, and is used to control the operation logic of the target program when executing the corresponding function. It should be noted that, in the embodiment of the present application, the target function is a new version of a logic function corresponding to a target program in a target application, and the original function of the target program may be replaced, changed, or juxtaposed, so that the operation logic or the operation result of the target program is improved when the target program implements the corresponding function. For example, some applications include a scan function program, but the scan function program is only used for scanning and identifying two-dimensional code information, that is, "scan" is only used for obtaining an identification result corresponding to the two-dimensional code information, and in order to improve the scan function program, an old version of function may be replaced, or juxtaposed by a new version of target function, so as to change or expand the operation logic of the scan function program, thereby increasing the usage of the scan function program and satisfying the business requirements.
Specifically, an application identifier of the target application is acquired, a corresponding update package acquisition request is generated according to the application identifier, and the update package acquisition request is sent to the server to detect whether the server side includes a program update package corresponding to a target program in the target application; when the terminal detects that the server side includes a program update package corresponding to a target program in the target application, the terminal may request the server to acquire the program update package corresponding to the target program, and extract a target function corresponding to the target program from the program update package. Or, when the terminal detects that the server side contains a program update package corresponding to the target program in the target application, the terminal directly requests the server to acquire the target function corresponding to the program update package. Further, it may be: when the terminal is detected to download a program update package corresponding to a target program in the target application, a target function corresponding to the target program is acquired from the program update package.
203. And the terminal acquires a to-be-compiled tool package matched with the target program in the target application.
The toolkit to be compiled may be a Software toolkit corresponding to an object program to be updated, which is installed in an object application on a computer device (e.g., a terminal), and essentially belongs to a Software Development Kit (SDK). It should be noted that, in the embodiment of the present application, after a new version program update package corresponding to the target program is detected, the to-be-compiled toolkit may be compiled and updated by using the program update package.
Specifically, the corresponding software development kit may be searched for according to the application identifier of the target application and the program identifier of the target program, and the searched software development kit may be determined as the to-be-compiled kit.
204. And initializing the compiling configuration in the to-be-compiled tool package by the terminal to obtain an initialized to-be-compiled sub tool package.
It should be noted that, in the embodiment of the present application, after the to-be-compiled toolkit is obtained, the toolkit corresponding to the object program can be updated by compiling the to-be-compiled toolkit. The compiling process may include two parts, specifically including: a compiling environment initialization process and a compiling process.
Specifically, the compiling environment initialization process may include: identifying a compilation configuration in a toolkit to be compiled; updating the compiling configuration according to a preset compiling initialization function to obtain an updated compiling configuration; and determining the tool pack to be compiled containing the updated compiling configuration as an initialized sub tool pack to be compiled.
For example, after a to-be-compiled toolkit of an object program is obtained, a compiler may be used to compile the to-be-compiled toolkit, specifically, a compilation configuration (Other C Flags) in a Setting configuration (Build Setting) corresponding to the to-be-compiled toolkit is identified, and a preset initialization function is added to the compilation configuration (Other C Flags), for example, "-fsanitize-coverage = trace-pc-guard" is added, so that the compilation configuration of the to-be-compiled toolkit is updated, and thus, initialization processing of a compilation environment of the to-be-compiled toolkit is realized, so as to facilitate subsequent compilation processing of the to-be-compiled toolkit based on the compilation environment.
205. And the terminal compiles the initialized sub-toolkit to be compiled according to the target function to obtain a compiled target toolkit.
The compilation process may be: acquiring compiling cache information corresponding to the initialized sub-toolkit to be compiled; reading function information to be compiled matched with the target function from the compiling cache information; and compiling the function information to be compiled to obtain a compiled target toolkit.
Specifically, firstly, based on the sub-toolkit to be compiled after the environment is initialized, compiling cache information corresponding to the sub-toolkit to be compiled is obtained, so as to determine the primitive function context in the sub-toolkit to be compiled. Further, a function to be compiled corresponding to the target function is determined from the compiling cache information (i.e., the original function context), for example, a function to be compiled matching the identification information of the target function in the sub-toolkit to be compiled (or the compiling cache) is determined according to the identification information of the target function (e.g., the target function symbol), and function information of the function to be compiled, i.e., function information to be compiled (e.g., the original binary function address and the function symbol) is obtained. And finally, compiling the function information to be compiled according to the target function to obtain a compiled target toolkit.
Specifically, the process of performing compilation processing on the function information to be compiled may be: acquiring a binary function address and a target function symbol corresponding to the target function; then, acquiring a preset function marker, and establishing an incidence relation or a mapping relation between target function information and the preset function marker character to obtain a function marker with the incidence relation or the mapping relation; and finally, marking the function information to be compiled (such as binary function addresses and function symbols) by using the function marker with the incidence relation or the mapping relation to obtain a compiled target toolkit.
It should be noted that, in the compiling process, the logic start switch of the realization logic of the scalar function may be added while the running logic injection of the objective function is completed (or before the realization logic is injected). Specifically, firstly, function starting logic associated with a target function is obtained, and a function code text corresponding to the target function which completes injection realization logic is obtained; then, the function start logic is fused with the function code text, for example, the function start logic is added to the function code text corresponding to the objective function, so as to obtain a fused second objective function, where the second objective function includes the objective function and the corresponding function start logic. Therefore, whether the implementation logic of the target function is started or not is determined according to the function starting logic when the target program in the target application is operated.
206. And when the terminal detects that the target tool packet contains the abnormal program function with the running error, the terminal requests the server to acquire a repair file corresponding to the abnormal program function.
It should be noted that the abnormal program function may be a program logic function in which the target program fails to operate or the operation result is inconsistent with the expectation. For example, in the embodiment of the present application, an original function (to-be-compiled function) of an object program is compiled and then has an exception, that is, after the to-be-compiled function is compiled according to the object function, a compiled program logic function is obtained, and the update of the running logic of the object program is completed; however, the effect of the updated program logic function during running is not consistent with the expected result, and if the running logic of the target logic function cannot run or the running result is not accurate, the compiled program logic function is regarded as an "abnormal program function".
When the target program operation failure is detected in the operation process of the updated target program, that is, when the target toolkit is detected to include an abnormal program function with operation failure or abnormal operation result, a repair file related to the abnormal program function may be requested from the server of the target application (or the target program), so as to repair the abnormal program function corresponding to the target program in the target application according to the repair file.
207. And the terminal reads the target program function and the corresponding repair code text in the repair file.
The repair file may be a file for repairing the abnormal program function, or may be an operation logic file for replacing the operation logic of the abnormal program function when the target program is operated.
In order to repair an abnormal program function which fails to operate, in the embodiment of the present application, after a request is made to a server to obtain a repair file corresponding to the abnormal program function, a target program function and a corresponding repair code text need to be read from the repair file, so as to facilitate subsequent repair of an operation logic used for the abnormal program function.
208. And the terminal processes the abnormal program function in the target application according to the target program function and the corresponding repair code text to obtain a processed program running result.
Wherein, the program running result may be a running result of the updated target program in normal running.
In order to obtain an operation result of an updated target program in normal operation, in the embodiment of the present application, when an abnormal program function that fails to operate the target program is detected in an updated (compiled) target toolkit, the operation logic of the abnormal program function needs to be repaired, specifically, after the target program function and a repair code text in a repair file are read, the abnormal program function in a target application is subjected to exception processing according to the target program function and a corresponding repair code text, so as to obtain an operation result of the program after exception processing.
Specifically, after a target program function and a repair code text corresponding to the abnormal program function are obtained, a function involved in the running of the target program can be added to a queue to be processed, and the target program function can be added to the queue to be processed in the running of the target program so as to replace the abnormal program function in the queue to be processed; then, establishing a mapping relation between the program function to be executed in the queue to be processed and the repair code text, and determining the program logic to be executed when the target program runs according to the program function to be executed and the repair code text with the mapping relation; and finally, when the target application is detected to request to execute the abnormal program function, running the logic of the program to be executed to obtain a processed program running result.
By performing the above steps 201 and 208, the following scenarios can be implemented: after a target program in the target application is added with certain functions, the SDK can add functions and interfaces to an access party for calling, but due to certain uncontrollable factors, for example, defects such as breakdown, abnormal page display, abnormal data storage and the like occur to the newly added interfaces in specific machine types, systems, overlay installation and multithread calling environments. It should be noted that the access side (terminal side) does not have a problem when using the SDK _1.0 version, but since the 1.0 version cannot meet the iterative service requirement of the access side, the SDK developer needs to add an SDK function, so that the SDK _1.1 version is generated, and at this time, when the access side application program is upgraded and then is released to an application store, it is found that some interface calls of the SDK _1.1 version are abnormal, so that the SDK side needs to be modified. It should be noted that, since the application program in which the SDK is located may have been released by the provider (located on the server side), the SDK developer packages the SDK and then the access side updates the SDK, and then releases the SDK again. In addition, for the target program in the target application installed on the terminal, the problem can be repaired by directly utilizing the relevant module to receive the repairing code on line. The above scenario may be as shown in fig. 4.
Specifically, by performing steps 201 and 208, the processes shown in fig. 4 and 5 can be implemented as follows:
firstly, adding a script scanning file in a git project where the SDK is located, wherein the script file is used for detecting a code source file and a newly added and modified part of a function. When the SDK developer successfully uploads the code to the git server by executing git push, script scanning is triggered, newly added functions, interfaces and class names are marked, a file path + name is used as a key, and the class name + function name is used as a value to be mapped to generate a hash table, and finally the hash table is stored in the server. It should be noted that Git can better manage version control of the code, and Git can trigger a custom script when a specific important action occurs; for example, there are two groups of such hooks: client-side and server-side, client hooks are invoked by operations such as commit and merge, while server-side hooks act on networking operations such as receiving pushed commits.
And secondly, code instrumentation is carried out in the compiling stage, and an AB switch is added. When the development of the new version of the SDK is finished, developers can compile the SDK, and the scheme adopts a clang compiler to execute instrumentation. Adding fsanitize-coverage = trace-pc-guard in Build Setting's Other C Flags, representing the compiling environment for initializing instrumentation, obtaining the binary function address and function symbol in the current compiling cache, and inserting a _ trace _ function _ guard method, that is, injecting implementation logic in the original function, and adding AB experiment logic in the function code block (the AB experiment refers to obtaining AB data from the back end when registering SDK, and executing different logic according to different data, for example, according to the need _ load _ hot fix field of the AB experiment in the present scheme, if 1, executing _ trace _ function _ guard, if 0, not executing, and this is done to ensure the execution efficiency of the original function under the condition that SDK has no problem), and the switch is turned off by default.
Thirdly, when an SDK access party generates a calling problem and feeds the calling problem back to an SDK developer, the developer performs positioning and repairing, then the repaired code is stored in an SDK server, a JPENtine module is arranged in the SDK of the client and is used for receiving and processing the repaired js source code, when the SDK is registered, a processing queue is started in the JPENtine, a request is triggered to pull the latest js repairing script to the server, the request carries the previous version and the current version number of the SDK, when the server receives the request, whether the repairing source code added by the SDK developer exists or not is judged, if the repairing source code exists, a function AB switch corresponding to the newly added version is pulled and matched from a hash table, a corresponding function AB switch is opened, an encryption. And the JPENgine module carries out decryption operation, reads each hot repair function, and if a plurality of hot repair functions exist, puts the hot repair functions into a processing queue according to the sequence of the returned data. If jscore is required for the bridging process, a jsevaluatelocalchersians function is called for bridging. When the application program executes the function which needs hot repair, the repair code is injected and executed in a code instrumentation mode.
Through the flow scene, the reason of the problem of the online SDK can be quickly positioned, and the labor of developers is saved; the defect of online SDK is overcome, and the stability is improved.
As can be seen from the above, in the embodiment of the present application, when a program update package corresponding to a target program in a target application is detected, an objective function corresponding to the program update package may be obtained; acquiring a to-be-compiled tool packet matched with a target program in a target application, and compiling the to-be-compiled tool packet according to a target function to obtain a compiled target tool packet; when the target tool package is detected to contain an abnormal program function with an operation error, requesting a server to acquire a repair file corresponding to the abnormal program function; reading a target program function and a corresponding repair code text in a repair file; and processing the abnormal program function in the target application according to the target program function and the corresponding repair code text to obtain a processed program running result. Therefore, the program update package corresponding to the target program in the target application can be obtained in real time, the tool package corresponding to the target program in the target application on the terminal is compiled, the application program is updated, and the update rate of the application program is improved; furthermore, for the abnormal program function which runs the error in the compiled tool kit, the abnormal program function is subjected to abnormal repair processing according to the target program function and the repair code text in the repair file by requesting the repair file corresponding to the abnormal program function, so that the program running result after the abnormal processing is obtained, thereby ensuring the normal running of the updated application program, reducing the failure rate of the application program after update iteration and having reliability.
In order to better implement the method, the embodiment of the present application further provides an application exception handling apparatus, which may be integrated in a network device, such as a server or a terminal, and the terminal may include a tablet computer, a notebook computer, and/or a personal computer.
For example, as shown in fig. 6, the application exception handling apparatus may include an acquisition unit 601, a compiling unit 602, a requesting unit 603, a reading unit 604, and a processing unit 605.
An obtaining unit 601, configured to obtain, when a program update package corresponding to a target program in a target application is detected, a target function corresponding to the program update package;
the compiling unit 602 is configured to obtain a to-be-compiled tool package matched with a target program in a target application, and perform compiling processing on the to-be-compiled tool package according to a target function to obtain a compiled target tool package;
a requesting unit 603, configured to, when it is detected that the target toolkit includes an abnormal program function with an operation error, request the server to acquire a repair file corresponding to the abnormal program function;
a reading unit 604, configured to read a target program function and a corresponding repair code text in a repair file;
and the processing unit 605 is configured to process the abnormal program function in the target application according to the target program function and the corresponding repair code text, so as to obtain a processed program operation result.
In some embodiments, the processing unit 605 is further configured to:
adding the target program function into a queue to be processed; determining a target program function corresponding to the abnormal program function in the queue to be processed as a program function to be executed, and establishing a mapping relation between the program function to be executed and a corresponding repair code text to obtain a program logic to be executed; and when the target application is detected to request to execute the abnormal program function, running the logic of the program to be executed to obtain a processed program running result.
In some embodiments, the processing unit 605 is further configured to:
injecting the repair code text into a program function to be executed to obtain a target program logic with an incidence relation; and determining the target program logic as the program logic to be executed corresponding to the abnormal program function.
In some embodiments, compiling unit 602 is further configured to:
initializing the compiling configuration in the to-be-compiled toolkit to obtain an initialized to-be-compiled sub toolkit; and compiling the initialized sub-toolkit to be compiled according to the target function to obtain a compiled target toolkit.
In some embodiments, compiling unit 602 is further configured to:
identifying a compilation configuration in a toolkit to be compiled; updating the compiling configuration according to a preset compiling initialization function to obtain an updated compiling configuration; and determining the tool pack to be compiled containing the updated compiling configuration as an initialized sub tool pack to be compiled.
In some embodiments, compiling unit 602 is further configured to:
acquiring compiling cache information corresponding to the initialized sub-toolkit to be compiled; reading function information to be compiled matched with the target function from the compiling cache information; and compiling the function information to be compiled to obtain a compiled target toolkit.
In some embodiments, compiling unit 602 is further configured to:
acquiring target function information corresponding to a target function; acquiring a preset function marking character, and establishing an incidence relation between the preset function marking character and target function information to obtain a function marking symbol with the incidence relation; and marking the function information to be compiled by using the function marker with the incidence relation to obtain the compiled target toolkit.
In some embodiments, the application exception handling apparatus further comprises a fusion unit, further configured to:
acquiring function starting logic associated with the target function and acquiring a function code text corresponding to the target function; fusing the function starting logic and the function code text to obtain a fused second target function;
the compiling unit 602 is further configured to obtain object function information corresponding to the second object function.
In some embodiments, the application exception handling apparatus further comprises a conversion unit for:
when the format of the repair code text is detected to be not in accordance with the preset code format, converting the repair code text into a code to be executed which is in accordance with the preset code format;
the processing unit 605 is further configured to inject the code to be executed into the program function to be executed, so as to obtain the target program logic having the association relationship.
As can be seen from the above, in the embodiment of the present application, when a program update package corresponding to a target program in a target application is detected, the obtaining unit 601 may obtain a target function corresponding to the program update package; acquiring a to-be-compiled tool package matched with a target program in a target application through a compiling unit 602, and compiling the to-be-compiled tool package according to a target function to obtain a compiled target tool package; when detecting that the target toolkit contains an abnormal program function with an operation error, a request unit 603 requests a server to acquire a repair file corresponding to the abnormal program function; reading a target program function and a corresponding repair code text in the repair file through the reading unit 604; the processing unit 605 processes the abnormal program function in the target application according to the target program function and the corresponding repair code text, and obtains a processed program running result. Therefore, the program update package corresponding to the target program in the target application can be obtained in real time, the tool package corresponding to the target program in the target application on the terminal is compiled, the application program is updated, and the update rate of the application program is improved; furthermore, for the abnormal program function which runs the error in the compiled tool kit, the abnormal program function is subjected to abnormal repair processing according to the target program function and the repair code text in the repair file by requesting the repair file corresponding to the abnormal program function, so that the program running result after the abnormal processing is obtained, thereby ensuring the normal running of the updated application program, reducing the failure rate of the application program after update iteration and having reliability.
The embodiment of the present application further provides a computer device, as shown in fig. 7, which shows a schematic structural diagram of the computer device according to the embodiment of the present application, specifically:
the computer device may include components such as a processor 701 of one or more processing cores, memory 702 of one or more computer-readable storage media, a power supply 703, and an input unit 704. Those skilled in the art will appreciate that the computer device configuration illustrated in FIG. 7 does not constitute a limitation of computer devices, and may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components. Wherein:
the processor 701 is a control center of the computer apparatus, connects various parts of the entire computer apparatus using various interfaces and lines, and performs various functions of the computer apparatus and processes data by running or executing software programs and/or modules stored in the memory 702 and calling data stored in the memory 702, thereby monitoring the computer apparatus as a whole. Optionally, processor 701 may include one or more processing cores; preferably, the processor 701 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 701.
The memory 702 may be used to store software programs and modules, and the processor 701 may execute various functional applications and application exception handling by executing the software programs and modules stored in the memory 702. The memory 702 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the computer device, and the like. Further, the memory 702 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 702 may also include a memory controller to provide the processor 701 with access to the memory 702.
The computer device further includes a power supply 703 for supplying power to the various components, and preferably, the power supply 703 is logically connected to the processor 701 through a power management system, so that functions of managing charging, discharging, and power consumption are implemented through the power management system. The power supply 703 may also include any component including one or more of a dc or ac power source, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
The computer device may also include an input unit 704, the input unit 704 being operable to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the computer device may further include a display unit and the like, which are not described in detail herein. Specifically, in this embodiment of the present application, the processor 701 in the computer device loads the executable file corresponding to the process of one or more application programs into the memory 702 according to the following instructions, and the processor 701 runs the application program stored in the memory 702, thereby implementing various functions as follows:
when a program update package corresponding to a target program in a target application is detected, acquiring a target function corresponding to the program update package; acquiring a to-be-compiled tool packet matched with a target program in a target application, and compiling the to-be-compiled tool packet according to a target function to obtain a compiled target tool packet; when the target tool package is detected to contain an abnormal program function with an operation error, requesting a server to acquire a repair file corresponding to the abnormal program function; reading a target program function and a corresponding repair code text in a repair file; and processing the abnormal program function in the target application according to the target program function and the corresponding repair code text to obtain a processed program running result.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
As can be seen from the above, in the embodiment of the present application, when a program update package corresponding to a target program in a target application is detected, an objective function corresponding to the program update package may be obtained; acquiring a to-be-compiled tool packet matched with a target program in a target application, and compiling the to-be-compiled tool packet according to a target function to obtain a compiled target tool packet; when the target tool package is detected to contain an abnormal program function with an operation error, requesting a server to acquire a repair file corresponding to the abnormal program function; reading a target program function and a corresponding repair code text in a repair file; and processing the abnormal program function in the target application according to the target program function and the corresponding repair code text to obtain a processed program running result. Therefore, the program update package corresponding to the target program in the target application can be obtained in real time, the tool package corresponding to the target program in the target application on the terminal is compiled, the application program is updated, and the update rate of the application program is improved; furthermore, for the abnormal program function which runs the error in the compiled tool kit, the abnormal program function is subjected to abnormal repair processing according to the target program function and the repair code text in the repair file by requesting the repair file corresponding to the abnormal program function, so that the program running result after the abnormal processing is obtained, thereby ensuring the normal running of the updated application program, reducing the failure rate of the application program after update iteration and having reliability.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present application provide a computer-readable storage medium, in which a plurality of instructions are stored, where the instructions can be loaded by a processor to execute the steps in any one of the application exception handling methods provided in the embodiments of the present application. For example, the instructions may perform the steps of:
when a program update package corresponding to a target program in a target application is detected, acquiring a target function corresponding to the program update package; acquiring a to-be-compiled tool packet matched with a target program in a target application, and compiling the to-be-compiled tool packet according to a target function to obtain a compiled target tool packet; when the target tool package is detected to contain an abnormal program function with an operation error, requesting a server to acquire a repair file corresponding to the abnormal program function; reading a target program function and a corresponding repair code text in a repair file; and processing the abnormal program function in the target application according to the target program function and the corresponding repair code text to obtain a processed program running result.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the computer-readable storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the computer-readable storage medium can execute the steps in any application exception handling method provided in the embodiment of the present application, beneficial effects that can be achieved by any application exception handling method provided in the embodiment of the present application can be achieved, which are detailed in the foregoing embodiments and will not be described again here.
The application exception handling method, device and computer-readable storage medium provided by the embodiments of the present application are described in detail above, and a specific example is applied in the present application to explain the principle and the implementation of the present application, and the description of the above embodiments is only used to help understand the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. An application exception handling method, comprising:
when a program update package corresponding to a target program in a target application is detected, acquiring a target function corresponding to the program update package;
acquiring a to-be-compiled tool package matched with the target program in the target application, and compiling the to-be-compiled tool package according to the target function to obtain a compiled target tool package;
when the target tool package is detected to contain an abnormal program function with an operation error, requesting a server to acquire a repair file corresponding to the abnormal program function;
reading a target program function and a corresponding repair code text in the repair file;
and processing the abnormal program function in the target application according to the target program function and the corresponding repair code text to obtain a processed program running result.
2. The method according to claim 1, wherein the processing an abnormal program function in the target application according to the target program function and a corresponding repair code text to obtain a processed program running result comprises:
adding the target program function into a queue to be processed;
determining a target program function corresponding to the abnormal program function in the queue to be processed as a program function to be executed, and establishing a mapping relation between the program function to be executed and the corresponding repair code text to obtain a program logic to be executed;
and when the target application is detected to request to execute the abnormal program function, operating the program logic to be executed to obtain a processed program operation result.
3. The method according to claim 2, wherein the establishing a mapping relationship between the to-be-executed program function and the corresponding repair code text to obtain to-be-executed program logic comprises:
injecting the repair code text into the program function to be executed to obtain a target program logic with an incidence relation;
and determining the target program logic as the program logic to be executed corresponding to the abnormal program function.
4. The method according to claim 1, wherein the compiling the to-be-compiled toolkit according to the object function to obtain a compiled object toolkit comprises:
initializing the compiling configuration in the toolkit to be compiled to obtain an initialized sub-toolkit to be compiled;
and compiling the initialized sub-toolkit to be compiled according to the target function to obtain a compiled target toolkit.
5. The method according to claim 4, wherein initializing the compilation configuration in the toolkit to be compiled to obtain an initialized toolkit to be compiled, comprises:
identifying a compilation configuration in the toolkit to be compiled;
updating the compiling configuration according to a preset compiling initialization function to obtain an updated compiling configuration;
and determining the tool pack to be compiled containing the updated compiling configuration as an initialized sub tool pack to be compiled.
6. The method according to claim 4, wherein the compiling the initialized sub-toolkit to be compiled according to the object function to obtain a compiled object toolkit comprises:
acquiring compiling cache information corresponding to the initialized sub-toolkit to be compiled;
reading function information to be compiled matched with the target function from the compiling cache information;
and compiling the function information to be compiled to obtain a compiled target toolkit.
7. The method according to claim 6, wherein the compiling the function information to be compiled to obtain a compiled object toolkit includes:
acquiring target function information corresponding to the target function;
acquiring a preset function marking character, and establishing an incidence relation between the preset function marking character and target function information to obtain a function marking symbol with the incidence relation;
and marking the function information to be compiled by using the function marker with the incidence relation to obtain a compiled target toolkit.
8. The method of claim 7, further comprising:
acquiring function starting logic associated with the target function, and acquiring a function code text corresponding to the target function;
fusing the function starting logic and the function code text to obtain a fused second target function;
the obtaining of the target function information corresponding to the target function includes:
and acquiring target function information corresponding to the second target function.
9. An application exception handling apparatus, comprising:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a target function corresponding to a program update package when the program update package corresponding to a target program in a target application is detected;
the compiling unit is used for acquiring a to-be-compiled tool package matched with the target program in the target application, and compiling the to-be-compiled tool package according to the target function to obtain a compiled target tool package;
the request unit is used for requesting a server to acquire a repair file corresponding to an abnormal program function when the target tool package is detected to contain the abnormal program function with the wrong operation;
the reading unit is used for reading the target program function and the corresponding repair code text in the repair file;
and the processing unit is used for processing the abnormal program function in the target application according to the target program function and the corresponding repair code text to obtain a processed program running result.
10. A computer-readable storage medium, wherein the computer-readable storage medium is computer-readable and stores a plurality of instructions, the instructions being suitable for being loaded by a processor to perform the steps of the application exception handling method according to any one of claims 1 to 8.
CN202111332266.2A 2021-11-11 2021-11-11 Application exception handling method and device and computer readable storage medium Active CN113791809B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111332266.2A CN113791809B (en) 2021-11-11 2021-11-11 Application exception handling method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111332266.2A CN113791809B (en) 2021-11-11 2021-11-11 Application exception handling method and device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN113791809A true CN113791809A (en) 2021-12-14
CN113791809B CN113791809B (en) 2022-03-04

Family

ID=78955256

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111332266.2A Active CN113791809B (en) 2021-11-11 2021-11-11 Application exception handling method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113791809B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116701234A (en) * 2023-08-04 2023-09-05 腾讯科技(深圳)有限公司 Application program debugging method and device, computer equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106371940A (en) * 2015-07-21 2017-02-01 腾讯科技(深圳)有限公司 Solution method and device for program crash
CN109240723A (en) * 2018-09-03 2019-01-18 中国平安人寿保险股份有限公司 Application program update method, system, computer equipment and storage medium
CN111782302A (en) * 2020-07-13 2020-10-16 腾讯科技(深圳)有限公司 Process updating method and device, storage medium and electronic equipment
CN112698850A (en) * 2019-10-22 2021-04-23 北京华为数字技术有限公司 Optimized upgrading method and related equipment
CN113342389A (en) * 2021-05-31 2021-09-03 深圳市腾讯网络信息技术有限公司 Service updating method and device and computer readable storage medium
CN113504934A (en) * 2021-07-14 2021-10-15 安徽聆思智能科技有限公司 Patch compiling method, patch program repairing method and related equipment
CN113568834A (en) * 2021-07-28 2021-10-29 南方电网数字电网研究院有限公司 SDK code compatibility detection method, device, computer equipment and medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106371940A (en) * 2015-07-21 2017-02-01 腾讯科技(深圳)有限公司 Solution method and device for program crash
CN109240723A (en) * 2018-09-03 2019-01-18 中国平安人寿保险股份有限公司 Application program update method, system, computer equipment and storage medium
CN112698850A (en) * 2019-10-22 2021-04-23 北京华为数字技术有限公司 Optimized upgrading method and related equipment
CN111782302A (en) * 2020-07-13 2020-10-16 腾讯科技(深圳)有限公司 Process updating method and device, storage medium and electronic equipment
CN113342389A (en) * 2021-05-31 2021-09-03 深圳市腾讯网络信息技术有限公司 Service updating method and device and computer readable storage medium
CN113504934A (en) * 2021-07-14 2021-10-15 安徽聆思智能科技有限公司 Patch compiling method, patch program repairing method and related equipment
CN113568834A (en) * 2021-07-28 2021-10-29 南方电网数字电网研究院有限公司 SDK code compatibility detection method, device, computer equipment and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116701234A (en) * 2023-08-04 2023-09-05 腾讯科技(深圳)有限公司 Application program debugging method and device, computer equipment and storage medium
CN116701234B (en) * 2023-08-04 2024-02-02 腾讯科技(深圳)有限公司 Application program debugging method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN113791809B (en) 2022-03-04

Similar Documents

Publication Publication Date Title
US10528742B2 (en) Method and apparatus for repairing kernel vulnerability
CN108829378B (en) Application software development method and device and electronic equipment
US20160378456A1 (en) Method for offline updating virtual machine images
CN102707999A (en) Application compatibility leveraging successful resolution of issues
CN111949529B (en) System debugging method, device, computer equipment and storage medium
CN107220074A (en) To the access of supporting layer software function, upgrade method and device
CN112783912A (en) Data processing method and device, computer equipment and storage medium
CN113760306A (en) Method and device for installing software, electronic equipment and storage medium
CN113791809B (en) Application exception handling method and device and computer readable storage medium
CN115576600A (en) Code change-based difference processing method and device, terminal and storage medium
CN115543429A (en) Project environment building method, electronic equipment and computer readable storage medium
CN113961226B (en) Software development kit repairing method, terminal, server and equipment
CN111090442B (en) Application updating method, device and storage medium
CN107621945A (en) A kind of method and device for the mark for determining ios device
CN115454575B (en) jar packet conversion and automatic loading method, device, equipment and storage medium
CN113220279A (en) Code index management method, device, equipment and medium
CN113590179B (en) Plug-in detection method and device, electronic equipment and storage medium
CN116069366A (en) Client application program updating method and device, storage medium and electronic equipment
CN115729590A (en) Service deployment method, device, equipment and computer readable storage medium
CN114860202A (en) Project operation method, device, server and storage medium
CN115374083A (en) Data source switching method and device, electronic equipment and storage medium
CN112947956B (en) Application software upgrading method
CN112596816B (en) Form processing method and device and electronic equipment
CN115964061A (en) Plug-in updating method and device, electronic equipment and computer readable storage medium
CN115129348A (en) Resource updating method, device and equipment of application program and readable 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
GR01 Patent grant
GR01 Patent grant